[GH-ISSUE #845] Mask mode: -node/fork distribution is broken when using -min-len and (seemingly) poor otherwise #455

Closed
opened 2026-10-14 03:08:41 +07:00 by bsakaguchi · 28 comments
Owner

Originally created by @magnumripper on GitHub (Nov 7, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/845

Originally assigned to: @sayan1an on GitHub.

Using Test Suite input file:

$ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 
Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
900g 0:00:00:02 DONE (2014-11-07 02:19) 445.5g/s 29933Kp/s 29933Kc/s 41858MC/s A6299..99999
Session completed

$ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -fork=8
Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16])
Node numbers 1-8 of 8 (fork)
Press 'q' or Ctrl-C to abort, almost any other key for status
1 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 16081Kp/s 16081Kc/s 11337MC/s AE9RE..999RE
Waiting for 7 children to terminate
6 90g 0:00:00:00 DONE (2014-11-07 02:19) 187.5g/s 15746Kp/s 15746Kc/s 11318MC/s AE990..99990
4 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15746Kp/s 15746Kc/s 11337MC/s AE99R..9999R
2 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15116Kp/s 15116Kc/s 11337MC/s AE99I..9999I
5 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15425Kp/s 15425Kc/s 11337MC/s AE9RW..999RW
3 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15425Kp/s 15425Kc/s 11337MC/s AE9RN..999RN
7 360g 0:00:00:00 DONE (2014-11-07 02:19) 734.6g/s 15425Kp/s 15425Kc/s 10050MC/s AE9R5..999R5
8 450g 0:00:00:00 DONE (2014-11-07 02:19) 918.3g/s 15425Kp/s 15425Kc/s 9729MC/s AE999..99999
Session completed

$ bc <<< 90+450+360
900

$ sort -u ../run/john.pot | wc -l
     900

In the above, -fork=8 does crack all hashes and no dupe cracks, but the distribution seems to be suboptimal. Why is it that 5 processes did not crack a single one, and one process cracked half of them?

Using -min-len, we have some worse problem:

$ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0
Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
1000g 0:00:00:02 DONE (2014-11-07 02:22) 478.4g/s 29757Kp/s 29757Kc/s 40113MC/s 16999..99999
Session completed

$ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0 -fork=8
Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16])
Node numbers 1-8 of 8 (fork)
Press 'q' or Ctrl-C to abort, almost any other key for status
1 100g 0:00:00:00 DONE (2014-11-07 02:22) 204.0g/s 15425Kp/s 15425Kc/s 10718MC/s 9C8QD..988QD
Waiting for 7 children to terminate
3 100g 0:00:00:00 DONE (2014-11-07 02:22) 204.0g/s 15425Kp/s 15425Kc/s 10718MC/s 9C8QM..988QM
5 100g 0:00:00:00 DONE (2014-11-07 02:22) 200.0g/s 15116Kp/s 15116Kc/s 10718MC/s 9C8QV..988QV
4 100g 0:00:00:00 DONE (2014-11-07 02:22) 200.0g/s 15116Kp/s 15116Kc/s 10642MC/s 9C88Q..9888Q
8 450g 0:00:00:00 DONE (2014-11-07 02:22) 900.0g/s 15116Kp/s 15116Kc/s 9675MC/s 9C888..98888
7 370g 0:00:00:00 DONE (2014-11-07 02:22) 740.0g/s 15116Kp/s 15116Kc/s 9993MC/s 9C8Q4..988Q4
2 100g 0:00:00:00 DONE (2014-11-07 02:22) 196.0g/s 14820Kp/s 14820Kc/s 10642MC/s 9C88H..9888H
6 100g 0:00:00:00 DONE (2014-11-07 02:22) 196.0g/s 14820Kp/s 14820Kc/s 10642MC/s 9C88Z..9888Z
Session completed

$ bc <<< 100+100+100+100+450+370+100+100
1420

$ sort -u ../run/john.pot | wc -l
     720

Here, using -fork made us miss 280 cracks, but dupe-crack almost all of the others.

Originally created by @magnumripper on GitHub (Nov 7, 2014). Original GitHub issue: https://github.com/openwall/john/issues/845 Originally assigned to: @sayan1an on GitHub. Using Test Suite input file: ``` $ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16]) Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 900g 0:00:00:02 DONE (2014-11-07 02:19) 445.5g/s 29933Kp/s 29933Kc/s 41858MC/s A6299..99999 Session completed $ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -fork=8 Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16]) Node numbers 1-8 of 8 (fork) Press 'q' or Ctrl-C to abort, almost any other key for status 1 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 16081Kp/s 16081Kc/s 11337MC/s AE9RE..999RE Waiting for 7 children to terminate 6 90g 0:00:00:00 DONE (2014-11-07 02:19) 187.5g/s 15746Kp/s 15746Kc/s 11318MC/s AE990..99990 4 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15746Kp/s 15746Kc/s 11337MC/s AE99R..9999R 2 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15116Kp/s 15116Kc/s 11337MC/s AE99I..9999I 5 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15425Kp/s 15425Kc/s 11337MC/s AE9RW..999RW 3 0g 0:00:00:00 DONE (2014-11-07 02:19) 0g/s 15425Kp/s 15425Kc/s 11337MC/s AE9RN..999RN 7 360g 0:00:00:00 DONE (2014-11-07 02:19) 734.6g/s 15425Kp/s 15425Kc/s 10050MC/s AE9R5..999R5 8 450g 0:00:00:00 DONE (2014-11-07 02:19) 918.3g/s 15425Kp/s 15425Kc/s 9729MC/s AE999..99999 Session completed $ bc <<< 90+450+360 900 $ sort -u ../run/john.pot | wc -l 900 ``` In the above, -fork=8 does crack all hashes and no dupe cracks, but the distribution seems to be suboptimal. Why is it that 5 processes did not crack a single one, and one process cracked half of them? Using -min-len, we have some worse problem: ``` $ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0 Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16]) Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 1000g 0:00:00:02 DONE (2014-11-07 02:22) 478.4g/s 29757Kp/s 29757Kc/s 40113MC/s 16999..99999 Session completed $ rm -f ../run/john.pot && ../run/john ../test/LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0 -fork=8 Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16]) Node numbers 1-8 of 8 (fork) Press 'q' or Ctrl-C to abort, almost any other key for status 1 100g 0:00:00:00 DONE (2014-11-07 02:22) 204.0g/s 15425Kp/s 15425Kc/s 10718MC/s 9C8QD..988QD Waiting for 7 children to terminate 3 100g 0:00:00:00 DONE (2014-11-07 02:22) 204.0g/s 15425Kp/s 15425Kc/s 10718MC/s 9C8QM..988QM 5 100g 0:00:00:00 DONE (2014-11-07 02:22) 200.0g/s 15116Kp/s 15116Kc/s 10718MC/s 9C8QV..988QV 4 100g 0:00:00:00 DONE (2014-11-07 02:22) 200.0g/s 15116Kp/s 15116Kc/s 10642MC/s 9C88Q..9888Q 8 450g 0:00:00:00 DONE (2014-11-07 02:22) 900.0g/s 15116Kp/s 15116Kc/s 9675MC/s 9C888..98888 7 370g 0:00:00:00 DONE (2014-11-07 02:22) 740.0g/s 15116Kp/s 15116Kc/s 9993MC/s 9C8Q4..988Q4 2 100g 0:00:00:00 DONE (2014-11-07 02:22) 196.0g/s 14820Kp/s 14820Kc/s 10642MC/s 9C88H..9888H 6 100g 0:00:00:00 DONE (2014-11-07 02:22) 196.0g/s 14820Kp/s 14820Kc/s 10642MC/s 9C88Z..9888Z Session completed $ bc <<< 100+100+100+100+450+370+100+100 1420 $ sort -u ../run/john.pot | wc -l 720 ``` Here, using -fork made us miss 280 cracks, but dupe-crack almost all of the others.
bsakaguchi 2026-10-14 03:08:41 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

BTW I verified with -inc:uppernum, that the above figures when not using -fork are correct.

<!-- gh-comment-id:62082759 --> @magnumripper commented on GitHub (Nov 7, 2014): BTW I verified with `-inc:uppernum`, that the above figures when _not_ using -fork are correct.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Note that the first issue (not using -min-len) may be a result of the Test Suite file not being very random. And anyway it's not a big deal if you exhaust a keyspace using mask mode.

The -min-len issue is much worse. I'm not sure why it happens. Maybe we need to re-run divide_work() when switching length?

