mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #570] Add session save/restore for --regex mode #246
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#246
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 (Apr 19, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/570
@jfoug commented on GitHub (Apr 21, 2014):
@magnumripper commented on GitHub (May 2, 2014):
The two wordlist cases will likely work fine already, but with greater loss (ie. repeated effort after resume). For a complex regex it might be a whole lot of duplicate effort.
@magnumripper commented on GitHub (May 25, 2014):
This is kind of high priority, not being able to resume is pretty nasty. But I don't have a clue how to code this. Jim, I bet you have?
@magnumripper commented on GitHub (May 25, 2014):
Added a warning in
1045c4dwhen used as a separate mode.@magnumripper commented on GitHub (Dec 4, 2014):
Since we have the warning in place, I'm moving this to later milestone.
@jfoug commented on GitHub (Mar 10, 2016):
I have been working on this, and it is NOT fun.
First, there are issues with rexgen save/resume. I am trying to work through all of those first. I 'think' I have the save/resume code in JtR working semi OK, I just need to fix rexgen (with as small as possible of a patch), and then remove a bunch of work around 'hacks' in JtR The hacks could not get things done, because there is a latent bug that I could not hack my way around.
@jfoug commented on GitHub (Mar 10, 2016):
This CR was given to the rexgen page. I think there will be another before I am done.
https://github.com/teeshop/rexgen/issues/28
https://github.com/teeshop/rexgen/pull/29 (pull request)
NOTE, I can not incorporate my changes until the above issue is addressed. We use rexgen in hybrid mode 1 word at a time. For save/restore to work, we have to not create a new session for each word,but create the session 1 time, and then re-use it. But rexgen is in charge of reading words, AND there were real problems restarting a session with new words (until the above patch is done).
NOTE, there is also still a bug IN the resume. Here are examples:
the regex is \0[0-9][0-9] The 'proper' resume should be either 001_19 or 001_29 (my choice would be 001_19)
If you see where the session left off, when reloaded, it incremented BOTH of the sets (1 went to 2 and 9 went to restart or 0). So from this regex, we are missing 10 candidates (well, in the above example, we actually are re-doing 90 candidates.
This happens all the time, here we see how for this regex we miss 10 items:
I think what SHOULD happen is that if 001_56 is requested, that the restart data should return whatever data is needed so that 001_56 is the first thing returned after a restart, and then if the calling program knows that 001_56 was completed, it would call next() dropping the data. BUT if 001_56 was aborted during work, then 001_56 should be the item to restart from. Only the calling program would know that.
But I have not gotten that figure out yet. However, I do have rexgen fully incorporated into my VC environment (not an easy task), so possibly I can find a simple solution to this. This code is NOT easy to debug, by any stretch.
@jfoug commented on GitHub (Mar 10, 2016):
I have a work around now for the bug above.
Here is my changes:
I think what was wrong was I was using a newly created iterator, and the proper 'state' value of the iterator is not being saved. Only the data and children are being saved. BUT with a call to next(), it appears to properly resume.
From the iterator.h (Iterator base class), this is the data not being saved (and later restored). This actually SHOULD be a trivial thing to fix.
@jfoug commented on GitHub (Mar 10, 2016):
Ok I have everything found and fixed, and into the PR for rexgen.
github.com/jfoug/rexgen@43eb0b4a81This required the version of rexgen to get bumped to 1.4.0 since this change DOES make the save format strings incompatible. The state value was added for each iterator record.
@jfoug commented on GitHub (Aug 8, 2016):
Completed with PR #2199