Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rar -p salt #868

Closed
jfoug opened this issue Dec 4, 2014 · 12 comments
Closed

rar -p salt #868

jfoug opened this issue Dec 4, 2014 · 12 comments

Comments

@jfoug
Copy link
Collaborator

jfoug commented Dec 4, 2014

This may be a non issue in real world, but this IS what is for real.

The data type for rar-p must be part of the salt. I saw issues when working on pass_gen. In that case, I was using fixed salts (so that I could get the same hash to know my code was working), and put in different passwords. Well in this case, JtR would find only 1 password, but would crack ALL hashes with this password. What was happening is that the salt was all identical, SINCE the packed encrypted buffer was not being checked for salt. We might be able to fix this in dyna_salt, OR we can simply add a fixed sized buffer to the salt record for rar, do an MD5 on the packed, enc buffer at load time, and store that.

Now, in real world this likely will not make ANY impact. Here is what has to be for this bug to show up.

  1. same salt (8 byte value)
  2. same size packed buffer
  3. same size unpacked buffer
  4. same crc value.

Now where this 'could' happen, is if there are multiple rar files, all encrypted differently, all with same file inside (say a short disclaimer, or some canned file). However, they would all have to have the same 8 byte salt value. I think under 'normal' situation this would be the case. In pass_gen.pl I have taken away the ability to pass in a salt on command line, since there is NO WAY to have many hashes with same salt, since the data itself is encrypted.

At this time, I am making no move to correct this. But I wanted it listed here, since I have seen this behavior, and want to make sure that somewhere else, this type problem is not biting us.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

Note, this bug SHOWS UP in the older jtrts input file (rar). I am making a new one. The old one was built with VERY few salt values (I am not 100% sure how that file was created). If run, this is the ouput (note most of the passwords ARE NOT right)

$ ../run/john rar_tst.in -w=pw30.dic -pot=tst.pot
Warning: detected hash type "rar", but the string is also recognized as "rar-opencl"
Use the "--format=rar-opencl" option to force loading these as that type instead
Loaded 130 password hashes with 19 different salts (rar, RAR3 [SHA1 AES 32/64])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
ttttttttttt      (test.rar)
ttttttttttt      (test.rar)
1                (test.rar)
1                (test.rar)
alsfdkja;        (test.rar)
dffffffffffff    (test.rar)
130g 0:00:00:05 DONE (2014-12-04 10:59) 24.08g/s 5.557p/s 105.5c/s 722.4C/s Skippin▒ an▒*..q▒▒rt12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed

