mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1742] Formats which should handle input hash case changes in some manner (fixing or rejecting) #1152
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jfoug on GitHub (Sep 10, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1742
Ok, after adding test type #4 (true generic), ,I get these problems (some need white listed, not all are bugs).
$ ../run/john -test-full=1 | grep -v PASS
Will run 8 OpenMP threads
Device 0: Cedar [ATI Radeon HD 5450]
These are the only ones I see that are left:
(FP) Testing: AFS, Kerberos AFS [DES 24/32 4K]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
Testing: dynamic_40 [sha1($s.pad20($p)) (net-sha1) 32/32]... FAILED (cmp_all(1))
Testing: dynamic_1016 [md5($p.$s) (long salt) 32/32]... FAILED (cmp_all(1))
Testing: dynamic=md5($p) [32/32]... FAILED (split() case, or valid() should fail)
(FP) Testing: krb5-18, Kerberos 5 db etype 18 [PBKDF2-SHA1 32/32 AES]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
(FP) Testing: cq, ClearQuest [CQWeb]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
(FP) Testing: hdaa, HTTP Digest access authentication [MD5 32/32]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
(FP) Testing: Blackberry-ES10 (101x) [SHA-512 32/32 OpenSSL]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
(FP) Testing: LUKS [PBKDF2-SHA1 32/32]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
Testing: MongoDB, system / network [MD5 32/32]... FAILED (should unify cases in split() and set FMT_SPLIT_UNIFIES_CASE (#3))
Testing: mssql, MS SQL [SHA1 32/32]... FAILED (split() case, or valid() should fail)
Testing: mssql05, MS SQL 2005 [SHA1 32/32]... FAILED (split() case, or valid() should fail)
Testing: mssql12, MS SQL 2012/2014 [SHA512 32/32 OpenSSL]... FAILED (split() case, or valid() should fail)
All new 'test-3' that are failures are false-positive.
There is a lot of discussion and code in this PR: https://github.com/magnumripper/JohnTheRipper/pull/1741
(WHITE LISTED) This one STILL needs fixed.
These 3 were somehow missed. I listed them as fixed, but when I pulled the github, they were not fixed. Now they are.
This hash was found after hex salt 'smashing' was added'
Format problems found only with
github.com/loverszhaokai/JohnTheRipper@01abf3ff17and moved from #1752 to here.@jfoug commented on GitHub (Sep 10, 2015):
NOTE, just casing the binary hash may not be enough. If there are other hex encoded areas within the hash, then each of those areas either have to be properly cased.
One other method is to draw a line in the sand, and say case of the hex fields must either be UP or low. Then within valid() we reject hashes with the wrong case.
The best way is to do this with a case changing split. However, if the hashes are 100% specified (such as a specific server, or coming from one of the *2john generators), then using valid() to reject input hashes that are cased improperly should be perfectly acceptable.
@jfoug commented on GitHub (Sep 10, 2015):
Here was nuked clan. and the test showing that it was fixed. Without this fix, this input file with 5 hashes each having 3 different casing layouts, you would run john once and get 5, then run it again and get 5 then run it again, and get 5 hashes, then run it again and all hashes were found.
After the fix, you run it one time it finds 5 hashes and is done.
@jfoug commented on GitHub (Sep 13, 2015):
NOTE, any format that mangles the binary (such as raw hashes which now 'early exit' modify the running binary value), will not be found using my search method. An example of a problem hash that was not found is AFS (as documented in and around http://www.openwall.com/lists/john-dev/2015/09/11/7 ) There may be other raw formats which should fix dupe case problems, but which my code can not find. ALL of the raw hashes should be audited for this bug. It is easy to do. Simply get the raw 'working' hashes using the -list=format-tests Then duplicate all hashes 3 or 4 times in the 'input' file, and make random case changes to these new lines. Then if you crack them with john, and re-run john again against the 'should be' cracked file, and it starts cracking again, THEN the bug is present on that format. If you crack them all, then run again and john says 'all cracked', then things are running correctly.
@jfoug commented on GitHub (Sep 13, 2015):
Actually, it might not be a bad idea to make a issue thread (this one is fine), where we have a checklist of EVERY format. Then when we validate the format is correct, OR we find a problem and fix it, we then check it off. Yes, that is a LOT of things to check off, but it may be the only way to document that we have ALL of them done. ONCE we get them all done, we can make some pretty deep tests to flush out problems, and leave that in the formats.c file self test (-full or normal, either way is fine). Then we can help ensure that as new formats are written, the original developer is 'forced' into writing it correctly from the start, to not have this bug.
@jfoug commented on GitHub (Sep 26, 2015):
8f21e31That adds the -test-full enhancement that found many of these files. NOTE, there are still some files which have hex encoding that do not properly split/case. we need to audit formats and find these.
Most of the raw formats can not be auto found any more, since they have last round reversal logic in them, thus binary() does not return the 'same' value as stored in the hash.
We probably should add code to find all 'pure' hex-like strings of 28, 32, 40, 48, 64, bytes long (etc) (and longer ones of 'known' hex hash size), and mangle those to 'test'. NOTING that some of those may end up needing a white list.
@jfoug commented on GitHub (Sep 28, 2015):
At this time, only dynamic= fails with salt/case bug, and there are 2 'failures' for other reasons in dynamic. But other than that, ALL formats 'are' working properly for -test-full code!
@jfoug commented on GitHub (Sep 28, 2015):
Closing. 100% of the formats that are currently 'listed' have been fixed, with 1 being whitelisted (for now).
@jfoug commented on GitHub (Oct 6, 2015):
Note, test #4 're-found' a problem in CHAP. So each test has been getting better and better, lol.