Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cracking Monero wallets #3151

Merged
merged 1 commit into from Feb 14, 2018
Merged

Add support for cracking Monero wallets #3151

merged 1 commit into from Feb 14, 2018

Conversation

kholia
Copy link
Member

@kholia kholia commented Feb 10, 2018

NOTE: I still have to clean up this code!

This fixes #3144.

@kholia kholia added new format new tool Typically a foobar2john tool labels Feb 10, 2018
@kholia
Copy link
Member Author

kholia commented Feb 10, 2018

Things to do,

  • Reuse the existing Keccak code we have.

  • Formatting, and whitespace cleanups.

Update:

Mapping the new Keccak "API" to our existing Keccak implementation doesn't look trivial.

@kholia
Copy link
Member Author

kholia commented Feb 10, 2018

This is a very slow hash,

$ ../run/john --test --format=monero  # i7-6600U CPU
Will run 4 OpenMP threads
Benchmarking: monero, monero Wallet [AES+ChaCha+Various 64/64]... (4xOMP) DONE
Raw:	9.1 c/s real, 2.4 c/s virtual

/*
* Format for cracking Monero wallet hashes.
*
* This software is Copyright (c) 2017, Dhiru Kholia <dhiru [at] openwall.com>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 2018!

#define FORMAT_NAME "monero Wallet"
#define FORMAT_TAG "$monero$"
#define TAG_LENGTH (sizeof(FORMAT_TAG) - 1)
#define ALGORITHM_NAME "AES+ChaCha+Various 64/" ARCH_BITS_STR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use to have + in algo names. I'd prefer spaces or perhaps /

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and perhaps it should say "pseudo AES" or something, since it's not a normal one.

return saved_key[index];
}

void cn_slow_hash(const void *data, size_t length, char *hash);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps create (and source) a slow_hash.h?

@kholia
Copy link
Member Author

kholia commented Feb 10, 2018

I have addressed your code comments, thanks!

I am now testing cracking of Unicode passwords.

@kholia
Copy link
Member Author

kholia commented Feb 10, 2018

Update,

  • I have added a Unicode test vector now.

  • Our BLAKE2 implementation was somehow not working. Added BLAKE2 implementation from Monero project.

I don't like the duplicated implementations. Hopefully, we will be able to unify them somehow.

@kholia
Copy link
Member Author

kholia commented Feb 10, 2018

Monero wallet code base also supports legacy wallets. Support for them needs to be added and tested.

Note:

Search for "old format before JSON wallet key file format" string in wallet2.cpp file.

@kholia
Copy link
Member Author

kholia commented Feb 11, 2018

Maybe we don't need to support the old wallet format. Even the oldest downloadable release of Monero (i.e. 0.9.1 Hydrogen Helix) uses the new JSON wallet format.

$ head monero2john.py
...
# + Tested with monero-gui-v0.11.1.0 on Fedora 27.
# + Tested with monero.linux.x64.v0-9-0-0.tar.bz2 (from Jan, 2016) on Fedora 27.

@magnumripper
Copy link
Member

magnumripper commented Feb 13, 2018

Mapping the new Keccak "API" to our existing Keccak implementation doesn't look trivial.

In what way was it not trivial? I just had a (very) quick look and I didn't see anything weird. Can't you just write wrapper macros?

Our BLAKE2 implementation was somehow not working. Added BLAKE2 implementation from Monero project.

Do they produce different hashes? This should be investigated. I see there are flavours of Blake2... Here's test vectors for all of them: https://github.com/BLAKE2/BLAKE2/tree/master/testvectors

You have my "permission" to merge this as-is, although I'd rather see these issues fixed first (or it probably won't happen at all).

@kholia
Copy link
Member Author

kholia commented Feb 14, 2018

I have opened an issue about this code duplication stuff, and assigned it to myself. Hopefully, I will get the motivation and free time to work on it soon.

@kholia kholia merged commit 01cb92c into openwall:bleeding-jumbo Feb 14, 2018
@kholia kholia deleted the Monero branch March 7, 2018 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new format new tool Typically a foobar2john tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for cracking Monero wallets
2 participants