<!-- gh-comment-id:62083079 --> @magnumripper commented on GitHub (Nov 7, 2014): Note that the first issue (not using -min-len) **may** be a result of the Test Suite file not being very random. And anyway it's not a big deal if you exhaust a keyspace using mask mode. The -min-len issue is much worse. I'm not sure why it happens. Maybe we need to re-run `divide_work()` when switching length?
Author
Owner

@sayan1an commented on GitHub (Nov 7, 2014):

On Fri, Nov 7, 2014 at 7:08 AM, magnum notifications@github.com wrote:

Note that the first issue (not using -min-len) may be a result of the
Test Suite file not being very random. And anyway it's not a big deal if
you exhaust a keyspace using mask mode.

The -min-len issue is much worse. I'm not sure why it happens. Maybe we
need to re-run divide_work() when switching length?

—
Reply to this email directly or view it on GitHub
https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62083079
.

Before we find a solution to this problem, I was wondering what should be
the behavior of hybrid mask with min-len parameter ?
Right now the output is weird when using wordlist+mask. Perhaps we should
disable it altogether inside the mask when a hybrid mode is used.

<!-- gh-comment-id:62086651 --> @sayan1an commented on GitHub (Nov 7, 2014): On Fri, Nov 7, 2014 at 7:08 AM, magnum notifications@github.com wrote: > Note that the first issue (not using -min-len) _may_ be a result of the > Test Suite file not being very random. And anyway it's not a big deal if > you exhaust a keyspace using mask mode. > > The -min-len issue is much worse. I'm not sure why it happens. Maybe we > need to re-run divide_work() when switching length? > > — > Reply to this email directly or view it on GitHub > https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62083079 > . Before we find a solution to this problem, I was wondering what should be the behavior of hybrid mask with min-len parameter ? Right now the output is weird when using wordlist+mask. Perhaps we should disable it altogether inside the mask when a hybrid mode is used.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

We could consider -min-len=0 a special case for hybrid mode: "Use parent word as-is". This is very useful.

<!-- gh-comment-id:62086977 --> @magnumripper commented on GitHub (Nov 7, 2014): We could consider -min-len=0 a special case for hybrid mode: "Use parent word as-is". This is very useful.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

We could consider -min-len=0 a special case for hybrid mode: "Use parent word as-is". This is very useful.

For this to work, mask mode needs to reset options.force_min_length to -1 after reading it, so the parent mode ignores the min length completely. We may need to give that some thought first.

<!-- gh-comment-id:62087136 --> @magnumripper commented on GitHub (Nov 7, 2014): > We could consider -min-len=0 a special case for hybrid mode: "Use parent word as-is". This is very useful. For this to work, mask mode needs to reset options.force_min_length to -1 after reading it, so the parent mode ignores the min length completely. We may need to give that some thought first.
Author
Owner

@sayan1an commented on GitHub (Nov 7, 2014):

On Fri, Nov 7, 2014 at 7:58 AM, magnum notifications@github.com wrote:

We could consider -min-len=0 a special case for hybrid mode: "Use parent
word as-is". This is very useful.

For this to work, mask mode needs to reset options.force_min_length to -1
after reading it, so the parent mode ignores the min length completely. We
may need to give that some thought first.

—
Reply to this email directly or view it on GitHub
https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62087136
.

We do have several cases to consider for hybrid-mask.

  1. min-len is zero.
  2. mask_add_len is greater than min-length.
  3. mask_add_len is lesser than min-length.

I was wondering wouldn't it be much simpler if we just restart john when we
detect a hybrid mask or pure mask with min-len param as:

for (i=min_len; i < max-len; i++)
./john -max-len=i -other-params

That is only vary the max_length parameter of john with each restart. For
this to work, we will also remove the min_len/max_len iteration from mask
mode.

I'm not sure if it is at all possible or if possible wouldn't cause any
side effects, but it seems to kill many birds with one stone. Perhaps we
will also improve upon the performance, since it will allow us to make
do_mask_crack() much simpler.

