mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2282] Run several rule-sets sequentially #1528
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#1528
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 (Sep 19, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2282
Originally assigned to: @magnumripper, @jfoug on GitHub.
Just an idea.
--rules=SECTION,SECTION[,SECTION...]For example, using
--rules=wordlist,singleshould be the exact same as creating a new section:...and then running
--rules=ws. I would think we can implement this KISS at some clever level (ie. only touching rules.c and/or pp.c, not eg. wordlist.c) and it would be a pretty sweet option.Note that this is in no way the same as eg. #2122 or #745, which would run a word through multiple rules. This one is just a way to run two or more rule-sets sequentially, in one session.
@jfoug commented on GitHub (Sep 19, 2016):
I like this idea a lot. Again, we need to get into rules 'duplicate-reductions' if possible.
@jfoug commented on GitHub (Sep 21, 2016):
the KISS method is simply to make a quick change in rpp_init() I can get this done in just a few minutes. Do you want me to make a branch for this, or just check it in? We might expand this a LOT. This might be a good way to handle the rule on rule stacking also. Turning rpp_init into a simple 'expression' parser.
So we could handle:
@magnumripper can you chime in on any of these additional ideas ( @frank-dittrich your usage insight is greatly wanted also).
NOTE, for a start, I will do the ',' addition only, and we can see how it goes.
@jfoug commented on GitHub (Sep 21, 2016):
NOTE, if we are going to allow 'mixing' of : and , * in the command arg, then there will have to be some form of delimiter for starting and ending the : inline rules. It may be better to not allow 'mixing' of the inline and .conf sections. But mixing , and * should be easy but may require using () grouping. But with this KISS patch, rules command line arg now handles:
@magnumripper commented on GitHub (Sep 21, 2016):
Wow, yeah the additional ideas are way cool as long as it doesn't get messy in terms of ambiguity. Can an inline rule contain a
,? I don't think so, can't find it right now even in Hashcat rules.If you are pretty sure everything is solid, just push it to the main branch. But there's no harm in making a topic branch if you have any doubt at all. I'm not sure what "could" go very wrong but resuming comes to mind... How about we did
--rules=setA,setB,setCand then stopped the job during setB. Will resuming be correct?@jfoug commented on GitHub (Sep 21, 2016):
Yup. ,N is a newer addition, it is a HC rule, but is now part of jumbo even without specifying HC.
@jfoug commented on GitHub (Sep 21, 2016):
I 'assume' there will be zero impact on resuming. The
---rules=setA,setB,setCswitch is stored in the .rec file. When we 'run', we are not using any config section, but BUILDING our own simulated section (name 'changes' in the rules so error messages make sense), and then wordlist/pp runs this special built . Upon resume, the rpp_init will still load the same data from set[ABC] in the same order, so there should be no issue resuming.I am pretty sure this is AS solid as the inline rules code, which has caused no problems, and the first push is still the way the code stands today. Yes, I did make a change to that original 'inline' rule code in this change (the sizeof value used for alignment), but it is still the same code. I will validate that resuming IS working (I would be absolutely shocked if it had problems). Also I will get it put into documentation, and then pushed.
NOTE, This code handles
--rules=setAand--rules=setA,setBand--rules=setA,setB,setC,setD....all just fine. The Rules X Rules code is not part of what is done here. However, I think this is the right place to do that when the time comes to do it.@magnumripper commented on GitHub (Sep 21, 2016):
This makes sense. The rec file stores the rule number of the expanded rule-set. We are just adding a way to expand it.
@magnumripper commented on GitHub (Sep 21, 2016):
That code you posted is friggin' beautiful! Like I said, I would think we can implement this KISS at some clever level 😎
@magnumripper commented on GitHub (Sep 25, 2016):
I haven't made any real regression tests, just tried this out in various ways. This feature rocks! No more temporary john.conf sections just to run a one-off of some particular rule-sets in some particular order.
@jfoug commented on GitHub (Sep 25, 2016):
Im gonna close this. With ca9cb18 the code is there for a serial set of rules. If there are regression bugs, we can open new issues. Also, this issue was not for rulesA X rulesB work. This code insertion location is probably the right place, but that logic does need to be thought out a lot better than this.
NOTE, this will generate duplicate rules (word results), and does not contain any code to remove those dupes.
@magnumripper commented on GitHub (Sep 25, 2016):
But the code we already have for that should work... and it almost does:
It says it removes the dupe
:rule, but then it doesn't (it actually doesn't, I checked). I'll see if I can make the normal dupe reduction gears to work with us.@jfoug commented on GitHub (Oct 6, 2016):
Did some debugging, and the id was always 0. This should fix things.
f1d1b09@magnumripper commented on GitHub (Oct 6, 2016):
Great! Indeed it does.
@jfoug commented on GitHub (Oct 6, 2016):
I might still add the r1*r2 This would be r1.1+r2.1 , r1.1+r2.2 , r1.1+r2.3 ... r1.n+r2.m
i.e. each of rule set 1 with each of rule set 2 appended.
Note, this could very easily be something that allows a user to crash the system, since it is exponential growth. There would need to be some form of checking added for max size. BUT it should be pretty easy to do this in nearly the same manner as for the rule + rule (i.e. with the comma) that was just added.
@magnumripper commented on GitHub (Oct 6, 2016):
We can tax the system already using PP things like
[a-z][a-z][a-z][a-z](...)so I don't think that's much of a problem - as long as we fail with some relevant message like "out of memory".@magnumripper commented on GitHub (Oct 6, 2016):
Things get tricky though, with implicit M, reject rules and other things.