mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #845] Mask mode: -node/fork distribution is broken when using -min-len and (seemingly) poor otherwise #455
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#455
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 @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:
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:
Here, using -fork made us miss 280 cracks, but dupe-crack almost all of the others.
@magnumripper commented on GitHub (Nov 7, 2014):
BTW I verified with
-inc:uppernum, that the above figures when not using -fork are correct.@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?@sayan1an commented on GitHub (Nov 7, 2014):
On Fri, Nov 7, 2014 at 7:08 AM, magnum notifications@github.com wrote:
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.
@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.
@magnumripper commented on GitHub (Nov 7, 2014):
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.
@sayan1an commented on GitHub (Nov 7, 2014):
On Fri, Nov 7, 2014 at 7:58 AM, magnum notifications@github.com wrote:
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.
@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:
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.
@magnumripper commented on GitHub (Nov 7, 2014):
Although we must never ever produce a word longer than fmt_maxlen...
@magnumripper commented on GitHub (Nov 7, 2014):
I edited that
@magnumripper commented on GitHub (Nov 7, 2014):
Also, restarting John with a million hashes and a 450 MB john.pot takes forever and ever. This is simply not an alternative.
@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.
@sayan1an commented on GitHub (Nov 7, 2014):
On Fri, Nov 7, 2014 at 8:56 AM, magnum notifications@github.com wrote:
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.
@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@sayan1an commented on GitHub (Nov 7, 2014):
Also test session/restore with fork and min-length parameter.
@frank-dittrich commented on GitHub (Nov 7, 2014):
On 11/07/2014 04:19 AM, magnum wrote:
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".
@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.
@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
@frank-dittrich commented on GitHub (Nov 7, 2014):
On 11/07/2014 06:56 PM, magnum wrote:
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.
@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...
@magnumripper commented on GitHub (Nov 7, 2014):
Good point, we need to have them in mind. It's WPAPSK and WoW. Both have a min length of 8.
@magnumripper commented on GitHub (Nov 7, 2014):
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.
@magnumripper commented on GitHub (Nov 7, 2014):
Without fork, it's perfect (no dupe cracks, all cracked)
With fork, it does miss some after resume
@magnumripper commented on GitHub (Nov 7, 2014):
Here's another way to see the issue:
Not using minlen, working fine:
Using minlen:
@magnumripper commented on GitHub (Nov 7, 2014):
Hmm but that happens without node/fork too:
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.
@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@magnumripper commented on GitHub (Nov 7, 2014):
Hm no this problem was not caused by
2fdf711@magnumripper commented on GitHub (Nov 7, 2014):
Fixed in
9dc70bb@magnumripper commented on GitHub (Nov 7, 2014):
All good now, it seems. Will continue testing