<!-- gh-comment-id:62090211 --> @sayan1an commented on GitHub (Nov 7, 2014): On Fri, Nov 7, 2014 at 7:58 AM, magnum notifications@github.com wrote: > We could consider -min-len=0 a special case for hybrid mode: "Use parent > word as-is". This is very useful. > > For this to work, mask mode needs to reset options.force_min_length to -1 > after reading it, so the parent mode ignores the min length completely. We > may need to give that some thought first. > > — > Reply to this email directly or view it on GitHub > https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62087136 > . > > We do have several cases to consider for hybrid-mask. > 1. min-len is zero. > 2. mask_add_len is greater than min-length. > 3. mask_add_len is lesser than min-length. I was wondering wouldn't it be much simpler if we just restart john when we detect a hybrid mask or pure mask with min-len param as: for (i=min_len; i < max-len; i++) ./john -max-len=i -other-params That is only vary the max_length parameter of john with each restart. For this to work, we will also remove the min_len/max_len iteration from mask mode. I'm not sure if it is at all possible or if possible wouldn't cause any side effects, but it seems to kill many birds with one stone. Perhaps we will also improve upon the performance, since it will allow us to make do_mask_crack() much simpler.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

If you mean something like execv(), this is very very complex for JtR. I have been there before.

Maybe we should treat -min-len completely different in hybrid mode: We could say that -min-len and -max-len both only affect mask length in hybrid mode. Something like this:

$ ../run/john -w:dict -stdout -mask=?w?d?d -min-len=0 -max-len=2
password
password0
password1
password2
password3
password4
password5
password6
password7
password8
password9
password00
password10
password20
(...)

This might be confusing. Or not? Anyway I think this is the most useful thing we can opt to do, and should be easy to implement.

<!-- gh-comment-id:62090534 --> @magnumripper commented on GitHub (Nov 7, 2014): If you mean something like execv(), this is very very complex for JtR. I have been there before. Maybe we should treat -min-len completely different in hybrid mode: We could say that -min-len and -max-len both only affect **mask** length in hybrid mode. Something like this: ``` $ ../run/john -w:dict -stdout -mask=?w?d?d -min-len=0 -max-len=2 password password0 password1 password2 password3 password4 password5 password6 password7 password8 password9 password00 password10 password20 (...) ``` This might be confusing. Or not? Anyway I think this is the most useful thing we can opt to do, and should be easy to implement.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

We could say that -min-len and -max-len both only affect mask length in hybrid mode

Although we must never ever produce a word longer than fmt_maxlen...

<!-- gh-comment-id:62090596 --> @magnumripper commented on GitHub (Nov 7, 2014): > We could say that -min-len and -max-len both only affect mask length in hybrid mode Although we must never ever produce a word longer than fmt_maxlen...
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

$ ../run/john -w:dict -stdout=9 -mask=?w?d?d -min-len=0

I edited that

<!-- gh-comment-id:62090675 --> @magnumripper commented on GitHub (Nov 7, 2014): > $ ../run/john -w:dict -stdout=9 -mask=?w?d?d -min-len=0 I edited that
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

If you mean something like execv(), this is very very complex for JtR

Also, restarting John with a million hashes and a 450 MB john.pot takes forever and ever. This is simply not an alternative.

<!-- gh-comment-id:62090874 --> @magnumripper commented on GitHub (Nov 7, 2014): > If you mean something like execv(), this is very very complex for JtR Also, restarting John with a million hashes and a 450 MB john.pot takes forever and ever. This is simply not an alternative.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

I could live with simply not allowing -min-len for hybrid mode though. At least for now. That is an alternative if we don't go with the "-min and -max len only affect mask len" idea.

<!-- gh-comment-id:62090945 --> @magnumripper commented on GitHub (Nov 7, 2014): I could live with simply not allowing -min-len for hybrid mode though. At least for now. That is an alternative if we don't go with the "-min and -max len only affect mask len" idea.
Author
Owner

@sayan1an commented on GitHub (Nov 7, 2014):

On Fri, Nov 7, 2014 at 8:56 AM, magnum notifications@github.com wrote:

I could live with simply not allowing -min-len for hybrid mode though. At
least for now. That is an alternative if we don't go with the "-min and
-max len only affects mask len" idea.

—
Reply to this email directly or view it on GitHub
https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62090945
.

Since we cannot go down the execv() path, we must truncate inside
do_mask_crack(), forcing us to do some more work in there to fix the fork
problem. Anyway, if the performance is not much of an issue in hybrid-mode,
I have no problem with "-min and -max len only affects mask len" idea.
Perhaps we could also implement more complex stuffs later.

<!-- gh-comment-id:62092771 --> @sayan1an commented on GitHub (Nov 7, 2014): On Fri, Nov 7, 2014 at 8:56 AM, magnum notifications@github.com wrote: > I could live with simply not allowing -min-len for hybrid mode though. At > least for now. That is an alternative if we don't go with the "-min and > -max len only affects mask len" idea. > > — > Reply to this email directly or view it on GitHub > https://github.com/magnumripper/JohnTheRipper/issues/845#issuecomment-62090945 > . Since we cannot go down the execv() path, we must truncate inside do_mask_crack(), forcing us to do some more work in there to fix the fork problem. Anyway, if the performance is not much of an issue in hybrid-mode, I have no problem with "-min and -max len only affects mask len" idea. Perhaps we could also implement more complex stuffs later.
Author
Owner

@sayan1an commented on GitHub (Nov 7, 2014):

./john LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0
-fork=8
Loaded 1500 password hashes with no different salts (LM [DES 128/128
AVX-16])
Warning: OpenMP was disabled due to --fork; a non-OpenMP build may be faster
Node numbers 1-8 of 8 (fork)
Press 'q' or Ctrl-C to abort, almost any other key for status
6 100g 0:00:00:00 DONE (2014-11-07 13:27) 232.5g/s 18079Kp/s 18079Kc/s
11566MC/s V9990..99990
8 499g 0:00:00:00 DONE (2014-11-07 13:27) 998.0g/s 15548Kp/s 15548Kc/s
9677MC/s R9999..99999
1 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 15243Kp/s 15243Kc/s 11661MC/s
V99RE..999RE
Waiting for 7 children to terminate
4 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14396Kp/s 14396Kc/s 11661MC/s
V999R..9999R
5 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14668Kp/s 14668Kc/s 11661MC/s
V99RW..999RW
3 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14134Kp/s 14134Kc/s 11661MC/s
V99RN..999RN
7 401g 0:00:00:00 DONE (2014-11-07 13:27) 729.0g/s 14134Kp/s 14134Kc/s
10060MC/s V99R5..999R5
2 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 13638Kp/s 13638Kc/s 11661MC/s
V999I..9999I
Session completed

Fixed but please recheck. Commit 2fdf71181f

<!-- gh-comment-id:62110629 --> @sayan1an commented on GitHub (Nov 7, 2014): ./john LM_tst.in -form:lm -1=?u?d -mask=?1?1?1?1?1 -verb=1 -min-len=0 -fork=8 Loaded 1500 password hashes with no different salts (LM [DES 128/128 AVX-16]) Warning: OpenMP was disabled due to --fork; a non-OpenMP build may be faster Node numbers 1-8 of 8 (fork) Press 'q' or Ctrl-C to abort, almost any other key for status 6 100g 0:00:00:00 DONE (2014-11-07 13:27) 232.5g/s 18079Kp/s 18079Kc/s 11566MC/s V9990..99990 8 499g 0:00:00:00 DONE (2014-11-07 13:27) 998.0g/s 15548Kp/s 15548Kc/s 9677MC/s R9999..99999 1 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 15243Kp/s 15243Kc/s 11661MC/s V99RE..999RE Waiting for 7 children to terminate 4 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14396Kp/s 14396Kc/s 11661MC/s V999R..9999R 5 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14668Kp/s 14668Kc/s 11661MC/s V99RW..999RW 3 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 14134Kp/s 14134Kc/s 11661MC/s V99RN..999RN 7 401g 0:00:00:00 DONE (2014-11-07 13:27) 729.0g/s 14134Kp/s 14134Kc/s 10060MC/s V99R5..999R5 2 0g 0:00:00:00 DONE (2014-11-07 13:27) 0g/s 13638Kp/s 13638Kc/s 11661MC/s V999I..9999I Session completed Fixed but please recheck. Commit 2fdf71181f88c02e3a115b1
Author
Owner

@sayan1an commented on GitHub (Nov 7, 2014):

Also test session/restore with fork and min-length parameter.

<!-- gh-comment-id:62115487 --> @sayan1an commented on GitHub (Nov 7, 2014): Also test session/restore with fork and min-length parameter.
Author
Owner

@frank-dittrich commented on GitHub (Nov 7, 2014):

