[GH-ISSUE #608] 1501 guesses instead of 1500 for sapB (OMP) and pw.dic reversed. #278

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

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

$ tac ../test/pw.dic > pw.dic

$ ./john ../test/sapb_tst.in --wordlist=pw.dic
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Loaded 1500 password hashes with 14 different salts (sapb, SAP CODVN B (BCODE) [MD5 128/128 AVX 12x])

...

UE__8            (SAP*)
1501g 0:00:00:00 DONE (2014-05-29 18:57) 6822g/s 26431p/s 370045c/s 39647KC/s ERS__17..SKIPPIN^
Use the "--show" option to display all of the cracked passwords reliably
Session completed

$ sort -u john.pot |wc -l
1500

$ sort john.pot |uniq -c|sort -nr|head -n 1
      2 DDIC$EBAC580D348B4008:A1234567

If I use this reversed pw.dic file for jtrts, I get

form=sapB                         guesses: 1501 0:00:00:00 DONE : Expected count(s) (1500)  [!!!FAILED!!!]
.pot CHK:sapB                     guesses: 1500 0:00:00:00 DONE  [PASSED]
Originally created by @frank-dittrich on GitHub (May 29, 2014). Original GitHub issue: https://github.com/openwall/john/issues/608 ``` $ tac ../test/pw.dic > pw.dic $ ./john ../test/sapb_tst.in --wordlist=pw.dic Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status Loaded 1500 password hashes with 14 different salts (sapb, SAP CODVN B (BCODE) [MD5 128/128 AVX 12x]) ... UE__8 (SAP*) 1501g 0:00:00:00 DONE (2014-05-29 18:57) 6822g/s 26431p/s 370045c/s 39647KC/s ERS__17..SKIPPIN^ Use the "--show" option to display all of the cracked passwords reliably Session completed $ sort -u john.pot |wc -l 1500 $ sort john.pot |uniq -c|sort -nr|head -n 1 2 DDIC$EBAC580D348B4008:A1234567 ``` If I use this reversed pw.dic file for jtrts, I get ``` form=sapB guesses: 1501 0:00:00:00 DONE : Expected count(s) (1500) [!!!FAILED!!!] .pot CHK:sapB guesses: 1500 0:00:00:00 DONE [PASSED] ```
bsakaguchi 2026-10-14 02:59:38 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (May 31, 2014):

I see nothing wrong in the format. I think what happens is it tries two instances of "A1234567" (after truncation) within the same batch of keys. This would normally be detected as a dupe crack in line 288 of cracker.c... I have no idea why it isn't.

    if (index >= 0 && index < crk_params.max_keys_per_crypt) {
        dupe = !memcmp(&crk_timestamps[index],
                       &status.crypts, sizeof(int64));
        crk_timestamps[index] = status.crypts;
    } else
        dupe = 0;
<!-- gh-comment-id:44757641 --> @magnumripper commented on GitHub (May 31, 2014): I see nothing wrong in the format. I think what happens is it tries two instances of "A1234567" (after truncation) within the _same batch of keys_. This would normally be detected as a dupe crack in line 288 of cracker.c... I have no idea why it isn't. ``` if (index >= 0 && index < crk_params.max_keys_per_crypt) { dupe = !memcmp(&crk_timestamps[index], &status.crypts, sizeof(int64)); crk_timestamps[index] = status.crypts; } else dupe = 0; ```
Author
Owner

@frank-dittrich commented on GitHub (May 31, 2014):

Must be related to this:

Will run 8 OpenMP threads
<!-- gh-comment-id:44760331 --> @frank-dittrich commented on GitHub (May 31, 2014): Must be related to this: ``` Will run 8 OpenMP threads ```
Author
Owner

@magnumripper commented on GitHub (May 31, 2014):

It might, but it shouldn't.

<!-- gh-comment-id:44760541 --> @magnumripper commented on GitHub (May 31, 2014): It might, but it shouldn't.
Author
Owner

@magnumripper commented on GitHub (May 31, 2014):

The stuff in cracker.c I referred to is run single threaded.

<!-- gh-comment-id:44760577 --> @magnumripper commented on GitHub (May 31, 2014): The stuff in cracker.c I referred to is run single threaded.
Author
Owner

@magnumripper commented on GitHub (Jun 1, 2014):

It does seem to be triggered by the fact the dupe input is within the same batch of keys. Yet that should never result in a dupe crack unless FMT_NOT_EXACT.

http://www.openwall.com/lists/john-dev/2014/06/01/8

After posting the above I think I established that no dupe detection is needed - when it's cracked it is removed from the hash list so the "second" crack should never pass cmp_one(). Yet it does. Problem is also seen in unstable-jumbo, which rules out any of last half year's intrusive patches as reason for this.

<!-- gh-comment-id:44781279 --> @magnumripper commented on GitHub (Jun 1, 2014): It does seem to be triggered by the fact the dupe input is within the same batch of keys. Yet that should never result in a dupe crack unless FMT_NOT_EXACT. http://www.openwall.com/lists/john-dev/2014/06/01/8 After posting the above I think I established that no dupe detection is needed - when it's cracked it is removed from the hash list so the "second" crack _should_ never pass cmp_one(). Yet it does. Problem is also seen in unstable-jumbo, which rules out any of last half year's intrusive patches as reason for this.
Author
Owner

@magnumripper commented on GitHub (Jun 1, 2014):

Here's a clue:

Loaded 1500 password hashes with 14 different salts (sapb, SAP CODVN B (BCODE) [MD5 128/128 AVX 12x])

There should only be five different salts:

$ cut -d: -f1 ../test/sapb_tst.in | sort -u
DDIC
EARLYWATCH
SAP*
SAPCPIC
^^^^^^^^^^^^
<!-- gh-comment-id:44787099 --> @magnumripper commented on GitHub (Jun 1, 2014): Here's a clue: ``` Loaded 1500 password hashes with 14 different salts (sapb, SAP CODVN B (BCODE) [MD5 128/128 AVX 12x]) ``` There should only be five different salts: ``` $ cut -d: -f1 ../test/sapb_tst.in | sort -u DDIC EARLYWATCH SAP* SAPCPIC ^^^^^^^^^^^^ ```
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#278
No description provided.