openwall / openwall/john

Add a new --list=rules-details option(s)

Open
#3,592 9 comments 0 reactions 1 assignee View on GitHub

@jfoug is already working on this.

Since Jan 16, 2019.

documentation enhancement testing
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

(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.)

  • --list=rules-details
  • --list=rules-details-noprep (handled by -list=list-data:List.Rules:rule_name)
  • --list=rules-details-raw (NOTE, likely better to add as --list=list-data-raw:name, vs just allowing List.Rules:rulename lists to be dumped raw)

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:

$ ./john -list=rules-details  --rules=single

dump of processed rules from [List.Rules=single]
...
Rule #560: '-c l Q T4 Q M T4 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT4QMT4QlTmQCQuQX0z0'l'
Rule #561: '-c l Q T5 Q M T5 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT5QMT5QlTmQCQuQX0z0'l'
Rule #562: '-c l Q T6 Q M T6 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT6QMT6QlTmQCQuQX0z0'l'
Rule #563: '-c l Q T7 Q M T7 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT7QMT7QlTmQCQuQX0z0'l'
Rule #564: '-c l Q T8 Q M T8 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT8QMT8QlTmQCQuQX0z0'l'
Rule #565: '-c l Q T9 Q M T9 Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQT9QMT9QlTmQCQuQX0z0'l'
Rule #566: '-c l Q TA Q M TA Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQTAQMTAQlTmQCQuQX0z0'l'
Rule #567: '-c l Q TB Q M TB Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQTBQMTBQlTmQCQuQX0z0'l'
Rule #568: '-c l Q TC Q M TC Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQTCQMTCQlTmQCQuQX0z0'l'
Rule #569: '-c l Q TD Q M TD Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQTDQMTDQlTmQCQuQX0z0'l'
Rule #570: '-c l Q TE Q M TE Q l Tm Q C Q u Q X0z0 'l' accepted as 'lQTEQMTEQlTmQCQuQX0z0'l'
Rule #571: '-c >2 <G %2?a l T0 M T2 T4 T6 T8 TA TC TE Q M l Tm Q X0z0 'l' accepted as '>2<G%2?alT0MT2T4T6T8TATCTEQMlTmQX0z0'l'
Rule #572: '-c >2 <G %2?a u T0 M T2 T4 T6 T8 TA TC TE Q M l Tm Q X0z0 'l' accepted as '>2<G%2?auT0MT2T4T6T8TATCTEQMlTmQX0z0'l'
...

There could be a 2nd 'feature', say --list=rules-details-noprep which would skip the preprocessor. So you would see something like:

$ ./john -list=rules-details-noprep  --rules=single

dump of processed rules from [List.Rules=single] without pre-processing
...
Rule #43: -c l Q T[1-9A-E] Q M T\0 Q l Tm Q C Q u Q X0z0 'l
Rule #44: -c >2 <G %2?a [lu] T0 M T2 T4 T6 T8 TA TC TE Q M l Tm Q X0z0 'l
...

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:

$ ./john -list=rules-details-raw  --rules=all

dump raw rules section from [List.Rules=all]

# Everything, including all KoreLogic and the rest of included hashcat rules.
# Only for very fast hashes and/or Single mode. Some of these rules are of
# ridiculous quality and lack optimizations - you have been warned.
[List.Rules:All]
.include [List.Rules:Jumbo]
.include [List.Rules:KoreLogic]
.include [List.Rules:T9]
.include [List.Rules:hashcat]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.