Open jfoug opened 5 years ago
Note, this does 'some' of what is listed here:
--list=rules-details-noprep --rules=single
It could probably 'work' for the -list=rules-details --rules=single
method. It does not show the rule number (not really important), but the rest is done (i.e file and section inclusion). So for all purpose, --list=rules-details-noprep is completed.
I like this!
The 3rd 'option' is the harder one. This will require some 'thought'. But this would be the easy way to dump out a section (with comments above, and internal to that section).
For item 3 (Off the cuff, I am not looking at code, and some of this may be there), I would think this type algorithm.
.include [section]
We leave those section include LINES in the list.The biggest unknown is being able to read the config, keeping comments (possibly blank lines), and not expanding the 'section' includes. It may be easy to do this, by creating a function in config that sets a variable (signaling us to use a bit different behavior), then dump and re-read the config, using this new flag variable set. The config data would be 'not' valid, but since we are exiting once we dump the data, it is not that bad of a situation (IMHO).
This change really should be pretty trivial (I think). The most code change will likely be the plumbing to get it working (options, reading/setting/handling, the bash completion, updating dox, etc).
Actually, it may be better to 'default' to the raw. So --list=rules-details
would show the un-preprocessed rules, and comments. Then we could either build a --list=rules-details-pp
to dump pre-processed rules, OR simly use the existing --list=list-data:List.Rules:rule_name
logic (even having --list=rules-details-pp
simply be a alias for the list-data option.
What do you think about this implementation?
(Note, it may be 'best' to build it this way):
real function: --list=list-data-raw:List.Rules:rule_name
alias: --list=rules-details=rule_name
real function: --list=list-data:List.Rules:rule_name
alias: --list=rules-details-pp=rule_name
That way we get ability to raw dump any list, and simply add the 'helper' alias for rules, and we may decide we do not really 'need' the aliases. That the list-data-raw and list-data are sufficient.
(Hopefully, this is not already available, making this a PEBKAC which I now see has been renamed invalid, lol. If we were to replace it, I much prefer using the "ID:107 error" moniker myself, lol.)
No. Currently we only have --list=rules
listing all the rules sections and
--list=list-data:list.rules:single
listing the contents of the [List.Rules:Single]
section (resolving included sections and files, but not expanding to individual rules.
--list=rules-details --list=rules-details-noprep (handled by -list=list-data:List.Rules:rule_name)
Instead of
$ ./john --list=rules-details --rules=single
I'd prefer
$ ./john --list=rules-details:single
I agree with Frank (and I did not even remember we already have some of this 😆 )
Instead of
$ ./john --list=rules-details --rules=single
I'd prefer
$ ./john --list=rules-details:single
I highly agree to this. Much, much better syntax.
read john.conf. In reading, we do not remove comments (blanks, ???). Unless the command line has a --config=
option
(and I did not even remember we already have some of this :laughing: )
I remember, because I implemented it. (The idea was to automate distributed cracking, by generating a set of tiny config files and other command line options, and idle clients should be able to pick up the next package ...)
(Hopefully, this is not already available, making this a PEBKAC which I now see has been renamed invalid, lol. If we were to replace it, I much prefer using the "ID:107 error" moniker myself, lol.)
This option will dump out a nice display of the rules which make up a section. It will be similar to the output we see when logging is enabled, when a new rule is found, then preprocessed and accepted.
So output would be something like this:
There could be a 2nd 'feature', say --list=rules-details-noprep which would skip the preprocessor. So you would see something like:
There might even be a 3rd option (Not sure about this, since you can simply vi the conf file) This option (something like --list=rules-details-original) would simply dump the section out of the .conf file intact, commenting, include directives, etc intact. This may be much harder to do, since we do not know which conf file things are in. Also, we may have to pre-process conf files expanding includes. Since we are wanting to output 'exactly' what is in the ruleset, we would not be dropping comments, AND probably should make best effort to also include any prelim comments. Likely this will be 100% custom code, we can not use any of the config handling code (unless we 'adjust' it some, I think the comment inclusion is the biggest hurdle, but I am not sure).
Example: