[GH-ISSUE #2437] Unprintable characters in pot file after cracking a dynamic_25 hash #1619

Closed
opened 2026-10-15 04:21:24 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @kholia on GitHub (Mar 3, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2437

Originally assigned to: @jfoug on GitHub.

$ cat hash
$dynamic_25$6d29001f8a5062d7b6f5b32b30a8cf64da6567e0$HEX$50617373776f7264436865636b48617368463243d92abc14cc

$ cat wordlist
openwall

$ ../run/john hash -wordlist=wordlist
...
openwall         (?)

$ cat ../run/john.pot 
$dynamic_25$6d29001f8a5062d7b6f5b32b30a8cf64da6567e0$PasswordCheckHashF2C<bad bytes here>:openwall

Is this a bug or a feature that I don't know of?

Originally created by @kholia on GitHub (Mar 3, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2437 Originally assigned to: @jfoug on GitHub. ``` $ cat hash $dynamic_25$6d29001f8a5062d7b6f5b32b30a8cf64da6567e0$HEX$50617373776f7264436865636b48617368463243d92abc14cc $ cat wordlist openwall $ ../run/john hash -wordlist=wordlist ... openwall (?) $ cat ../run/john.pot $dynamic_25$6d29001f8a5062d7b6f5b32b30a8cf64da6567e0$PasswordCheckHashF2C<bad bytes here>:openwall ``` Is this a bug or a feature that I don't know of?
bsakaguchi 2026-10-15 04:21:24 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (Mar 3, 2017):

Looks like a bug, sort of. Your input hash has HEX salt that should be HEX in the output too, but isn't. So the bad bytes are probably correct but should be escaped.

$ perl -ne 'print pack("H*", $_)' <<< 50617373776f7264436865636b48617368463243d92abc14cc | hd
00000000  50 61 73 73 77 6f 72 64  43 68 65 63 6b 48 61 73  |PasswordCheckHas|
00000010  68 46 32 43 d9 2a bc 14  cc a0                    |hF2C.*....|
0000001a
<!-- gh-comment-id:283898697 --> @magnumripper commented on GitHub (Mar 3, 2017): Looks like a bug, sort of. Your input hash has $HEX$ salt that should be $HEX$ in the output too, but isn't. So the bad bytes are probably correct but should be escaped. ``` $ perl -ne 'print pack("H*", $_)' <<< 50617373776f7264436865636b48617368463243d92abc14cc | hd 00000000 50 61 73 73 77 6f 72 64 43 68 65 63 6b 48 61 73 |PasswordCheckHas| 00000010 68 46 32 43 d9 2a bc 14 cc a0 |hF2C.*....| 0000001a ```
Author
Owner

@jfoug commented on GitHub (Mar 1, 2019):

I am going to start on this (which also has dependencies to #3124, possibly #3389), so I will try to address all of the canonical problems within dynamic in one shot. Also, I THINK, at the time I do this, I should also modify dynamic HEX to be $HEX[hhhhhhh] as we have discussed in #3645

My post here is to query @magnumripper about moving towards the #3645 at this time. Dynamic would have to handle the 'legacy' HEX in .pot files (and in input files???) for the time being. However, I would 'really' rather create a dynamic .pot (and .input) updater script, so that a user with these older .pot/input files can 'fix' them, to the new format, forever dumping the older crap. That way, the code can be simplified to ONLY read and handle one (well 2) types. Those 2 are normal dynamic, and dynamic hashes with the $HEX$[deadbeef] salts.

<!-- gh-comment-id:468852577 --> @jfoug commented on GitHub (Mar 1, 2019): I am going to start on this (which also has dependencies to #3124, possibly #3389), so I will try to address all of the canonical problems within dynamic in one shot. Also, I THINK, at the time I do this, I should also modify dynamic $HEX$ to be $HEX[hhhhhhh] as we have discussed in #3645 My post here is to query @magnumripper about moving towards the #3645 at this time. Dynamic would have to handle the 'legacy' HEX in .pot files (and in input files???) for the time being. However, I would 'really' rather create a dynamic .pot (and .input) updater script, so that a user with these older .pot/input files can 'fix' them, to the new format, forever dumping the older crap. That way, the code can be simplified to ONLY read and handle one (well 2) types. Those 2 are normal dynamic, and dynamic hashes with the $HEX$[deadbeef] salts.
Author
Owner

@magnumripper commented on GitHub (Mar 4, 2019):

Apparently we didn't end up in a release sprint this time and I have no idea when that could be happening (I am choked with work, and everybody else seem to be too). So I think the most efficient option by far is to bite the bullet and try to complete #3645. If we do that right, all of dynamic's problems should go away.

I'm certain there will be devils in the details though. For example, if we parse things too early we'll end up with arrays of chars containing NULL, that later code will read as EOS (using normal C functions).
And OTOH if we do it too late we'll end up with dupe code in lots of places. So we need to think good, and most likely actually start coding and revert/redo/rethink a few times before actually ending up with something really good.

I would prefer that such iterative work never hits the main branch, only the final Good Stuff[tm] - but I do understand we might find some caveats very late so I wont cry too much about it.

Before all this though, I think I recall we have some loose ends with your previous work: I think we ended up agreeing (somewhere) on dropping the unit tests for a default make, and whatever we said (can't recall right now). Please finish that before starting something else.

<!-- gh-comment-id:469089841 --> @magnumripper commented on GitHub (Mar 4, 2019): Apparently we didn't end up in a release sprint this time and I have no idea when that could be happening (I am choked with work, and everybody else seem to be too). So I think the most efficient option by far is to bite the bullet and try to complete #3645. If we do that right, all of dynamic's problems should go away. I'm certain there will be devils in the details though. For example, if we parse things too early we'll end up with arrays of chars containing NULL, that later code will read as EOS (using normal C functions). And OTOH if we do it too late we'll end up with dupe code in lots of places. So we need to think good, and most likely actually start coding and revert/redo/rethink a few times before actually ending up with something really good. I would prefer that such iterative work never hits the main branch, only the final Good Stuff[tm] - but I do understand we might find some caveats very late so I wont cry too much about it. Before all this though, I think I recall we have some loose ends with your previous work: I think we ended up agreeing (somewhere) on dropping the unit tests for a default `make`, and whatever we said (can't recall right now). Please finish that before starting something else.
Author
Owner

@magnumripper commented on GitHub (Mar 4, 2019):

Oh and for your specific question, I agree: If we can get rid of all old (some known buggy) code in favor of an update script that converts stuff to $HEX[cafe], that will be a clean-up for sure.

<!-- gh-comment-id:469090115 --> @magnumripper commented on GitHub (Mar 4, 2019): Oh and for your specific question, I agree: If we can get rid of all old (some known buggy) code in favor of an update script that converts stuff to `$HEX[cafe]`, that will be a clean-up for sure.
Author
Owner

@magnumripper commented on GitHub (Dec 20, 2021):

Fixed by #4947

<!-- gh-comment-id:997578905 --> @magnumripper commented on GitHub (Dec 20, 2021): Fixed by #4947
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#1619
No description provided.