On 11/07/2014 04:19 AM, magnum wrote:

If you mean something like execv(), this is very very complex for JtR. I have been there before.

Maybe we should treat -min-len completely different in hybrid mode: We could say that -min-len and -max-len both only affect mask length in hybrid mode. Something like this:

$ ../run/john -w:dict -stdout=9 -mask=?w?d?d -min-len=0
password
password0
password1
password2
password3
password4
password5
password6
password7
password8
password9
password00
password10
password20
(...)

This might be confusing. Or not? Anyway I think this is the most useful thing we can opt to do, and should be easy to implement.

Yes, I think it is confusing. May be we should discuss on john-users
what the best solution is.
I wouldn't want to have a confusing behavior just because it is "easy to
implement".

<!-- gh-comment-id:62182137 --> @frank-dittrich commented on GitHub (Nov 7, 2014): On 11/07/2014 04:19 AM, magnum wrote: > If you mean something like execv(), this is very very complex for JtR. I have been there before. > > Maybe we should treat -min-len completely different in hybrid mode: We could say that -min-len and -max-len both only affect **mask** length in hybrid mode. Something like this: > > ``` > $ ../run/john -w:dict -stdout=9 -mask=?w?d?d -min-len=0 > password > password0 > password1 > password2 > password3 > password4 > password5 > password6 > password7 > password8 > password9 > password00 > password10 > password20 > (...) > ``` > > This might be confusing. Or not? Anyway I think this is the most useful thing we can opt to do, and should be easy to implement. Yes, I think it is confusing. May be we should discuss on john-users what the best solution is. I wouldn't want to have a confusing behavior just because it is "easy to implement".
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

There is no point in using the mailing lists because no-one except us chimes in anyway.

I certainly did not say "just because it's easy to implement". I said "the most useful thing we can opt to do, and should be easy to implement.". I really think that syntax would be the most sensible for hybrid.

<!-- gh-comment-id:62185390 --> @magnumripper commented on GitHub (Nov 7, 2014): There is no point in using the mailing lists because no-one except us chimes in anyway. I certainly did not say "just because it's easy to implement". I said "the most useful thing we can opt to do, and should be easy to implement.". I really think that syntax would be the most sensible for hybrid.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

BTW I edited the command line (and hinted about it) so the one you quoted is not correct (and is indeed more confusing). The correct one is

$ ../run/john -w:dict -stdout -mask=?w?d?d -min-len=0 -max-len=2
<!-- gh-comment-id:62185628 --> @magnumripper commented on GitHub (Nov 7, 2014): BTW I edited the command line (and hinted about it) so the one you quoted is not correct (and is indeed more confusing). The correct one is ``` $ ../run/john -w:dict -stdout -mask=?w?d?d -min-len=0 -max-len=2 ```
Author
Owner

@frank-dittrich commented on GitHub (Nov 7, 2014):

On 11/07/2014 06:56 PM, magnum wrote:

There is no point in using the mailing lists because no-one except us chimes in anyway.

But if you want to find out what users might expect or hope for when
using --min-len with hybrid mask mode,
I'm afraid just discussing it on github is not good enough.
Of course, on john-users you'll have to explain that/how hybrid mask
mode works in general.

<!-- gh-comment-id:62220154 --> @frank-dittrich commented on GitHub (Nov 7, 2014): On 11/07/2014 06:56 PM, magnum wrote: > There is no point in using the mailing lists because no-one except us chimes in anyway. But if you want to find out what _users_ might expect or hope for when using --min-len with hybrid mask mode, I'm afraid just discussing it on github is not good enough. Of course, on john-users you'll have to explain that/how hybrid mask mode works in general.
Author
Owner

@frank-dittrich commented on GitHub (Nov 7, 2014):

Wasn't there at least one format which increases min-length if the value specified is shorter than the format's min length? If so, that format should check whether hybrid mask mode is used...

<!-- gh-comment-id:62220608 --> @frank-dittrich commented on GitHub (Nov 7, 2014): Wasn't there at least one format which increases min-length if the value specified is shorter than the format's min length? If so, that format should check whether hybrid mask mode is used...
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Wasn't there at least one format which increases min-length if the value specified is shorter than the format's min length?

Good point, we need to have them in mind. It's WPAPSK and WoW. Both have a min length of 8.

<!-- gh-comment-id:62222102 --> @magnumripper commented on GitHub (Nov 7, 2014): > Wasn't there at least one format which increases min-length if the value specified is shorter than the format's min length? Good point, we need to have them in mind. It's WPAPSK and WoW. Both have a min length of 8.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

There is no point in using the mailing lists because no-one except us chimes in anyway.

But if you want to find out what users might expect or hope for when using --min-len with hybrid mask mode, I'm afraid just discussing it on github is not good enough.

Feel free to try it, I sort of gave up on it. Also, while end users' opinions are worth some consideration, it's not worth sacrificing performance for. Their input won't likely take us further in terms of "clever ideas" because they will not consider the implementation details.

If we discuss it here and land in something that feels just right, considering usability and code/performance, I'm sure it will be great for end users too.

<!-- gh-comment-id:62223464 --> @magnumripper commented on GitHub (Nov 7, 2014): > > There is no point in using the mailing lists because no-one except us chimes in anyway. > > But if you want to find out what _users_ might expect or hope for when using --min-len with hybrid mask mode, I'm afraid just discussing it on github is not good enough. Feel free to try it, I sort of gave up on it. Also, while end users' opinions _are_ worth some consideration, it's not worth sacrificing performance for. Their input won't likely take us further in terms of "clever ideas" because they will not consider the implementation details. If we discuss it here and land in something that feels just right, considering usability **and** code/performance, I'm sure it will be great for end users too.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Also test session/restore with fork and min-length parameter.

Without fork, it's perfect (no dupe cracks, all cracked)

With fork, it does miss some after resume

$ ../run/john -stdout -1=?u?d -mask=?1?1?1?1 -min-len=0 | perl -pe 'chomp; $_ .= ":\$dummy\$".unpack("H*", $_)."\n"' >pw-dummy 
Press 'q' or Ctrl-C to abort, almost any other key for status
1727605p 0:00:00:01 100.00% (2014-11-07 23:25) 1010Kp/s 9999

$ rm -f ../run/john.pot && ../run/john pw-dummy -1=?u?d -mask=?1?1?1?1 -verb=1 -fork=8 -min-len=0 -max-run=1
$ until ../run/john -res; do echo resuming ; done

$ ../run/john pw-dummy -show | tail -1
1295713 password hashes cracked, 431892 left
<!-- gh-comment-id:62225631 --> @magnumripper commented on GitHub (Nov 7, 2014): > Also test session/restore with fork and min-length parameter. Without fork, it's perfect (no dupe cracks, all cracked) With fork, it does miss some after resume ``` $ ../run/john -stdout -1=?u?d -mask=?1?1?1?1 -min-len=0 | perl -pe 'chomp; $_ .= ":\$dummy\$".unpack("H*", $_)."\n"' >pw-dummy Press 'q' or Ctrl-C to abort, almost any other key for status 1727605p 0:00:00:01 100.00% (2014-11-07 23:25) 1010Kp/s 9999 $ rm -f ../run/john.pot && ../run/john pw-dummy -1=?u?d -mask=?1?1?1?1 -verb=1 -fork=8 -min-len=0 -max-run=1 $ until ../run/john -res; do echo resuming ; done $ ../run/john pw-dummy -show | tail -1 1295713 password hashes cracked, 431892 left ```
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Here's another way to see the issue:

Not using minlen, working fine:

$ ../run/john -stdout=6 -mask -node=3/8 -max-run=1 | tail -3
Node number 3 of 8
Press 'q' or Ctrl-C to abort, almost any other key for status
2654209p 0:00:00:01 0.57% (ETA: 23:52:51) 2157Kp/s Ofb7aj
Session stopped (max run-time reached)
Mfb7aj
Nfb7aj
Ofb7aj

$ ../run/john -res | head -3
Node number 3 of 8
Press 'q' or Ctrl-C to abort, almost any other key for status
2654209p 0:00:00:02 0.57% (ETA: 23:55:51) 1327Kp/s 
Ofb7aj
Pfb7aj
Qfb7aj

Using minlen:

$ ../run/john -stdout=6 -mask -min-len=0 -node=3/8 -max-run=1 | tail -3
Node number 3 of 8
Press 'q' or Ctrl-C to abort, almost any other key for status
3160334p 0:00:00:01 0.67% (ETA: 23:53:46) 2569Kp/s 4kz8j
Session stopped (max run-time reached)
2kz8j
3kz8j
4kz8j

$ ../run/john -res | head -3
Node number 3 of 8
Press 'q' or Ctrl-C to abort, almost any other key for status
3160334p 0:00:00:02 0.67% (ETA: 23:56:15) 1580Kp/s 

4
5
<!-- gh-comment-id:62227400 --> @magnumripper commented on GitHub (Nov 7, 2014): Here's another way to see the issue: Not using minlen, working fine: ``` $ ../run/john -stdout=6 -mask -node=3/8 -max-run=1 | tail -3 Node number 3 of 8 Press 'q' or Ctrl-C to abort, almost any other key for status 2654209p 0:00:00:01 0.57% (ETA: 23:52:51) 2157Kp/s Ofb7aj Session stopped (max run-time reached) Mfb7aj Nfb7aj Ofb7aj $ ../run/john -res | head -3 Node number 3 of 8 Press 'q' or Ctrl-C to abort, almost any other key for status 2654209p 0:00:00:02 0.57% (ETA: 23:55:51) 1327Kp/s Ofb7aj Pfb7aj Qfb7aj ``` Using minlen: ``` $ ../run/john -stdout=6 -mask -min-len=0 -node=3/8 -max-run=1 | tail -3 Node number 3 of 8 Press 'q' or Ctrl-C to abort, almost any other key for status 3160334p 0:00:00:01 0.67% (ETA: 23:53:46) 2569Kp/s 4kz8j Session stopped (max run-time reached) 2kz8j 3kz8j 4kz8j $ ../run/john -res | head -3 Node number 3 of 8 Press 'q' or Ctrl-C to abort, almost any other key for status 3160334p 0:00:00:02 0.67% (ETA: 23:56:15) 1580Kp/s 4 5 ```
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Hmm but that happens without node/fork too:

$ ../run/john -stdout=6 -mask -min-len=0 -max-run=3 | tail -3
Press 'q' or Ctrl-C to abort, almost any other key for status
9756092p 0:00:00:03 0.26% (ETA: 00:12:39) 3020Kp/s s9nmc
Session stopped (max run-time reached)
q9nmc
r9nmc
s9nmc

$ ../run/john -res | head -3
Press 'q' or Ctrl-C to abort, almost any other key for status
9756092p 0:00:00:04 0.26% (ETA: 00:19:05) 2439Kp/s 

s
t

So the problem with minlen but without node/fork is unnecessary extra work at resuming (ending up in no loss). Using node/fork we also get out of node sync so we get loss.

<!-- gh-comment-id:62227787 --> @magnumripper commented on GitHub (Nov 7, 2014): Hmm but that happens without node/fork too: ``` $ ../run/john -stdout=6 -mask -min-len=0 -max-run=3 | tail -3 Press 'q' or Ctrl-C to abort, almost any other key for status 9756092p 0:00:00:03 0.26% (ETA: 00:12:39) 3020Kp/s s9nmc Session stopped (max run-time reached) q9nmc r9nmc s9nmc $ ../run/john -res | head -3 Press 'q' or Ctrl-C to abort, almost any other key for status 9756092p 0:00:00:04 0.26% (ETA: 00:19:05) 2439Kp/s s t ``` So the problem with minlen but without node/fork is unnecessary extra work at resuming (ending up in no loss). Using node/fork we also get out of node sync so we get loss.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Maybe you need to take rec_len (and/or restored_len) into account in what you did in 2fdf711

<!-- gh-comment-id:62228103 --> @magnumripper commented on GitHub (Nov 7, 2014): Maybe you need to take rec_len (and/or restored_len) into account in what you did in 2fdf711
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Hm no this problem was not caused by 2fdf711

<!-- gh-comment-id:62228283 --> @magnumripper commented on GitHub (Nov 7, 2014): Hm no this problem was not caused by 2fdf711
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

Fixed in 9dc70bb

<!-- gh-comment-id:62228989 --> @magnumripper commented on GitHub (Nov 7, 2014): Fixed in 9dc70bb
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2014):

All good now, it seems. Will continue testing

<!-- gh-comment-id:62229222 --> @magnumripper commented on GitHub (Nov 7, 2014): All good now, it seems. Will continue testing
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#455
No description provided.