[GH-ISSUE #651] dynamic_15 format errors #308

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

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

(bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |cut -f 3 > dynamic_15.hashes
(bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |cut -f 4 > dynamic_15.pw    
(bleeding-jumbo)run $ ./john --format=dynamic_15 dynamic_15.hashes --wordlist=dynamic_15.pw    
Loaded 6 password hashes with 6 different salts (dynamic_15 [md5($u.md5($p).$s) 128/128 AVX 480x4x3])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
test1            (?)
thatsworking     (?)
test3            (?)
3g 0:00:00:00 DONE (2014-06-20 11:59) 300.0g/s 2400p/s 14400c/s 14400C/s test1..test3
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed
(bleeding-jumbo)run $ cat john.pot 
$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1
$dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$HEX$31323334353624245561646d696e:thatsworking
$dynamic_15$63aea4b8fe491df8545cc0099ac668d4$HEX$35353535686824245572616c7068:test3
(bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |head -n 6               
dynamic_15  0   $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB$$Ujoeblow   test1
dynamic_15  1   $dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$123456$$Uadmin thatsworking
dynamic_15  2   $dynamic_15$63aea4b8fe491df8545cc0099ac668d4$5555hh$$Uralph test3
dynamic_15  3   $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB test1
dynamic_15  4   $dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$123456 thatsworking
dynamic_15  5   $dynamic_15$63aea4b8fe491df8545cc0099ac668d4$5555hh test3

I think dynamic_15 must include the user name in the canonical form of the hash that gets stored in john.pot.
So, instead of

$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1

the john.pot entry should be

$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77$$Ujoeblow:test1

Also, dynamic_15 shouldn't treat

$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB

as a valid hash, since it is missing the $$U part.

I know I need to work on the --list=format-tests output (call prepare() if the ciphertext is invalid).

Originally created by @frank-dittrich on GitHub (Jun 20, 2014). Original GitHub issue: https://github.com/openwall/john/issues/651 ``` (bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |cut -f 3 > dynamic_15.hashes (bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |cut -f 4 > dynamic_15.pw (bleeding-jumbo)run $ ./john --format=dynamic_15 dynamic_15.hashes --wordlist=dynamic_15.pw Loaded 6 password hashes with 6 different salts (dynamic_15 [md5($u.md5($p).$s) 128/128 AVX 480x4x3]) Will run 4 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status test1 (?) thatsworking (?) test3 (?) 3g 0:00:00:00 DONE (2014-06-20 11:59) 300.0g/s 2400p/s 14400c/s 14400C/s test1..test3 Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed (bleeding-jumbo)run $ cat john.pot $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1 $dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$HEX$31323334353624245561646d696e:thatsworking $dynamic_15$63aea4b8fe491df8545cc0099ac668d4$HEX$35353535686824245572616c7068:test3 (bleeding-jumbo)run $ ./john --format=dynamic_15 --list=format-tests |head -n 6 dynamic_15 0 $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB$$Ujoeblow test1 dynamic_15 1 $dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$123456$$Uadmin thatsworking dynamic_15 2 $dynamic_15$63aea4b8fe491df8545cc0099ac668d4$5555hh$$Uralph test3 dynamic_15 3 $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB test1 dynamic_15 4 $dynamic_15$6a2dc4a6637bc5c2488f27faeead8720$123456 thatsworking dynamic_15 5 $dynamic_15$63aea4b8fe491df8545cc0099ac668d4$5555hh test3 ``` I think dynamic_15 must include the user name in the canonical form of the hash that gets stored in john.pot. So, instead of ``` $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1 ``` the john.pot entry should be ``` $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77$$Ujoeblow:test1 ``` Also, dynamic_15 shouldn't treat ``` $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB ``` as a valid hash, since it is missing the $$U<user> part. I know I need to work on the --list=format-tests output (call prepare() if the ciphertext is invalid).
bsakaguchi 2026-10-14 03:00:38 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

BTW: dynamic_35 is somehow similar to dynami_15.
The hashes stored in john.pot do contain the user names (converted to hex), but

$dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d

is considered as valid (apparently, it is internally converted into

$dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d$$U?

(At least that's what --show=LEFT produces.

I think these hashes without user name should be invalid (prepare should reject them) or converted into hex as well (with an empty user name) like this:

$dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d$$HEX$2455

But I wouldn't want to waste run time on those and reject them (unless there really can be an empty user name).

Do you prefer a separate issue for dynamic_35 (and for other dynamic formats with similar problems as well) or should I wait for your reply and don't bother with creating new issues for dynamic?
dynamic_36 and dynamic_37 seem to have similar issues, dynamic_1401 as well.

<!-- gh-comment-id:46664820 --> @frank-dittrich commented on GitHub (Jun 20, 2014): BTW: dynamic_35 is somehow similar to dynami_15. The hashes stored in john.pot do contain the user names (converted to hex), but ``` $dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d ``` is considered as valid (apparently, it is internally converted into ``` $dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d$$U? ``` (At least that's what --show=LEFT produces. I think these hashes without user name should be invalid (prepare should reject them) or converted into hex as well (with an empty user name) like this: ``` $dynamic_35$a12c6e0d8a4bcabb7f588456cbd20eac3332724d$$HEX$2455 ``` But I wouldn't want to waste run time on those and reject them (unless there really can be an empty user name). Do you prefer a separate issue for dynamic_35 (and for other dynamic formats with similar problems as well) or should I wait for your reply and don't bother with creating new issues for dynamic? dynamic_36 and dynamic_37 seem to have similar issues, dynamic_1401 as well.
Author
Owner

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

$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1

2424556a6f65626c6f77 IS $$Ujoeblow

Also, dynamic_15 shouldn't treat
$dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB
as a valid hash, since it is missing the $$U part.

That must have come from a .pot file. The problem there, is all that really matters, is the 609... part, BUT this does cause failures of the dupelicate detection.

I will look into dyna_15 (or other $$Uxxx or other extra field stuff, to make sure that john core code is dealing with a normalized hash. This MAY also have to deal with the source() method, and making sure that it re-builds the hash properly. I do not know yet.

<!-- gh-comment-id:46665326 --> @jfoug commented on GitHub (Jun 20, 2014): ``` $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$HEX$6161615358422424556a6f65626c6f77:test1 ``` 2424556a6f65626c6f77 IS $$Ujoeblow > Also, dynamic_15 shouldn't treat > $dynamic_15$6093d5cb3e2f99d9110eb9c4bbca5f8c$aaaSXB > as a valid hash, since it is missing the $$U part. That must have come from a .pot file. The problem there, is all that really matters, is the 609... part, BUT this does cause failures of the dupelicate detection. I will look into dyna_15 (or other $$Uxxx or other extra field stuff, to make sure that john core code is dealing with a normalized hash. This MAY also have to deal with the source() method, and making sure that it re-builds the hash properly. I do not know yet.
Author
Owner

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

dynamic_1015 is similar as well.
It treats

$dynamic_1015$1d586cc8d137e5f1733f234d224393e8$HEX$f063f05d

as valid, even though there's no user name.
Internally, that hash gets converted to

?:$dynamic_1015$1d586cc8d137e5f1733f234d224393e8$�c�]$$U?

I think this formaat should keep the hex incoding.
Otherwise, you get funny results for hex values that translate into line feed characters or colons.

<!-- gh-comment-id:46665388 --> @frank-dittrich commented on GitHub (Jun 20, 2014): dynamic_1015 is similar as well. It treats ``` $dynamic_1015$1d586cc8d137e5f1733f234d224393e8$HEX$f063f05d ``` as valid, even though there's no user name. Internally, that hash gets converted to ``` ?:$dynamic_1015$1d586cc8d137e5f1733f234d224393e8$�c�]$$U? ``` I think this formaat should keep the hex incoding. Otherwise, you get funny results for hex values that translate into line feed characters or colons.
Author
Owner

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

It looks like the real bug may be in listconf.c and it not calling prepare EVERY time.

<!-- gh-comment-id:46666780 --> @jfoug commented on GitHub (Jun 20, 2014): It looks like the real bug may be in listconf.c and it not calling prepare EVERY time.
Author
Owner

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

There were problems in dyna prepare(). I was blindly adding a $$U and $$Fx even when the fields are invalid. I am no longer doing this. Now, if a format has a $$U, and the user name is allowed to be blank, then the ONLY way to get that hash into jtr, is to add an empty $$U to the hash line. dyna's prepare will not do this. I also do not add the '?' user name, as this is a magic user name added within loader, for blank ones.

a7e3205

<!-- gh-comment-id:46668815 --> @jfoug commented on GitHub (Jun 20, 2014): There were problems in dyna prepare(). I was blindly adding a $$U and $$Fx even when the fields are invalid. I am no longer doing this. Now, if a format has a $$U, and the user name is allowed to be blank, then the ONLY way to get that hash into jtr, is to add an empty $$U to the hash line. dyna's prepare will not do this. I also do not add the '?' user name, as this is a magic user name added within loader, for blank ones. a7e3205
Author
Owner

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

I know that listconf.c needs a fix (call prepare if the existing ciphertext isn't valid. (I wouldn't want to always call preparem because then --list=format-test will only produce a subset of hashes that the format considers to be valid.

<!-- gh-comment-id:46669906 --> @frank-dittrich commented on GitHub (Jun 20, 2014): I know that listconf.c needs a fix (call prepare if the existing ciphertext isn't valid. (I wouldn't want to always call preparem because then --list=format-test will only produce a subset of hashes that the format considers to be valid.
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#308
No description provided.