1

In order to understand what should be done in a real user case, I made this test:

  • I created a GnuPG key, with the passphrase twothree
  • I exported the private key part of it (ASCII armored)
  • I generated the hash file for this part by using the gpg2john utility
  • I creted a password.lst file (replacing the default one) with the expression twothree as its single line

Now:

  • running john on the hash file using the --wordlist=password.lst option will find the password almost instantaneous
  • running john on the hash file with no other option will find the password after a minute or so, at the stage when it comes to the password list method

However:

  • if I split the password from the password.lst file into two lines, i.e.
    two  
    three

then john is no longer able to find the password [in reasonable amount of time], regardless if using the --wordlist option or not.

I suppose (?) this involves the rules somehow, but I am not able to proper configure the rules for this usage.

What I want is to instruct john to include all possible combinations of the words (expressions) from the given password.lst file, which in this test can be two three twothree threetwo.

For a real user case, I need to find a forgotten passphrase that is most likely (only) a combination of a few possible known expressions – not that many, but enough to be too complicated to try manually all of it.

What should be done in order to achieve this ?

2 Answers 2

0

I was never able to figure out how to do this with John, but hashcat can do it very easily with a combinator attack.

From the docs, Hashcat GPG mode seems to be 17010. Copy the gpg2john hash to a separate file (ex. hashes.txt) and make sure it matches the specified format

The attack itself is explained clearly at the link, but all you should need to do is run it with the same wordlist on each side:

./hashcat64.bin -m 17010 -a 1 hashes.txt wordlist.txt wordlist.txt

Could also increase the workload profile if you want for larger dicts.

0

This is simply possible using hashcat, if you are flexible with the tool choice. You can check the documentation on https://miloserdov.org/?p=6032#8 under section "How to create combined dictionaries".

Dictionary 1 (dict1.dict):

two

Dictionary 2 (dict2.dict):

three

Note: Ensure that there is end of line character in each dictionary after the last line.

This is called a Combinator attack, its detailed description: https://hashcat.net/wiki/doku.php?id=combinator_attack

Launching a combinatorial attacks (-a 1):

hashcat -a 1 --stdout dict1.dict dict2.dict > tmp12.dict

Temp Dictionary 12 (tmp12.dict):

twothree

Launch again in reverse order:

hashcat -a 1 --stdout dict2.dict dict1.dict > tmp21.dict

Temp Dictionary 21 (tmp21.dict):

threetwo

Copying all 4 dictionaries together:

copy dict1.dict + dict2.dict + tmp12.dict + tmp21.dict all.dict

Content of all.dict:

two
three
twothree
threetwo
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .