[GH-ISSUE #2105] new command line switch to provide a rule to be run (RFC) #1408

Closed
opened 2026-10-15 04:15:52 +07:00 by bsakaguchi · 32 comments
Owner

Originally created by @jfoug on GitHub (Mar 29, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2105

I was wondering if there is interest or 'need' for adding a command line option to allow a rule to be provided on command line (like mask is) ?

Originally created by @jfoug on GitHub (Mar 29, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2105 I was wondering if there is interest or 'need' for adding a command line option to allow a rule to be provided on command line (like mask is) ?
bsakaguchi 2026-10-15 04:15:52 +07:00
Author
Owner

@magnumripper commented on GitHub (Mar 30, 2016):

I have wanted it at times but I also agree with @solardiz we generally bloat Jumbo too much.

<!-- gh-comment-id:203250788 --> @magnumripper commented on GitHub (Mar 30, 2016): I have wanted it at times but I also agree with @solardiz we generally bloat Jumbo too much.
Author
Owner

@jfoug commented on GitHub (Mar 30, 2016):

Agreed about bloat, but is this any more or less needed than having mask on command line? Just because rules have been in a config file does not mean that it 'has' to be that way. Adding another command line switch is pretty much a trivial thing, adds little to bloat, and when you understand what rules you want (especially with knowledge of rpp), then it is really useful. Also, it would be super useful when building rules, to be able to toss some samples at a rule you are building, making sure the result is what you want it to be. I have actually started to use the rule_tst.pl script to do that, since I added the command line switch to -dump the pp output. Helps to make sure what shows us is what I expect to show up from a rule.

I have not started on any switch like this, because I wanted to hear from others. I vote for it, but will listen.

<!-- gh-comment-id:203253167 --> @jfoug commented on GitHub (Mar 30, 2016): Agreed about bloat, but is this any more or less needed than having mask on command line? Just because rules have been in a config file does not mean that it 'has' to be that way. Adding another command line switch is pretty much a trivial thing, adds little to bloat, and when you understand what rules you want (especially with knowledge of rpp), then it is really useful. Also, it would be super useful when building rules, to be able to toss some samples at a rule you are building, making sure the result is what you want it to be. I have actually started to use the rule_tst.pl script to do that, since I added the command line switch to -dump the pp output. Helps to make sure what shows us is what I expect to show up from a rule. I have not started on any switch like this, because I wanted to hear from others. I vote for it, but will listen.
Author
Owner

@magnumripper commented on GitHub (Mar 30, 2016):

So with RPP also. Well, it sure could be handy. Perhaps give it a shot and see how intrusive (or not) the patch becomes. Use a topic branch, of course.

But you probably want to wait with this until #2087 is finished, or we'll end up with incompatible branches that rot from never being merged.

<!-- gh-comment-id:203254981 --> @magnumripper commented on GitHub (Mar 30, 2016): So with RPP also. Well, it sure could be handy. Perhaps give it a shot and see how intrusive (or not) the patch becomes. Use a topic branch, of course. But you probably want to wait with this until #2087 is finished, or we'll end up with incompatible branches that rot from never being merged.
Author
Owner

@jfoug commented on GitHub (Mar 30, 2016):

I might poke at this, even with #2087 still hanging on (which is also waiting on some of the other save/restore logic). This may be pretty easy. I am going to try to simply use the existing overloaded

-rules[=section]     to -rules[=(section|abs_rule)]

That code is already jumbo only, so it should not matter if it can figure out if it is a conf section, OR a absolute rule line.

Jim.

<!-- gh-comment-id:203622569 --> @jfoug commented on GitHub (Mar 30, 2016): I might poke at this, even with #2087 still hanging on (which is also waiting on some of the other save/restore logic). This may be pretty easy. I am going to try to simply use the existing overloaded ``` -rules[=section] to -rules[=(section|abs_rule)] ``` That code is already jumbo only, so it should not matter if it can figure out if it is a conf section, OR a absolute rule line. Jim.
Author
Owner

@jfoug commented on GitHub (Mar 30, 2016):

This was trivial (I have not checked it in yet). There may be things we need to 'check', such as this properly saves/restores, but I am pretty sure it should.

diff --git a/src/options.c b/src/options.c
index fc20cd2..73d2eb6 100644
--- a/src/options.c
+++ b/src/options.c
@@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = {
 PRINCE_USAGE \
 "--encoding=NAME           input encoding (eg. UTF-8, ISO-8859-1). See also\n" \
 "                          doc/ENCODING and --list=hidden-options.\n" \
-"--rules[=SECTION]         enable word mangling rules for wordlist or PRINCE\n" \
+"--rules[=(SECTION|1Rule)] enable word mangling rules for wordlist or PRINCE\n" \
 "--incremental[=MODE]      \"incremental\" mode [using section MODE]\n" \
 "--mask[=MASK]             mask mode using MASK (or default mask from john.conf)\n" \
 "--markov[=OPTIONS]        \"Markov\" mode (see doc/MARKOV)\n" \
diff --git a/src/rpp.c b/src/rpp.c
index 6643ca3..4a5a956 100644
--- a/src/rpp.c
+++ b/src/rpp.c
@@ -15,12 +15,24 @@
 int rpp_init(struct rpp_context *ctx, char *subsection)
 {
        struct cfg_list *list;
+       static struct cfg_line one_rule;

        if ((list = cfg_get_list(SECTION_RULES, subsection)))
+       {
        if ((ctx->input = list->head)) {
                ctx->count = -1;
                return 0;
        }
+       } else {
+               one_rule.cfg_name = "cmd_line_rule";
+               one_rule.data = subsection;
+               one_rule.id = 0;
+               one_rule.next = 0;
+               one_rule.number = 0;
+               ctx->input = &one_rule;
+               ctx->count = -1;
+               return 0;
+       }

        return 1;
 }
$ echo pass | ../run/john -rules=tst_cur -stdout -pipe
pass1
pass2
pass3
Pass1
Pass2
Pass3
6p 0:00:00:00 0.00% 260.8p/s Pass3

$ echo pass | ../run/john -rules='-[c:] $[1-3] \p1[:c]' -stdout -pipe
pass1
pass2
pass3
Pass1
Pass2
Pass3
6p 0:00:00:00 0.00% 250.0p/s Pass3

$ cat john-local.conf

[List.Rules:tst_cur]
-[:c] $[1-3] \p1[:c]

<!-- gh-comment-id:203644899 --> @jfoug commented on GitHub (Mar 30, 2016): This was trivial (I have not checked it in yet). There may be things we need to 'check', such as this properly saves/restores, but I am pretty sure it should. ``` diff diff --git a/src/options.c b/src/options.c index fc20cd2..73d2eb6 100644 --- a/src/options.c +++ b/src/options.c @@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = { PRINCE_USAGE \ "--encoding=NAME input encoding (eg. UTF-8, ISO-8859-1). See also\n" \ " doc/ENCODING and --list=hidden-options.\n" \ -"--rules[=SECTION] enable word mangling rules for wordlist or PRINCE\n" \ +"--rules[=(SECTION|1Rule)] enable word mangling rules for wordlist or PRINCE\n" \ "--incremental[=MODE] \"incremental\" mode [using section MODE]\n" \ "--mask[=MASK] mask mode using MASK (or default mask from john.conf)\n" \ "--markov[=OPTIONS] \"Markov\" mode (see doc/MARKOV)\n" \ diff --git a/src/rpp.c b/src/rpp.c index 6643ca3..4a5a956 100644 --- a/src/rpp.c +++ b/src/rpp.c @@ -15,12 +15,24 @@ int rpp_init(struct rpp_context *ctx, char *subsection) { struct cfg_list *list; + static struct cfg_line one_rule; if ((list = cfg_get_list(SECTION_RULES, subsection))) + { if ((ctx->input = list->head)) { ctx->count = -1; return 0; } + } else { + one_rule.cfg_name = "cmd_line_rule"; + one_rule.data = subsection; + one_rule.id = 0; + one_rule.next = 0; + one_rule.number = 0; + ctx->input = &one_rule; + ctx->count = -1; + return 0; + } return 1; } ``` ``` $ echo pass | ../run/john -rules=tst_cur -stdout -pipe pass1 pass2 pass3 Pass1 Pass2 Pass3 6p 0:00:00:00 0.00% 260.8p/s Pass3 $ echo pass | ../run/john -rules='-[c:] $[1-3] \p1[:c]' -stdout -pipe pass1 pass2 pass3 Pass1 Pass2 Pass3 6p 0:00:00:00 0.00% 250.0p/s Pass3 $ cat john-local.conf [List.Rules:tst_cur] -[:c] $[1-3] \p1[:c] ```
Author
Owner

@jfoug commented on GitHub (Mar 30, 2016):

Note, I tried to write it to only be line adds within rpp.c, even though I think this may be code where we already diverge from core (since we load the config section name).

I had a feeling the code would be just this trivial, once the magic 'spot' was found.

<!-- gh-comment-id:203645806 --> @jfoug commented on GitHub (Mar 30, 2016): Note, I tried to write it to only be line adds within rpp.c, even though I think this may be code where we already diverge from core (since we load the config section name). I had a feeling the code would be just this trivial, once the magic 'spot' was found.
Author
Owner

@jfoug commented on GitHub (Mar 30, 2016):

Note should we validate this:

  •           one_rule.data = subsection;
    

or simply let the rules processor fail ?

The code as it is, does this:

$ echo pass | ../run/john -rules='-[c:] $[1-3] \p1[:E]' -stdout -pipe
Invalid rule in cmd_line_rule at line 0: Unknown command

(the E is invalid), so I think it is fine as it stands. However, if you try to type a section, and the section name is wrong, the code will now use it as a rule, and not return that the section was not found. That is really the only bad side effect.

$ echo pass | ../run/john -rules=cur_tst -stdout -pipe
Invalid rule in cmd_line_rule at line 0: Invalid position code

That should have been section tst_cur and not cur_tst.. But note it 'does' list the rule 'section' of cmd_line_rule

<!-- gh-comment-id:203648582 --> @jfoug commented on GitHub (Mar 30, 2016): Note should we validate this: - one_rule.data = subsection; or simply let the rules processor fail ? The code as it is, does this: ``` $ echo pass | ../run/john -rules='-[c:] $[1-3] \p1[:E]' -stdout -pipe Invalid rule in cmd_line_rule at line 0: Unknown command ``` (the E is invalid), so I think it is fine as it stands. However, if you try to type a section, and the section name is wrong, the code will now use it as a rule, and not return that the section was not found. That is really the only bad side effect. ``` $ echo pass | ../run/john -rules=cur_tst -stdout -pipe Invalid rule in cmd_line_rule at line 0: Invalid position code ``` That should have been section tst_cur and not cur_tst.. But note it 'does' list the rule 'section' of cmd_line_rule
Author
Owner

@jfoug commented on GitHub (Mar 31, 2016):

If I add this, I think I will also allow multiple rules to be on command line. They will have to be in 1 switch (I think) since the getopt solar built does not do multipe of same. But it is still easy, just make a line separator (like \n). So

'--rules=:\n-[:c]\p1[lc]Q\n-[:c]$[1-90]l\p1[:M]\p1[:c]\p1[:Q]'

would be 3 rules (but after rpp, would be 23)

<!-- gh-comment-id:203712160 --> @jfoug commented on GitHub (Mar 31, 2016): If I add this, I think I will also allow multiple rules to be on command line. They will have to be in 1 switch (I think) since the getopt solar built does not do multipe of same. But it is still easy, just make a line separator (like \n). So ``` '--rules=:\n-[:c]\p1[lc]Q\n-[:c]$[1-90]l\p1[:M]\p1[:c]\p1[:Q]' ``` would be 3 rules (but after rpp, would be 23)
Author
Owner

@jfoug commented on GitHub (Mar 31, 2016):

This change is pretty trivial, AND appears to be without major side effects (the only one I can think of is a mis spelled config section name will now be treated as a rule). I think this adds some power for power users. I know you mentioned to put this in a branch, but I simply can not see problems with it.

diff --git a/src/options.c b/src/options.c
index fc20cd2..0e6864e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = {
 PRINCE_USAGE \
 "--encoding=NAME           input encoding (eg. UTF-8, ISO-8859-1). See also\n" \
 "                          doc/ENCODING and --list=hidden-options.\n" \
-"--rules[=SECTION]         enable word mangling rules for wordlist or PRINCE\n" \
+"--rules[=(SECTION|rule)]  enable word mangling rules for wordlist or PRINCE\n" \
 "--incremental[=MODE]      \"incremental\" mode [using section MODE]\n" \
 "--mask[=MASK]             mask mode using MASK (or default mask from john.conf)\n" \
 "--markov[=OPTIONS]        \"Markov\" mode (see doc/MARKOV)\n" \
diff --git a/src/rpp.c b/src/rpp.c
index 6643ca3..d0b9740 100644
--- a/src/rpp.c
+++ b/src/rpp.c
@@ -17,10 +17,34 @@ int rpp_init(struct rpp_context *ctx, char *subsection)
        struct cfg_list *list;

        if ((list = cfg_get_list(SECTION_RULES, subsection)))
+       {
        if ((ctx->input = list->head)) {
                ctx->count = -1;
                return 0;
        }
+       } else {
+               char *p, *buf;
+               const int sz = sizeof(struct cfg_line);
+               struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8);
+
+               buf = str_alloc_copy(subsection);
+               cfg_cur->cfg_name = "Command Line Rule";
+               cfg_cur->data = buf;
+               ctx->input = cfg_cur;
+               p = strstr(buf, "\\n");
+               while (p && *p) {
+                       *p = 0;
+                       p += 2;
+                       if (!p[0]) continue;
+                       cfg_cur->next = mem_calloc_tiny(sz, 8);
+                       cfg_cur = cfg_cur->next;
+                       cfg_cur->cfg_name = "Command Line Rule";
+                       cfg_cur->data = p;
+                       p = strstr(p, "\\n");
+               }
+               ctx->count = -1;
+               return 0;
+       }

        return 1;
 }
<!-- gh-comment-id:203981701 --> @jfoug commented on GitHub (Mar 31, 2016): This change is pretty trivial, AND appears to be without major side effects (the only one I can think of is a mis spelled config section name will now be treated as a rule). I think this adds some power for power users. I know you mentioned to put this in a branch, but I simply can not see problems with it. ``` diff diff --git a/src/options.c b/src/options.c index fc20cd2..0e6864e 100644 --- a/src/options.c +++ b/src/options.c @@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = { PRINCE_USAGE \ "--encoding=NAME input encoding (eg. UTF-8, ISO-8859-1). See also\n" \ " doc/ENCODING and --list=hidden-options.\n" \ -"--rules[=SECTION] enable word mangling rules for wordlist or PRINCE\n" \ +"--rules[=(SECTION|rule)] enable word mangling rules for wordlist or PRINCE\n" \ "--incremental[=MODE] \"incremental\" mode [using section MODE]\n" \ "--mask[=MASK] mask mode using MASK (or default mask from john.conf)\n" \ "--markov[=OPTIONS] \"Markov\" mode (see doc/MARKOV)\n" \ diff --git a/src/rpp.c b/src/rpp.c index 6643ca3..d0b9740 100644 --- a/src/rpp.c +++ b/src/rpp.c @@ -17,10 +17,34 @@ int rpp_init(struct rpp_context *ctx, char *subsection) struct cfg_list *list; if ((list = cfg_get_list(SECTION_RULES, subsection))) + { if ((ctx->input = list->head)) { ctx->count = -1; return 0; } + } else { + char *p, *buf; + const int sz = sizeof(struct cfg_line); + struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8); + + buf = str_alloc_copy(subsection); + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = buf; + ctx->input = cfg_cur; + p = strstr(buf, "\\n"); + while (p && *p) { + *p = 0; + p += 2; + if (!p[0]) continue; + cfg_cur->next = mem_calloc_tiny(sz, 8); + cfg_cur = cfg_cur->next; + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = p; + p = strstr(p, "\\n"); + } + ctx->count = -1; + return 0; + } return 1; } ```
Author
Owner

@jfoug commented on GitHub (Mar 31, 2016):

@magnumripper do you have any heartburn about me putting this directly into jimbo-bleed ?

I just tested restore, and like I thought, it woks just fine.

$ OMP_NUM_THREADS=1 ../run/john -rules='-[c:] $[1-3] \p1[:c]\n$[0-9]\n$[0-9]$[0-9]\n^[0-9]\n^[0-9]^[0-9]' -w=tst-.dic -pot=tst-.pot -ses=tst- tst-.in
Loaded 1 password hash (restore_tester [None])
pass1            (?)
ssap1            (?)
pass2            (?)
ssap2            (?)
pass3            (?)
...
ssap03           (?)
pass04           (?)
ssap04           (?)
42g 0:00:00:02 9.96% (ETA: 11:13:17) 19.95g/s 19.95p/s 19.95c/s 19.95C/s pass05..pass06
Session aborted

$ cat tst-.rec
REC4
9
--rules=-[c:] $[1-3] \p1[:c]\n$[0-9]\n$[0-9]$[0-9]\n^[0-9]\n^[0-9]^[0-9]
--wordlist=tst-.dic
--pot=tst-.pot
--session=tst-
tst-.in
--format=restore_tester
--input-encoding=ASCII
--target-encoding=ASCII
3
42
2a
0
0
2a
0
2a
0
0
0
9
0
20
0
2

I reran and ended up with a 100% same .pot file as I did on a prior run where I let the program simply run to completion. I also did 4 stop/starts, and same result.

I see no reason to not put this into bleeding, even though it is new logic.

<!-- gh-comment-id:204005245 --> @jfoug commented on GitHub (Mar 31, 2016): @magnumripper do you have any heartburn about me putting this directly into jimbo-bleed ? I just tested restore, and like I thought, it woks just fine. ``` $ OMP_NUM_THREADS=1 ../run/john -rules='-[c:] $[1-3] \p1[:c]\n$[0-9]\n$[0-9]$[0-9]\n^[0-9]\n^[0-9]^[0-9]' -w=tst-.dic -pot=tst-.pot -ses=tst- tst-.in Loaded 1 password hash (restore_tester [None]) pass1 (?) ssap1 (?) pass2 (?) ssap2 (?) pass3 (?) ... ssap03 (?) pass04 (?) ssap04 (?) 42g 0:00:00:02 9.96% (ETA: 11:13:17) 19.95g/s 19.95p/s 19.95c/s 19.95C/s pass05..pass06 Session aborted $ cat tst-.rec REC4 9 --rules=-[c:] $[1-3] \p1[:c]\n$[0-9]\n$[0-9]$[0-9]\n^[0-9]\n^[0-9]^[0-9] --wordlist=tst-.dic --pot=tst-.pot --session=tst- tst-.in --format=restore_tester --input-encoding=ASCII --target-encoding=ASCII 3 42 2a 0 0 2a 0 2a 0 0 0 9 0 20 0 2 ``` I reran and ended up with a 100% same .pot file as I did on a prior run where I let the program simply run to completion. I also did 4 stop/starts, and same result. I see no reason to not put this into bleeding, even though it is new logic.
Author
Owner

@solardiz commented on GitHub (Mar 31, 2016):

I think we should use ';' instead of "\n" as rule separator on the command-line. This character is already somewhat special: it can be used to comment out a john.conf line, just like '#'. And we should communicate to @hashcat that we're starting to use this character as rule separator, in case they want to do the same instead of using it for some new command (it's still unused in hashcat now, right?)

<!-- gh-comment-id:204078292 --> @solardiz commented on GitHub (Mar 31, 2016): I think we should use ';' instead of "\n" as rule separator on the command-line. This character is already somewhat special: it can be used to comment out a john.conf line, just like '#'. And we should communicate to @hashcat that we're starting to use this character as rule separator, in case they want to do the same instead of using it for some new command (it's still unused in hashcat now, right?)
Author
Owner

@jfoug commented on GitHub (Mar 31, 2016):

; does appear to be unused in HC (looking at their wiki). Making the change from \n to ; is trivial , and I can actually use a strtok vs the strstr();*p=0;p+=2; which I am doing with a \n

Hmm, I do see an issue here (and even with \n)

--rule=$[;]

now becomes 2 rule: $[ and ]

I am pretty sure there are things which would also cause \n to split things incorrectly :(

<!-- gh-comment-id:204128869 --> @jfoug commented on GitHub (Mar 31, 2016): `;` does appear to be unused in HC (looking at their wiki). Making the change from \n to ; is trivial , and I can actually use a strtok vs the strstr();*p=0;p+=2; which I am doing with a \n Hmm, I do see an issue here (and even with \n) --rule=$[;] now becomes 2 rule: $[ and ] I am pretty sure there are things which would also cause \n to split things incorrectly :(
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

I believe that the only way a \n can be in a rule, is if it is in a range, or AN"STR" block. But it is less likely than a ';' char being in either of those parts of data.

I really think the \n may be the better way to go. I can do it either way, but if it is a ':', then there will likely have to be more \xHH work arounds for it.

<!-- gh-comment-id:204203205 --> @jfoug commented on GitHub (Apr 1, 2016): I believe that the only way a \n can be in a rule, is if it is in a range, or AN"STR" block. But it is less likely than a ';' char being in either of those parts of data. I really think the \n may be the better way to go. I can do it either way, but if it is a ':', then there will likely have to be more \xHH work arounds for it.
Author
Owner

@frank-dittrich commented on GitHub (Apr 1, 2016):

The rules parser should be able to tell the difference between a ; which is part of a rule definition and a ; which must be a separator.

<!-- gh-comment-id:204290498 --> @frank-dittrich commented on GitHub (Apr 1, 2016): The rules parser should be able to tell the difference between a `;` which is part of a rule definition and a `;` which must be a separator.
Author
Owner

@solardiz commented on GitHub (Apr 1, 2016):

I think we don't want any heuristics like what Frank suggests. Rather, we want something simple and consistent. This means we need another level of escaping. \; is for literal semicolon, \\ is for literal backslash (at this level; in practice, more backslashes will need to be written in a row to pass literal backslashes to deeper layers). This might not be pretty, but it is consistent with approach taken by other command-line tools, such as Unix shell and sed.

<!-- gh-comment-id:204337663 --> @solardiz commented on GitHub (Apr 1, 2016): I think we don't want any heuristics like what Frank suggests. Rather, we want something simple and consistent. This means we need another level of escaping. `\;` is for literal semicolon, `\\` is for literal backslash (at this level; in practice, more backslashes will need to be written in a row to pass literal backslashes to deeper layers). This might not be pretty, but it is consistent with approach taken by other command-line tools, such as Unix shell and sed.
Author
Owner

@solardiz commented on GitHub (Apr 1, 2016):

We also want a more reliable way to specify a section name vs. rule(s) on the command-line. Jim's patch is not robust in that the same command-line will be understood very differently depending on john.conf contents. A valid section name from another system may well end up being misinterpreted as a valid rule on a system lacking the section. Any suggestions on command-line syntax to distinguish section names from rules? Unfortunately, nothing good comes to my mind right now. We could use a new option name, but --rules fits both purposes well. Maybe we'll just accept the non-robustness of Jim's patch, if we fail to come up with anything good.

<!-- gh-comment-id:204340064 --> @solardiz commented on GitHub (Apr 1, 2016): We also want a more reliable way to specify a section name vs. rule(s) on the command-line. Jim's patch is not robust in that the same command-line will be understood very differently depending on john.conf contents. A valid section name from another system may well end up being misinterpreted as a valid rule on a system lacking the section. Any suggestions on command-line syntax to distinguish section names from rules? Unfortunately, nothing good comes to my mind right now. We could use a new option name, but `--rules` fits both purposes well. Maybe we'll just accept the non-robustness of Jim's patch, if we fail to come up with anything good.
Author
Owner

@frank-dittrich commented on GitHub (Apr 1, 2016):

If ; needs to be escaped, I'd rather suggest to keep \n as a rule separator instead.

To distinguish rules from sections, we could require a rule (or list of rules) to be started with a : which gets dropped...

<!-- gh-comment-id:204354290 --> @frank-dittrich commented on GitHub (Apr 1, 2016): If `;` needs to be escaped, I'd rather suggest to keep `\n` as a rule separator instead. To distinguish rules from sections, we could require a rule (or list of rules) to be started with a `:` which gets dropped...
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

We can easily state that a ; char which should be in the rule set needs an escape. The rpp already handles this just fine:

$ echo pass | ../run/john -rules='$[a-c;]' -stdout -pipe
passa
passb
passc
pass;

echo pass | ../run/john -rules='$[a-c\;]' -stdout -pipe
passa
passb
passc
pass;

$ echo pass | ../run/john -rules='$;' -stdout -pipe
pass;

$ echo pass | ../run/john -rules='$\;' -stdout -pipe
pass;

$ echo '\;'
\;

The logic which would split the rules data into multiple rules would NOT be de escaping, so there is no reason to worry about 'multiple levels' of escaping. It will simply search for the next ; char, and use it as a line separator (eating the character also), as long as there is no \ proceeding the ; byte.

The only item left, is a better / smarter way of determining if a user wants a section or has supplied a rule on the command line. We could add something like this:

--rule'=R=$a$b'

what shows up in rpp_init() is R=$a$b and we use the R= as an indication that someone is wanting an inlined rule. I personally like the simplicity of simply having the data processed as an inline rule vs having to remember new syntax, but it is trivial to code either way. Another option is also a choice, but I thought re-use of the existing one would be ideal, as in the solution I have provided, there was almost NO change to any logic at all.

<!-- gh-comment-id:204387310 --> @jfoug commented on GitHub (Apr 1, 2016): We can easily state that a ; char which should be in the rule set needs an escape. The rpp already handles this just fine: ``` $ echo pass | ../run/john -rules='$[a-c;]' -stdout -pipe passa passb passc pass; echo pass | ../run/john -rules='$[a-c\;]' -stdout -pipe passa passb passc pass; $ echo pass | ../run/john -rules='$;' -stdout -pipe pass; $ echo pass | ../run/john -rules='$\;' -stdout -pipe pass; $ echo '\;' \; ``` The logic which would split the rules data into multiple rules would NOT be de escaping, so there is no reason to worry about 'multiple levels' of escaping. It will simply search for the next ; char, and use it as a line separator (eating the character also), as long as there is no \ proceeding the ; byte. The only item left, is a better / smarter way of determining if a user wants a section or has supplied a rule on the command line. We could add something like this: ``` --rule'=R=$a$b' ``` what shows up in rpp_init() is R=$a$b and we use the R= as an indication that someone is wanting an inlined rule. I personally like the simplicity of simply having the data processed as an inline rule vs having to remember new syntax, but it is trivial to code either way. Another option is also a choice, but I thought re-use of the existing one would be ideal, as in the solution I have provided, there was almost NO change to any logic at all.
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

Ok, here is a new 'version'. It uses ; as the line separator. This means that ANY ; used in a rule that should be used as a ; must be escaped (this rule ONLY applies to command line). Also, the command line rules MUST start with the 2 letters R=. This keeps the current logic (as per error messages, etc) working 100% the same. The only stipulation is there could not be a section that starts with R= IF there were a section like that (say R=BIGGER), then simply using the section name of r=BIGGER would allow that section to be used. The R= is just that, case sensitive. NOTE, I do not personally like having the extended syntax for the command arg, but I can live with it. It is MUCH easier to just use the existing plumbing for the --rule switch, than trying to impelement all the other logic needed for another argument.

Here is an example. It shows multi line, there are 3 instances where ';' are used in rules (one showing that ; used twice in a group, still gets reduced to 1 instance), and one of them is the LAST character of the rule. Things work like a champ.

$ cat tst-.in
pass
ssap

$ ../run/john -ru=R='-[c:]$[\;1-3\;]\p1[:c];:;$[4-7];$\;;^[7-3]' -w=tst-.in -stdo
pass;
ssap;
pass1
ssap1
pass2
ssap2
pass3
ssap3
Pass;
Ssap;
Pass1
Ssap1
Pass2
Ssap2
Pass3
Ssap3
pass
ssap
pass4
ssap4
pass5
ssap5
pass6
ssap6
pass7
ssap7
pass;
ssap;
7pass
7ssap
6pass
6ssap
5pass
5ssap
4pass
4ssap
3pass
3ssap
38p 0:00:00:00 100.00% (2016-04-01 11:27) 2111p/s 3ssap
$ git diff rpp.c
diff --git a/src/rpp.c b/src/rpp.c
index 6643ca3..a8120ac 100644
--- a/src/rpp.c
+++ b/src/rpp.c
@@ -16,6 +16,32 @@ int rpp_init(struct rpp_context *ctx, char *subsection)
 {
        struct cfg_list *list;

+       if (!strncmp(subsection, "R=", 2)) {
+               char *p, *buf;
+               const int sz = sizeof(struct cfg_line);
+               struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8);
+
+               buf = str_alloc_copy(subsection+2);
+               cfg_cur->cfg_name = "Command Line Rule";
+               cfg_cur->data = buf;
+               ctx->input = cfg_cur;
+               p = strchr(buf, ';');
+               while (p && p > buf && p[-1] == '\\')
+                       p = strchr(p+1, ';');
+               while (p && *p) {
+                       *p++ = 0;
+                       if (!p[0]) continue;
+                       cfg_cur->next = mem_calloc_tiny(sz, 8);
+                       cfg_cur = cfg_cur->next;
+                       cfg_cur->cfg_name = "Command Line Rule";
+                       cfg_cur->data = p;
+                       p = strchr(p, ';');
+                       while (p && p > buf && p[-1] == '\\')
+                               p = strchr(p+1, ';');
+               }
+               ctx->count = -1;
+               return 0;
+       } else
        if ((list = cfg_get_list(SECTION_RULES, subsection)))
        if ((ctx->input = list->head)) {
                ctx->count = -1;
<!-- gh-comment-id:204460114 --> @jfoug commented on GitHub (Apr 1, 2016): Ok, here is a new 'version'. It uses ; as the line separator. This means that ANY ; used in a rule that should be used as a ; must be escaped (this rule ONLY applies to command line). Also, the command line rules MUST start with the 2 letters R=. This keeps the current logic (as per error messages, etc) working 100% the same. The only stipulation is there could not be a section that starts with R= IF there were a section like that (say R=BIGGER), then simply using the section name of r=BIGGER would allow that section to be used. The R= is just that, case sensitive. NOTE, I do not personally like having the extended syntax for the command arg, but I can live with it. It is MUCH easier to just use the existing plumbing for the --rule switch, than trying to impelement all the other logic needed for another argument. Here is an example. It shows multi line, there are 3 instances where ';' are used in rules (one showing that \; used twice in a group, still gets reduced to 1 instance), and one of them is the LAST character of the rule. Things work like a champ. ``` $ cat tst-.in pass ssap $ ../run/john -ru=R='-[c:]$[\;1-3\;]\p1[:c];:;$[4-7];$\;;^[7-3]' -w=tst-.in -stdo pass; ssap; pass1 ssap1 pass2 ssap2 pass3 ssap3 Pass; Ssap; Pass1 Ssap1 Pass2 Ssap2 Pass3 Ssap3 pass ssap pass4 ssap4 pass5 ssap5 pass6 ssap6 pass7 ssap7 pass; ssap; 7pass 7ssap 6pass 6ssap 5pass 5ssap 4pass 4ssap 3pass 3ssap 38p 0:00:00:00 100.00% (2016-04-01 11:27) 2111p/s 3ssap ``` ``` diff $ git diff rpp.c diff --git a/src/rpp.c b/src/rpp.c index 6643ca3..a8120ac 100644 --- a/src/rpp.c +++ b/src/rpp.c @@ -16,6 +16,32 @@ int rpp_init(struct rpp_context *ctx, char *subsection) { struct cfg_list *list; + if (!strncmp(subsection, "R=", 2)) { + char *p, *buf; + const int sz = sizeof(struct cfg_line); + struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8); + + buf = str_alloc_copy(subsection+2); + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = buf; + ctx->input = cfg_cur; + p = strchr(buf, ';'); + while (p && p > buf && p[-1] == '\\') + p = strchr(p+1, ';'); + while (p && *p) { + *p++ = 0; + if (!p[0]) continue; + cfg_cur->next = mem_calloc_tiny(sz, 8); + cfg_cur = cfg_cur->next; + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = p; + p = strchr(p, ';'); + while (p && p > buf && p[-1] == '\\') + p = strchr(p+1, ';'); + } + ctx->count = -1; + return 0; + } else if ((list = cfg_get_list(SECTION_RULES, subsection))) if ((ctx->input = list->head)) { ctx->count = -1; ```
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

This is the entire patch as it stands against the current jumbo.

$ git diff ../doc/OPTIONS options.c rpp.c
diff --git a/doc/OPTIONS b/doc/OPTIONS
index 511f801..6e3f418 100644
--- a/doc/OPTIONS
+++ b/doc/OPTIONS
@@ -59,10 +59,21 @@ attacked. Note that by default, some rules are applied too (see john.conf
 Input data in a character encoding other than the default 'raw'. See also
 doc/ENCODINGS.   --list=encodings gives a list of all handled encodings.

---rules[=SECTION]              enable word mangling rules for wordlist mode
+--rules[=(SECTION|:rule)]              enable word mangling rules for wordlist mode

 Enables word mangling rules that are read from the specified section, which
 defaults to [List.Rules:Wordlist] if not given.
+Note, a rule, or set of rules can also be provided ON the command line. To do
+so, first letter following the = must be : then the rest of the command argument
+is interpreted as the literal data for the rule(s) itself.  Multiple rules can
+be provided. Each rule should be separated with a semicolon (;) character.
+So --rules=:'$[a-z]$[0-9];u' will use the 2 rule lines:  $[a-z]$[0-9]  and u
+When rules are entered on the command line, any time a semicolon is used IN
+a rule, then it must be proceeded by a \ character, to escape it.
+So --rules::'$\;$[0-9]' is just one rule, while --rules=:'$\;$[0-9];Az"tst"'
+is two rules, and --rules=:'$;$[0-9]' would 'try' to generate 2 rules, BUT
+the first will be invalid, and not be usable, since it is just the $
+character.

 --incremental[=MODE]           "incremental" mode [using section MODE]

diff --git a/src/options.c b/src/options.c
index fc20cd2..078a79c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = {
 PRINCE_USAGE \
 "--encoding=NAME           input encoding (eg. UTF-8, ISO-8859-1). See also\n" \
 "                          doc/ENCODING and --list=hidden-options.\n" \
-"--rules[=SECTION]         enable word mangling rules for wordlist or PRINCE\n" \
+"--rules[=(SECTION|:rule)] enable word mangling rules for wordlist or PRINCE\n" \
 "--incremental[=MODE]      \"incremental\" mode [using section MODE]\n" \
 "--mask[=MASK]             mask mode using MASK (or default mask from john.conf)\n" \
 "--markov[=OPTIONS]        \"Markov\" mode (see doc/MARKOV)\n" \
diff --git a/src/rpp.c b/src/rpp.c
index 6643ca3..830f51f 100644
--- a/src/rpp.c
+++ b/src/rpp.c
@@ -16,6 +16,32 @@ int rpp_init(struct rpp_context *ctx, char *subsection)
 {
        struct cfg_list *list;

+       if (*subsection == ':') {
+               char *p, *buf;
+               const int sz = sizeof(struct cfg_line);
+               struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8);
+
+               buf = str_alloc_copy(subsection+1);
+               cfg_cur->cfg_name = "Command Line Rule";
+               cfg_cur->data = buf;
+               ctx->input = cfg_cur;
+               p = strchr(buf, ';');
+               while (p && p > buf && p[-1] == '\\')
+                       p = strchr(p+1, ';');
+               while (p && *p) {
+                       *p++ = 0;
+                       if (!p[0]) continue;
+                       cfg_cur->next = mem_calloc_tiny(sz, 8);
+                       cfg_cur = cfg_cur->next;
+                       cfg_cur->cfg_name = "Command Line Rule";
+                       cfg_cur->data = p;
+                       p = strchr(p, ';');
+                       while (p && p > buf && p[-1] == '\\')
+                               p = strchr(p+1, ';');
+               }
+               ctx->count = -1;
+               return 0;
+       } else
        if ((list = cfg_get_list(SECTION_RULES, subsection)))
        if ((ctx->input = list->head)) {
                ctx->count = -1;

<!-- gh-comment-id:204467057 --> @jfoug commented on GitHub (Apr 1, 2016): This is the entire patch as it stands against the current jumbo. ``` diff $ git diff ../doc/OPTIONS options.c rpp.c diff --git a/doc/OPTIONS b/doc/OPTIONS index 511f801..6e3f418 100644 --- a/doc/OPTIONS +++ b/doc/OPTIONS @@ -59,10 +59,21 @@ attacked. Note that by default, some rules are applied too (see john.conf Input data in a character encoding other than the default 'raw'. See also doc/ENCODINGS. --list=encodings gives a list of all handled encodings. ---rules[=SECTION] enable word mangling rules for wordlist mode +--rules[=(SECTION|:rule)] enable word mangling rules for wordlist mode Enables word mangling rules that are read from the specified section, which defaults to [List.Rules:Wordlist] if not given. +Note, a rule, or set of rules can also be provided ON the command line. To do +so, first letter following the = must be : then the rest of the command argument +is interpreted as the literal data for the rule(s) itself. Multiple rules can +be provided. Each rule should be separated with a semicolon (;) character. +So --rules=:'$[a-z]$[0-9];u' will use the 2 rule lines: $[a-z]$[0-9] and u +When rules are entered on the command line, any time a semicolon is used IN +a rule, then it must be proceeded by a \ character, to escape it. +So --rules::'$\;$[0-9]' is just one rule, while --rules=:'$\;$[0-9];Az"tst"' +is two rules, and --rules=:'$;$[0-9]' would 'try' to generate 2 rules, BUT +the first will be invalid, and not be usable, since it is just the $ +character. --incremental[=MODE] "incremental" mode [using section MODE] diff --git a/src/options.c b/src/options.c index fc20cd2..078a79c 100644 --- a/src/options.c +++ b/src/options.c @@ -305,7 +305,7 @@ static struct opt_entry opt_list[] = { PRINCE_USAGE \ "--encoding=NAME input encoding (eg. UTF-8, ISO-8859-1). See also\n" \ " doc/ENCODING and --list=hidden-options.\n" \ -"--rules[=SECTION] enable word mangling rules for wordlist or PRINCE\n" \ +"--rules[=(SECTION|:rule)] enable word mangling rules for wordlist or PRINCE\n" \ "--incremental[=MODE] \"incremental\" mode [using section MODE]\n" \ "--mask[=MASK] mask mode using MASK (or default mask from john.conf)\n" \ "--markov[=OPTIONS] \"Markov\" mode (see doc/MARKOV)\n" \ diff --git a/src/rpp.c b/src/rpp.c index 6643ca3..830f51f 100644 --- a/src/rpp.c +++ b/src/rpp.c @@ -16,6 +16,32 @@ int rpp_init(struct rpp_context *ctx, char *subsection) { struct cfg_list *list; + if (*subsection == ':') { + char *p, *buf; + const int sz = sizeof(struct cfg_line); + struct cfg_line *cfg_cur = mem_calloc_tiny(sz, 8); + + buf = str_alloc_copy(subsection+1); + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = buf; + ctx->input = cfg_cur; + p = strchr(buf, ';'); + while (p && p > buf && p[-1] == '\\') + p = strchr(p+1, ';'); + while (p && *p) { + *p++ = 0; + if (!p[0]) continue; + cfg_cur->next = mem_calloc_tiny(sz, 8); + cfg_cur = cfg_cur->next; + cfg_cur->cfg_name = "Command Line Rule"; + cfg_cur->data = p; + p = strchr(p, ';'); + while (p && p > buf && p[-1] == '\\') + p = strchr(p+1, ';'); + } + ctx->count = -1; + return 0; + } else if ((list = cfg_get_list(SECTION_RULES, subsection))) if ((ctx->input = list->head)) { ctx->count = -1; ```
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

Note, the code as it stands even handles this properly (i.e. 'null' rule). I had not tested this before now, and was worried that there would be some problem (I will ASAN test it also just to be sure).

$ ../run/john --rules=R= -w=tst-.in -stdo
pass
ssap
2p 0:00:00:00 100.00% (2016-04-01 11:47) 111.1p/s ssap

edit: ASAN run had no problems with this either.

<!-- gh-comment-id:204467733 --> @jfoug commented on GitHub (Apr 1, 2016): Note, the code as it stands even handles this properly (i.e. 'null' rule). I had not tested this before now, and was worried that there would be some problem (I will ASAN test it also just to be sure). ``` $ ../run/john --rules=R= -w=tst-.in -stdo pass ssap 2p 0:00:00:00 100.00% (2016-04-01 11:47) 111.1p/s ssap ``` edit: ASAN run had no problems with this either.
Author
Owner

@solardiz commented on GitHub (Apr 1, 2016):

I like Jim's idea to reuse rpp's escaping without introducing a new level of escaping.

I also like Frank's idea to require the command-line rule(s) list to start with :. I think this is better than R=. BTW, since we support not only =, but also : as separator between option name and parameter, it will be valid to use e.g. -ru::c (requesting the rule c) or -ru::;c (requesting the no-op rule and rule c). These are hackish, but are quick to type. And the non-hackish syntax will be the full --rules=:c, etc.

<!-- gh-comment-id:204483285 --> @solardiz commented on GitHub (Apr 1, 2016): I like Jim's idea to reuse rpp's escaping without introducing a new level of escaping. I also like Frank's idea to require the command-line rule(s) list to start with `:`. I think this is better than `R=`. BTW, since we support not only `=`, but also `:` as separator between option name and parameter, it will be valid to use e.g. `-ru::c` (requesting the rule `c`) or `-ru::;c` (requesting the no-op rule and rule `c`). These are hackish, but are quick to type. And the non-hackish syntax will be the full `--rules=:c`, etc.
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

I can do this with a ':' leading. That can NOT be the first char of a section name (I think). I had to test to make sure it was valid within command line parsing (it is)l

$ ../run/john '--rules::$a' -w=tst-.in -stdo
No ":$a" mode rules found in ../run/john.conf

NOTE, that was before any change, so my code is still looking for R=, so the :$a was used as a section name, and shows that the ':' char was properly put through.

I will change my code to handle a leading : char, and it will be removed. It is ONLY used to state the user IS providing inline rules.

Pretty easy.

$ ../run/john '--rules::;$a' -w=tst-.in -stdo
pass
ssap
passa
ssapa
4p 0:00:00:00 100.00% (2016-04-01 12:49) 210.5p/s ssapa

This is null rule, followed by $a. Works as expected. Same thing would have been ../run/john '--rules:::;$a' -w=tst-.in -stdo that does the same thing but now instead of a null rule, we have : which I think becomes the null rule.

I have updated the patch above with the changed R= now being :

I like Jim's idea to reuse rpp's escaping without introducing a new level of escaping.

I want to keep the line splitting logic as brain dead as possible. I certainly do not want it to process or validate rules, looking for separators. The : and skipping that is all that is needed, and rpp is only too happy to undo that escape for us, with no penalty.

<!-- gh-comment-id:204485147 --> @jfoug commented on GitHub (Apr 1, 2016): I can do this with a ':' leading. That can NOT be the first char of a section name (I think). I had to test to make sure it was valid within command line parsing (it is)l ``` $ ../run/john '--rules::$a' -w=tst-.in -stdo No ":$a" mode rules found in ../run/john.conf ``` NOTE, that was before any change, so my code is still looking for R=, so the :$a was used as a section name, and shows that the ':' char was properly put through. I will change my code to handle a leading : char, and it will be removed. It is ONLY used to state the user IS providing inline rules. Pretty easy. ``` $ ../run/john '--rules::;$a' -w=tst-.in -stdo pass ssap passa ssapa 4p 0:00:00:00 100.00% (2016-04-01 12:49) 210.5p/s ssapa ``` This is null rule, followed by $a. Works as expected. Same thing would have been `../run/john '--rules:::;$a' -w=tst-.in -stdo` that does the same thing but now instead of a null rule, we have : which I think becomes the null rule. I have updated the patch above with the changed R= now being : > I like Jim's idea to reuse rpp's escaping without introducing a new level of escaping. I want to keep the line splitting logic as brain dead as possible. I certainly do not want it to process or validate rules, looking for separators. The : and skipping that is all that is needed, and rpp is only too happy to undo that escape for us, with no penalty.
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

Is everyone happy with the new changes?

I think all stated issues are addressed, and I agree that all in all, it is better syntax, and certainly much better than blindly treating any rule where there was a section search failure as an inline rule.

<!-- gh-comment-id:204495309 --> @jfoug commented on GitHub (Apr 1, 2016): Is everyone happy with the new changes? I think all stated issues are addressed, and I agree that all in all, it is better syntax, and certainly much better than blindly treating any rule where there was a section search failure as an inline rule.
Author
Owner

@solardiz commented on GitHub (Apr 1, 2016):

Jim, your changes look good to me, to the extent jumbo can look good. As usual, there's a spelling error: "proceeded" should be replaced with "preceded". ;-) Thanks!

<!-- gh-comment-id:204611980 --> @solardiz commented on GitHub (Apr 1, 2016): Jim, your changes look good to me, to the extent jumbo can look good. As usual, there's a spelling error: "proceeded" should be replaced with "preceded". ;-) Thanks!
Author
Owner

@jfoug commented on GitHub (Apr 1, 2016):

but it wouldn't be my code without speeling errers, lol. Just my little easter eggs.

<!-- gh-comment-id:204612290 --> @jfoug commented on GitHub (Apr 1, 2016): but it wouldn't be my code without speeling errers, lol. Just my little easter eggs.
Author
Owner

@frank-dittrich commented on GitHub (Apr 2, 2016):

Did anybody contact hashcat, to ask about their opinion/possible concerns?

<!-- gh-comment-id:204683823 --> @frank-dittrich commented on GitHub (Apr 2, 2016): Did anybody contact hashcat, to ask about their opinion/possible concerns?
Author
Owner

@magnumripper commented on GitHub (Apr 2, 2016):

Obviously as long as Solar is fine with this, I am too. Hit it!

to the extent jumbo can look good

😆

<!-- gh-comment-id:204685580 --> @magnumripper commented on GitHub (Apr 2, 2016): Obviously as long as Solar is fine with this, I am too. Hit it! > to the extent jumbo can look good 😆
Author
Owner

@frank-dittrich commented on GitHub (Apr 2, 2016):

I was just looking into extending bash completion support, and then I noticed that we might want to extend the --single logic as well.

<!-- gh-comment-id:204688179 --> @frank-dittrich commented on GitHub (Apr 2, 2016): I was just looking into extending bash completion support, and then I noticed that we might want to extend the --single logic as well.
Author
Owner

@magnumripper commented on GitHub (Jun 29, 2016):

Wow, I forgot this was committed. Good stuff!

$ echo maGnum | ../run/john -pipe -stdout -rules=:[ucl]
MAGNUM
Magnum
magnum
3p 0:00:00:00 0.00% 300.0p/s magnum
<!-- gh-comment-id:229221099 --> @magnumripper commented on GitHub (Jun 29, 2016): Wow, I forgot this was committed. Good stuff! ``` $ echo maGnum | ../run/john -pipe -stdout -rules=:[ucl] MAGNUM Magnum magnum 3p 0:00:00:00 0.00% 300.0p/s magnum ```
Author
Owner

@magnumripper commented on GitHub (Jun 29, 2016):

I was just looking into extending bash completion support, and then I noticed that we might want to extend the --single logic as well.

It works fine. Perhaps just tweak the usage blurb and the docs.

$ echo 'magnum:$0$mag123num:::Mag Num' > test.in
$ ../run/john test.in -single=:1Az.123.2+l
Loaded 1 password hash (plaintext, $0$ [n/a])
Press 'q' or Ctrl-C to abort, almost any other key for status
mag123num        (magnum)
1g 0:00:00:00 DONE (2016-06-29 02:13) 100.0g/s 800.0p/s 800.0c/s 800.0C/s magnum123mag..num123magnum
<!-- gh-comment-id:229221923 --> @magnumripper commented on GitHub (Jun 29, 2016): > I was just looking into extending bash completion support, and then I noticed that we might want to extend the --single logic as well. It works fine. Perhaps just tweak the usage blurb and the docs. ``` $ echo 'magnum:$0$mag123num:::Mag Num' > test.in $ ../run/john test.in -single=:1Az.123.2+l Loaded 1 password hash (plaintext, $0$ [n/a]) Press 'q' or Ctrl-C to abort, almost any other key for status mag123num (magnum) 1g 0:00:00:00 DONE (2016-06-29 02:13) 100.0g/s 800.0p/s 800.0c/s 800.0C/s magnum123mag..num123magnum ```
Author
Owner

@jfoug commented on GitHub (Jun 29, 2016):

Wow, I forgot this was committed. Good stuff!

I use this functionality all the time. When the idea hit me that morning in the shower, I simply could not believe that we had not added it a LONG time ago.

i had no idea about --single, BUT since it really is a 'special' alias for --rules that in the end, when it gets down to computing which rule section to use, that it simply works. Yes, good stuff.

<!-- gh-comment-id:229393442 --> @jfoug commented on GitHub (Jun 29, 2016): > Wow, I forgot this was committed. Good stuff! I use this functionality all the time. When the idea hit me that morning in the shower, I simply could not believe that we had not added it a LONG time ago. i had no idea about --single, BUT since it really is a 'special' alias for --rules that in the end, when it gets down to computing which rule section to use, that it simply works. Yes, good stuff.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1408
No description provided.