[GH-ISSUE #475] ./john --format=crypt testfile fails in valid() #187

Closed
opened 2026-10-14 02:55:37 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @magnumripper on GitHub.

So far only tested on linux-x86-native...

$ cat testfile

123456:+9F93o1OxwgK1
:$1$$qRPK7m23GJusamGpoGLby/

(This is one bfegg test case + one md5crypt test case.)

$ ./john --format=crypt testfile
Warning: hash encoding string length 13, type id #1
appears to be unsupported on this system; will not load such hashes.
Loaded 1 password hash (crypt, generic crypt(3) [?/32])
Self test failed (valid)

$ ./john --format=crypt testfile --subformat=descrypt
Warning: hash encoding string length 13, type id #1
appears to be unsupported on this system; will not load such hashes.
Loaded 1 password hash (crypt, generic crypt(3) [?/32])
Self test failed (valid)

$ ./john --format=crypt t --subformat=md5crypt
Warning: hash encoding string length 13, type id #1
appears to be unsupported on this system; will not load such hashes.
Loaded 1 password hash (crypt, generic crypt(3) [?/32])
Press 'q' or Ctrl-C to abort, almost any other key for status
()
1g 0:00:00:00 DONE (2014-01-09 01:33) 1.785g/s 171.4p/s 171.4c/s 171.4C/s 123456..pepper

$ rm john.pot

$ time ./john --format=crypt t --subformat=sha512crypt
Warning: hash encoding string length 13, type id #1
appears to be unsupported on this system; will not load such hashes.
Loaded 1 password hash (crypt, generic crypt(3) [?/32])
Press 'q' or Ctrl-C to abort, almost any other key for status
()
1g 0:00:00:00 DONE (2014-01-09 01:53) 1.724g/s 165.5p/s 165.5c/s 165.5C/s 123456..pepper
Use the "--show" option to display all of the cracked passwords reliably
Session completed

Why is john first performing a self test for 6, and then going on cracking the md5crypt test hash, even when I specified --subformat=sha512crypt?

Same here:

$ ./john --format=crypt testfile --subformat=sha256crypt
Warning: hash encoding string length 13, type id #1
appears to be unsupported on this system; will not load such hashes.
Loaded 1 password hash (crypt, generic crypt(3) [?/32])
No password hashes left to crack (see FAQ)

John shouldn't load the md5crypt hash when --subformat=sha256crypt is specified.

Originally created by @frank-dittrich on GitHub (Jan 9, 2014). Original GitHub issue: https://github.com/openwall/john/issues/475 Originally assigned to: @magnumripper on GitHub. So far only tested on linux-x86-native... $ cat testfile ``` 123456:+9F93o1OxwgK1 :$1$$qRPK7m23GJusamGpoGLby/ ``` (This is one bfegg test case + one md5crypt test case.) $ ./john --format=crypt testfile Warning: hash encoding string length 13, type id #1 appears to be unsupported on this system; will not load such hashes. Loaded 1 password hash (crypt, generic crypt(3) [?/32]) Self test failed (valid) $ ./john --format=crypt testfile --subformat=descrypt Warning: hash encoding string length 13, type id #1 appears to be unsupported on this system; will not load such hashes. Loaded 1 password hash (crypt, generic crypt(3) [?/32]) Self test failed (valid) $ ./john --format=crypt t --subformat=md5crypt Warning: hash encoding string length 13, type id #1 appears to be unsupported on this system; will not load such hashes. Loaded 1 password hash (crypt, generic crypt(3) [?/32]) Press 'q' or Ctrl-C to abort, almost any other key for status () 1g 0:00:00:00 DONE (2014-01-09 01:33) 1.785g/s 171.4p/s 171.4c/s 171.4C/s 123456..pepper $ rm john.pot $ time ./john --format=crypt t --subformat=sha512crypt Warning: hash encoding string length 13, type id #1 appears to be unsupported on this system; will not load such hashes. Loaded 1 password hash (crypt, generic crypt(3) [?/32]) Press 'q' or Ctrl-C to abort, almost any other key for status () 1g 0:00:00:00 DONE (2014-01-09 01:53) 1.724g/s 165.5p/s 165.5c/s 165.5C/s 123456..pepper Use the "--show" option to display all of the cracked passwords reliably Session completed Why is john first performing a self test for $6$, and then going on cracking the md5crypt test hash, even when I specified --subformat=sha512crypt? Same here: $ ./john --format=crypt testfile --subformat=sha256crypt Warning: hash encoding string length 13, type id #1 appears to be unsupported on this system; will not load such hashes. Loaded 1 password hash (crypt, generic crypt(3) [?/32]) No password hashes left to crack (see FAQ) John shouldn't load the md5crypt hash when --subformat=sha256crypt is specified.
bsakaguchi 2026-10-14 02:55:37 +07:00
Author
Owner

@magnumripper commented on GitHub (Jan 9, 2014):

On 2014-01-09 01:57, frank-dittrich wrote:

Why is john first performing a self test for 6, and then going on
cracking the md5crypt test hash, even when I specified
--subformat=sha512crypt?

It was never intended to work - the only thing -subformat does is change
the test vector. It was just a hack for benchmarking the crypt lib with
other hashes than DES.

<!-- gh-comment-id:31899728 --> @magnumripper commented on GitHub (Jan 9, 2014): On 2014-01-09 01:57, frank-dittrich wrote: > Why is john first performing a self test for $6$, and then going on > cracking the md5crypt test hash, even when I specified > --subformat=sha512crypt? It was never intended to work - the only thing -subformat does is change the test vector. It was just a hack for benchmarking the crypt lib with other hashes than DES.
Author
Owner

@magnumripper commented on GitHub (Jan 27, 2014):

Maybe the correct fix would be to not allow -subformat except with -test, for this format.

<!-- gh-comment-id:33430207 --> @magnumripper commented on GitHub (Jan 27, 2014): Maybe the correct fix would be to not allow -subformat except with -test, for this format.
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#187
No description provided.