openwall / openwall/john

FMT_NOT_EXACT --show only shows the last crack for each hash

Open
#697 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug non-trivial
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

$ cat test.in 
first:$crc32$4ff4f23f.ce6eb863
second:$crc32$fa455f6b.c59b2aeb

$ cat ../run/john.pot 
$crc32$fa455f6b.c59b2aeb:123456
$crc32$fa455f6b.c59b2aeb:bogus
$crc32$fa455f6b.c59b2aeb:fake

$ ../run/john --format=crc32 test.in --show=left
first:$crc32$4ff4f23f.ce6eb863
1 password hash cracked, 1 left

The above is true after 188fdc6. We only show the hash(es) that we found NO candidate for.

However, this problem remains (and was not caused by 188fdc6):

$ ../run/john --format=crc32 test.in --show    
second:fake
1 password hash cracked, 1 left

Currently, only the last crack is shown. Ideally, we'd have this output (not sure what number to show for "cracked" though... 1 or 3? It's actually "1 password hash cracked three times, 1 left"):

$ ../run/john --format=crc32 test.in --show    
second:fake
second:bogus
second:123456
1 password hash cracked, 1 left

This is not trivial given for these formats we'll often have dupe lines like this:

$ cat ../run/john.pot 
$crc32$fa455f6b.c59b2aeb:123456
$crc32$fa455f6b.c59b2aeb:bogus
$crc32$fa455f6b.c59b2aeb:fake
$crc32$fa455f6b.c59b2aeb:bogus
$crc32$fa455f6b.c59b2aeb:fake
$crc32$fa455f6b.c59b2aeb:123456

In that case, we do want such dupes to be suppressed but show the three distinct candidates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied crc32 reproduction with john --format=crc32 ... --show and inspect how entries from run/john.pot are processed. Done means showing each distinct candidate for a hash, suppressing duplicate pot entries, and preserving sensible cracked and left counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.