If I re-run (with the already created .pot file there, I get this:

$ ../run/john rar_tst.in -w=pw30.dic -pot=tst.pot
Warning: detected hash type "rar", but the string is also recognized as "rar-opencl"
Use the "--format=rar-opencl" option to force loading these as that type instead
Loaded 130 password hashes with 19 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 111 password hashes with 17 different salts
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
password         (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
111g 0:00:00:04 DONE (2014-12-04 11:02) 23.25g/s 6.285p/s 106.8c/s 697.6C/s Skippin▒ an▒*..q▒▒rt12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed

This is the wc of the pot file after the 2nd run

$ wc tst.pot
  36   36 9701 tst.pot

I am going to see about adding a hash, it should not be hard at all.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

After adding a simple hash (half an MD5 of the buffer), I reran (3rd run), and this time, it worked like expected (much slower, and it finds 'proper' passwords).

$ ../run/john rar_tst.in -w=pw30.dic -pot=tst.pot
Warning: detected hash type "rar", but the string is also recognized as "rar-opencl"
Use the "--format=rar-opencl" option to force loading these as that type instead
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 94 password hashes with 92 different salts
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
hello            (test.rar)
password         (test.rar)
Bert$ErnIE       (test.rar)
ttttttttttt      (test.rar)
late*night       (test.rar)
password         (test.rar)
password         (test.rar)
bert*ernie       (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
bert*ernie       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
bert*ernie       (test.rar)
late*night       (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
test             (test.rar)
1                (test.rar)
password         (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
test             (test.rar)
hello            (test.rar)
password         (test.rar)
ttttttttttt      (test.rar)
hello            (test.rar)
late*night       (test.rar)
hello            (test.rar)
1                (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
hello            (test.rar)
test             (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
1                (test.rar)
password         (test.rar)
hello            (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
ttttttttttt      (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
hello            (test.rar)
hello            (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
bert*ernie       (test.rar)
Bert$ErnIE       (test.rar)
late*night       (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
hello            (test.rar)
test             (test.rar)
1                (test.rar)
late*night       (test.rar)
ttttttttttt      (test.rar)
password         (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
test             (test.rar)
Bert$ErnIE       (test.rar)
password         (test.rar)
test             (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
late*night       (test.rar)
late*night       (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
ttttttttttt      (test.rar)
bert*ernie       (test.rar)
hello            (test.rar)
bert*ernie       (test.rar)
password         (test.rar)
hello            (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
password         (test.rar)
password         (test.rar)
hello            (test.rar)
bert*ernie       (test.rar)
94g 0:00:00:26 DONE (2014-12-04 11:17) 3.604g/s 1.150p/s 105.8c/s 108.1C/s Skippin▒ an▒*..q▒▒rt12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed

The change is trivial. I think I will make it. There is a tiny loadtime hit (whatever time it takes to md5 the input data), and a small increase in memory usage, BUT this is rar, whcih already has a HUGE memory footprint, so this is not even visible.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

$ ./jtrts.pl rar
-------------------------------------------------------------------------------
- JtR-TestSuite (jtrts). Version 1.12.18, Oct 31, 2014.  By, Jim Fougeron & others
- Testing:  John the Ripper password cracker, version 1.8.0.2-bleeding-jumbo_omp [cygwin 64-bit AVX-autoconf]
--------------------------------------------------------------------------------

John Jumbo build detected.

form=rar                          guesses:  130 0:00:00:34 DONE  [PASSED]
.pot CHK:rar                      guesses:  130 0:00:00:07 DONE  [PASSED]

form=rar                          guesses:  297 0:00:01:34 DONE  [PASSED]
.pot CHK:rar                      guesses:  297 0:00:00:43 DONE  [PASSED]

All tests passed without error.  Performed 2 tests.  Time used was 190 seconds

Before the change, the 130 password check was running at 5s / 2s. BUT it was not finding more than a handful of 'real' cracked passwords. It reported that it found 130, so TS was 'happy'.

NOTE, this may point to a bug in JtR, where multiple hashes in the same salt bucket may not be getting removed when a password is found. Some of the salt logic still baffles me, so I am not fully sure what needs to be looked at.

So, what I have changed (in the format), is that even though we have stopped using the data buffer in the hash (since it is variable size, we now DO have a hash of that data buffer that IS part of the salt.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

08e2a5c is the patch. This is pretty trivial, but makes a big difference on some of this contrived data, and causes no impact on speed or anything else.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

There still are 'some' issues. It is MUCH better, but possibly not 100% better;

$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
alsfdkja;        (test.rar)
password         (test.rar)
test             (test.rar)
hello            (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
test             (test.rar)
bert*ernie       (test.rar)
password         (test.rar)
password         (test.rar)
Bert$ErnIE       (test.rar)
dffffffffffff    (test.rar)
password         (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
dffffffffffff    (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
dffffffffffff    (test.rar)
Bert$ErnIE       (test.rar)
dffffffffffff    (test.rar)
hello            (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
1                (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
hello            (test.rar)
password         (test.rar)
alsfdkja;        (test.rar)
dffffffffffff    (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
late*night       (test.rar)
Bert$ErnIE       (test.rar)
password         (test.rar)
test             (test.rar)
late*night       (test.rar)
alsfdkja;        (test.rar)
dffffffffffff    (test.rar)
dffffffffffff    (test.rar)
hello            (test.rar)
Bert$ErnIE       (test.rar)
test             (test.rar)
1                (test.rar)
hello            (test.rar)
alsfdkja;        (test.rar)
late*night       (test.rar)
password         (test.rar)
1                (test.rar)
bert*ernie       (test.rar)
hello            (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
hello            (test.rar)
hello            (test.rar)
dffffffffffff    (test.rar)
test             (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
Bert$ErnIE       (test.rar)
hello            (test.rar)
ttttttttttt      (test.rar)
hello            (test.rar)
bert*ernie       (test.rar)
test             (test.rar)
late*night       (test.rar)
ttttttttttt      (test.rar)
dffffffffffff    (test.rar)
Bert$ErnIE       (test.rar)
ttttttttttt      (test.rar)
password         (test.rar)
bert*ernie       (test.rar)
test             (test.rar)
Bert$ErnIE       (test.rar)
late*night       (test.rar)
bert*ernie       (test.rar)
password         (test.rar)
hello            (test.rar)
password         (test.rar)
test             (test.rar)
ttttttttttt      (test.rar)
late*night       (test.rar)
late*night       (test.rar)
late*night       (test.rar)
alsfdkja;        (test.rar)
password         (test.rar)
late*night       (test.rar)
dffffffffffff    (test.rar)
bert*ernie       (test.rar)
dffffffffffff    (test.rar)
late*night       (test.rar)
alsfdkja;        (test.rar)
test             (test.rar)
1                (test.rar)
alsfdkja;        (test.rar)
alsfdkja;        (test.rar)
alsfdkja;        (test.rar)
alsfdkja;        (test.rar)
bert*ernie       (test.rar)
1                (test.rar)
bert*ernie       (test.rar)
Bert$ErnIE       (test.rar)
bert*ernie       (test.rar)
ttttttttttt      (test.rar)
late*night       (test.rar)
alsfdkja;        (test.rar)
dffffffffffff    (test.rar)
hello            (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
dffffffffffff    (test.rar)
password         (test.rar)
alsfdkja;        (test.rar)
Bert$ErnIE       (test.rar)
130g 0:00:00:34 DONE (2014-12-04 12:08) 3.726g/s 0.9172p/s 113.7c/s 119.2C/s Skippin▒ an▒*..qwert12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed

immediate re-run

$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 6 password hashes with 3 different salts
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
1                (test.rar)
ttttttttttt      (test.rar)
6g 0:00:00:00 DONE (2014-12-04 12:10) 7.125g/s 38.00p/s 114.0c/s 228.0C/s Skippin▒ an▒*..qwert12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed


$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 3 password hashes with no different salts
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
3g 0:00:00:00 DONE (2014-12-04 12:10) 10.13g/s 108.1p/s 108.1c/s 324.3C/s Skippin▒ an▒*..qwert12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed


$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 2 password hashes with no different salts
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
Bert$ErnIE       (test.rar)
2g 0:00:00:00 DONE (2014-12-04 12:10) 8.032g/s 128.5p/s 128.5c/s 257.0C/s Skippin▒ an▒*..qwert12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed


$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
Remaining 1 password hash
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Bert$ErnIE       (test.rar)
1g 0:00:00:00 DONE (2014-12-04 12:11) 3.558g/s 113.8p/s 113.8c/s 113.8C/s Skippin▒ an▒*..qwert12345
Use the "--show" option to display all of the cracked passwords reliably
Session completed


$ ../run/john -w=pw30.dic rar_tst.in -pot=tst.pot
Loaded 130 password hashes with 124 different salts (rar, RAR3 [SHA1 AES 32/64])
No password hashes left to crack (see FAQ)

I have to dig in and find out what is up here. It may be that there are dupe hashes in the file, BUT those should get removed at load time.

Looks like these 6 were -hp format (the shorter one). Now I need to figure that one out. I am pretty sure the -p have been 'fixed' with the dummy hash being added. I am not sure why the -hp is having a problem. We do not put any of the -hp data into the memory buffer, do we??

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

Found. Same type issue in the -hp mode. Fixed by doing the hash at proper point (and setting packed size for -hp even though there is nothing 'packed').

ce40a26 Is the final fix. This should hash the encrypted data, so that the buffer data can also play part in the salt dupe detection logic.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

NOTE, pass_gen was not detecting this problem, and I am not sure that it can. I will see.

Possibly we can run john again, with -w=empty_file after the current 2 runs, and make sure that john lists No password hashes left to crack (see FAQ)

@magnumripper has this string changed over the versions, or is it different in non-jumbo john ?

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

Same issue on opencl: 07964d6

@magnumripper
Copy link
Member

Note, this bug SHOWS UP in the older jtrts input file (rar). I am making a new one. The old one was built with VERY few salt values (I am not 100% sure how that file was created)

The old one was built using a proper rar binary with a script. I strongly suspect the salt is from a clock with a one second resolution or something very similar to that.

@magnumripper has this string changed over the versions, or is it different in non-jumbo john ?

It's the same in core and it hasn't changed at all for many years (1.7.8 had it).

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

so rar is likely very possible to generate same salt. The 'fix' is not only a theoretical fix then.

I have opened a issue about this on TS. I am disturbed that TS did not catch this.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

I have run a test (edited jtrts.pl), and only a few hashes have any problems. The code change is if crack_count and show_count do not match, then I print something out. Here is where we are at:

 form=dynamic_0                    !!! guesses: 1500 --show: 1502 !!!
 form=dynamic_71                   !!! guesses: 1500 --show: 1502 !!!
 form=crc32_dups                   !!! guesses: 1500 --show:   50 !!!
 form=crc32_dups2                  !!! guesses: 1500 --show:   50 !!!
 form=crc32_dups_read_file         !!! guesses: 1500 --show:   50 !!!
 form=crc32_dups2_read_file        !!! guesses: 1500 --show:   50 !!!
 form=lm                           !!! guesses: 1500 --show: 3000 !!!
 form=pwdump_lm                    !!! guesses:  986 --show: 2760 !!!
 form=rar                          !!! guesses:  130 --show:   19 !!!

The dyna_0, dyna_71 both have dupe hashes, so 1502 is expected. crc is a non-exact format. lm is a split format.

The rar check was prior to the recent update. So it looks like rar is the only one where we have this distinct salt being viewed as duplicate bug problem (at least of the formats in the TS). rar probably had this issue prior to going to dyna-salt, since I think the prior ONLY looked at the 8 byte salt, or am I not correct here?

NOTE, it is possible there are other large item hashes that have this type issue.

@jfoug
Copy link
Collaborator Author

jfoug commented Dec 4, 2014

I have updated jtrts. openwall/john-tests@3f31fe7

Now, rar is fixed, and jtrts would detect the problem. Moving on.

@jfoug jfoug closed this as completed Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants