[GH-ISSUE #644] MD2 format error #303

Closed
opened 2026-10-14 03:00:31 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @frank-dittrich on GitHub (Jun 19, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/644

$ ./john --format=MD2 --list=format-tests |cut -f 3 > MD2.hashes
$ ./john --format=MD2 --list=format-tests |cut -f 4 > MD2.pw
$ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw
Loaded 3 password hashes with no different salts (MD2 [MD2 32/64])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
message digest   (?)
message digest   (?)
len=125_____________________________________________________________________________________________________________________x (?)
3g 0:00:00:00 DONE (2014-06-19 21:43) 300.0g/s 200.0p/s 200.0c/s 600.0C/s message digest..len=125_____________________________________________________________________________________________________________________x
Use the "--show" option to display all of the cracked passwords reliably
Session completed
$ cat john.pot 
$md2$ab4f496bfb2a530b219ff33031fe06b0:message digest
921adc047dad311394d2b8553002042d:len=125_____________________________________________________________________________________________________________________x

For some reason, only one of the two hashes cracked with password "messages digest" has been stored in john.pot.

$ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw
Loaded 3 password hashes with no different salts (MD2 [MD2 32/64])
Remaining 1 password hash
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
message digest   (?)
1g 0:00:00:00 DONE (2014-06-19 21:44) 100.0g/s 200.0p/s 200.0c/s 200.0C/s message digest..len=125_____________________________________________________________________________________________________________________x
Use the "--show" option to display all of the cracked passwords reliably
Originally created by @frank-dittrich on GitHub (Jun 19, 2014). Original GitHub issue: https://github.com/openwall/john/issues/644 ``` $ ./john --format=MD2 --list=format-tests |cut -f 3 > MD2.hashes $ ./john --format=MD2 --list=format-tests |cut -f 4 > MD2.pw $ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw Loaded 3 password hashes with no different salts (MD2 [MD2 32/64]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status message digest (?) message digest (?) len=125_____________________________________________________________________________________________________________________x (?) 3g 0:00:00:00 DONE (2014-06-19 21:43) 300.0g/s 200.0p/s 200.0c/s 600.0C/s message digest..len=125_____________________________________________________________________________________________________________________x Use the "--show" option to display all of the cracked passwords reliably Session completed $ cat john.pot $md2$ab4f496bfb2a530b219ff33031fe06b0:message digest 921adc047dad311394d2b8553002042d:len=125_____________________________________________________________________________________________________________________x ``` For some reason, only one of the two hashes cracked with password "messages digest" has been stored in john.pot. ``` $ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw Loaded 3 password hashes with no different salts (MD2 [MD2 32/64]) Remaining 1 password hash Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status message digest (?) 1g 0:00:00:00 DONE (2014-06-19 21:44) 100.0g/s 200.0p/s 200.0c/s 200.0C/s message digest..len=125_____________________________________________________________________________________________________________________x Use the "--show" option to display all of the cracked passwords reliably ```
bsakaguchi 2026-10-14 03:00:31 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@frank-dittrich commented on GitHub (Jun 19, 2014):

MSCHAPv2 has the same problem, so it might not be format specific!

$ ./john --format=MSCHAPv2 --list=format-tests |cut -f 4 > MSCHAPv2.pw
$ ./john --format=MSCHAPv2 --list=format-tests |cut -f 3 > MSCHAPv2.hashes
$ ./john --format=MSCHAPv2 MSCHAPv2.hashes --wordlist=MSCHAPv2.pw
Loaded 11 password hashes with 9 different salts (MSCHAPv2, C/R [MD4 DES (ESS MD5) 128/128 AVX 12x])
Warning: no OpenMP support for this hash type, consider --fork=4
Press 'q' or Ctrl-C to abort, almost any other key for status
bar4             (?)
bar4             (?)
password         (?)
password         (?)
Cricket8         (?)
solarisalwaysbusy (?)
OMG!BBQ!11!one   (?)
2222             (?)
                 (?)
bPCFyF2uL1p5Lg5yrKmqmY (?)
clientPass       (?)
11g 0:00:00:00 DONE (2014-06-19 21:47) 157.1g/s 185.7p/s 1671c/s 2042C/s 2222
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed
$ wc -l john.pot 
9 john.pot
$ ./john --format=MSCHAPv2 MSCHAPv2.hashes --wordlist=MSCHAPv2.pw
Loaded 11 password hashes with 9 different salts (MSCHAPv2, C/R [MD4 DES (ESS MD5) 128/128 AVX 12x])
Remaining 2 password hashes with 2 different salts
Warning: no OpenMP support for this hash type, consider --fork=4
Press 'q' or Ctrl-C to abort, almost any other key for status
bar4             (?)
password         (?)
2g 0:00:00:00 DONE (2014-06-19 21:48) 100.0g/s 650.0p/s 1300c/s 1300C/s 2222
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed
$ wc -l john.pot 
11 john.pot
<!-- gh-comment-id:46608024 --> @frank-dittrich commented on GitHub (Jun 19, 2014): MSCHAPv2 has the same problem, so it might not be format specific! ``` $ ./john --format=MSCHAPv2 --list=format-tests |cut -f 4 > MSCHAPv2.pw $ ./john --format=MSCHAPv2 --list=format-tests |cut -f 3 > MSCHAPv2.hashes $ ./john --format=MSCHAPv2 MSCHAPv2.hashes --wordlist=MSCHAPv2.pw Loaded 11 password hashes with 9 different salts (MSCHAPv2, C/R [MD4 DES (ESS MD5) 128/128 AVX 12x]) Warning: no OpenMP support for this hash type, consider --fork=4 Press 'q' or Ctrl-C to abort, almost any other key for status bar4 (?) bar4 (?) password (?) password (?) Cricket8 (?) solarisalwaysbusy (?) OMG!BBQ!11!one (?) 2222 (?) (?) bPCFyF2uL1p5Lg5yrKmqmY (?) clientPass (?) 11g 0:00:00:00 DONE (2014-06-19 21:47) 157.1g/s 185.7p/s 1671c/s 2042C/s 2222 Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed $ wc -l john.pot 9 john.pot $ ./john --format=MSCHAPv2 MSCHAPv2.hashes --wordlist=MSCHAPv2.pw Loaded 11 password hashes with 9 different salts (MSCHAPv2, C/R [MD4 DES (ESS MD5) 128/128 AVX 12x]) Remaining 2 password hashes with 2 different salts Warning: no OpenMP support for this hash type, consider --fork=4 Press 'q' or Ctrl-C to abort, almost any other key for status bar4 (?) password (?) 2g 0:00:00:00 DONE (2014-06-19 21:48) 100.0g/s 650.0p/s 1300c/s 1300C/s 2222 Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed $ wc -l john.pot 11 john.pot ```
Author
Owner

@jfoug commented on GitHub (Jun 20, 2014):

$ ./john --format=MD2 --list=format-tests |cut -f 3 > MD2.hashes
$ ./john --format=MD2 --list=format-tests |cut -f 4 > MD2.pw
$ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw
Loaded 3 password hashes with no different salts (MD2 [MD2 32/64])
Will run 4 OpenMP threads

The bug is that it loaded 3 hashes. There are only 2 hashes there, but one was listed twice, and john is not smart enought to see it is an identical item. When it cracks, john will only write the password one time (non-salted hash).

This is a problem that will not be resolved without alias handling EVEN within the same format. John 'could' be a little smarter, by calling prepare and then removing hashes AFTER the prepare, but it is likely that this format does not have a prepare. That IMHO is a bug. Any format that handles multiple layouts of an identical item (such as multi case hex), should normalize ALL of them, so that john can reduce this.

There should have only been 2 hashes loaded.

<!-- gh-comment-id:46631832 --> @jfoug commented on GitHub (Jun 20, 2014): ``` $ ./john --format=MD2 --list=format-tests |cut -f 3 > MD2.hashes $ ./john --format=MD2 --list=format-tests |cut -f 4 > MD2.pw $ ./john --format=MD2 MD2.hashes --wordlist=MD2.pw Loaded 3 password hashes with no different salts (MD2 [MD2 32/64]) Will run 4 OpenMP threads ``` The bug is that it loaded 3 hashes. There are only 2 hashes there, but one was listed twice, and john is not smart enought to see it is an identical item. When it cracks, john will only write the password one time (non-salted hash). This is a problem that will not be resolved without alias handling EVEN within the same format. John 'could' be a little smarter, by calling prepare and then removing hashes AFTER the prepare, but it is likely that this format does not have a prepare. That IMHO is a bug. Any format that handles multiple layouts of an identical item (such as multi case hex), should normalize ALL of them, so that john can reduce this. There should have only been 2 hashes loaded.
Author
Owner

@jfoug commented on GitHub (Jun 20, 2014):

Fixed .11920d6

<!-- gh-comment-id:46632401 --> @jfoug commented on GitHub (Jun 20, 2014): Fixed .11920d6
Author
Owner

@jfoug commented on GitHub (Jun 20, 2014):

$ ./run/john in3 -w=pw
Loaded 2 password hashes with no different salts (MD2 [MD2 32/32])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
len=125_____________________________________________________________________________________________________________________x (?)
message digest   (?)
2g 0:00:00:00 DONE (2014-06-19 19:10) 2000g/s 2000p/s 2000c/s 4000C/s message digest..len=125_____________________________________________________________________________________________________________________x
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed
<!-- gh-comment-id:46632478 --> @jfoug commented on GitHub (Jun 20, 2014): ``` $ ./run/john in3 -w=pw Loaded 2 password hashes with no different salts (MD2 [MD2 32/32]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status len=125_____________________________________________________________________________________________________________________x (?) message digest (?) 2g 0:00:00:00 DONE (2014-06-19 19:10) 2000g/s 2000p/s 2000c/s 4000C/s message digest..len=125_____________________________________________________________________________________________________________________x Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#303
No description provided.