[GH-ISSUE #497] Add new single-wordlist cracking mode #201

Closed
opened 2026-10-14 02:56:06 +07:00 by bsakaguchi · 14 comments
Owner

Originally created by @magnumripper on GitHub (Jan 31, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/497

Originally assigned to: @magnumripper on GitHub.

Currently we have these two ways (among others) of producing candidates:

  • Single mode will use 'user info' but not a wordlist
  • Wordlist mode will use a wordlist but the 'user info' is unavailable

Combine that! Add a Single mode that takes a wordlist file, and add rules (or variables?) for the current user name (and gecos info etc). So if we have this hash:

root:<hash>:0:0:Super User::

Combining the word 'pass' from a wordlist with the user info, rules could construct password candidates like rootpass, passSuper, SuperUserpass and so on. I believe this would prove very powerful.

Originally created by @magnumripper on GitHub (Jan 31, 2014). Original GitHub issue: https://github.com/openwall/john/issues/497 Originally assigned to: @magnumripper on GitHub. Currently we have these two ways (among others) of producing candidates: - Single mode will use 'user info' but not a wordlist - Wordlist mode will use a wordlist but the 'user info' is unavailable Combine that! Add a Single mode that takes a wordlist file, and add rules (or variables?) for the current user name (and gecos info etc). So if we have this hash: ``` root:<hash>:0:0:Super User:: ``` Combining the word 'pass' from a wordlist with the user info, rules could construct password candidates like rootpass, passSuper, SuperUserpass and so on. I believe this would prove very powerful.
bsakaguchi 2026-10-14 02:56:06 +07:00
Author
Owner

@magnumripper commented on GitHub (Dec 12, 2016):

Like I just mentioned in a commit comment, I'm on to this (will be --single-wordlist=FILE). I have some ideas for how to do it KISS, with very little code added (and I will enhance --single-seed=WORD at the same time so it allocates the word(s) just once - that's quite some difference with a 100 million users).

I picture things like --single-wordlist=car_brands.lst and things like that (always fairly short wordlists of course) will be very effective. It will produce things like "beemer_bob" and "JohnnyDMC-12". Then change car_brands.lst to soccer_teams.lst or whatever. The sky's the limit!

<!-- gh-comment-id:266557155 --> @magnumripper commented on GitHub (Dec 12, 2016): Like I just mentioned in a commit comment, I'm on to this (will be `--single-wordlist=FILE`). I have some ideas for how to do it KISS, with very little code added (and I will enhance `--single-seed=WORD` at the same time so it allocates the word(s) just once - that's quite some difference with a 100 million users). I picture things like `--single-wordlist=car_brands.lst` and things like that (always fairly short wordlists of course) will be very effective. It will produce things like "beemer_bob" and "JohnnyDMC-12". Then change car_brands.lst to soccer_teams.lst or whatever. The sky's the limit!
Author
Owner

@magnumripper commented on GitHub (Dec 12, 2016):

Note to self: No word pairs should ever be created with two seed words - at least one of them must come from login or GECOS field. This is not currently the case with --single-seed but it will be using same code and I think I know how to code this.

<!-- gh-comment-id:266560667 --> @magnumripper commented on GitHub (Dec 12, 2016): Note to self: No word pairs should ever be created with two seed words - at least one of them must come from login or GECOS field. This is not currently the case with `--single-seed` but it will be using same code and I think I know how to code this.
Author
Owner

@magnumripper commented on GitHub (Dec 12, 2016):

Dropped the "non-trivial" label. It is trivial, it just took me 2.5 years to figure it out OK, looking at the mail archives, It actually took 6.5 years 😆

<!-- gh-comment-id:266560912 --> @magnumripper commented on GitHub (Dec 12, 2016): Dropped the "non-trivial" label. It **is** trivial, it just took me ~~2.5 years to figure it out~~ OK, looking at the mail archives, It actually took 6.5 years 😆
Author
Owner

@magnumripper commented on GitHub (Dec 12, 2016):

A less important decision is whether --single-wordlist and/or --single-seed should imply --single so you don't need to write that too. Current --single-seed does not imply it so you need to write --single --single-seed=...

<!-- gh-comment-id:266561640 --> @magnumripper commented on GitHub (Dec 12, 2016): A less important decision is whether `--single-wordlist` and/or `--single-seed` should imply `--single` so you don't need to write that too. Current `--single-seed` does not imply it so you need to write `--single --single-seed=...`
Author
Owner

@ghost commented on GitHub (Dec 12, 2016):

+1 to imply.

<!-- gh-comment-id:266571511 --> @ghost commented on GitHub (Dec 12, 2016): +1 to imply.
Author
Owner

@magnumripper commented on GitHub (Dec 12, 2016):

Another note to self: Single mode will create some word pairs for eg. "Joe Random Luser" of initials, eg. "JRandom" and "JoeL". This should never happen to a seed word. It should only be used in full. Creating "JoeC" from "Chelsea" makes no sense in this context, as opposed to eg. "JChelsea".

<!-- gh-comment-id:266576944 --> @magnumripper commented on GitHub (Dec 12, 2016): Another note to self: Single mode will create some word pairs for eg. "Joe Random Luser" of initials, eg. "JRandom" and "JoeL". This should never happen to a seed word. It should only be used in full. Creating "JoeC" from "Chelsea" makes no sense in this context, as opposed to eg. "JChelsea".
Author
Owner

@jfoug commented on GitHub (Dec 13, 2016):

Single mode is SO powerful, but improving it in this manner makes it MUCH more powerful yet. The single mode 'is' showing a bit of age, and this gets it back up to cutting edge. I really think single mode (if there is GECOS data) is by far the most powerful and fast mode out there. For HUGE and slow cracking (like AM was prior to the legacy crypt bug found), single was pretty much the ONLY way to attack that data. I ran just single mode, and had cracked over a million candidates (I back-filled with 12345 and 123456 when the crack was not 'full'). That mode really handled terribly slow monster dumps well. But having seeds of ashley and madison (or sex, xxx, etc) would really improve AM. Also, this would add a very useful help when a web site is dumped. Many users do things like netflix-password for their netflix account, etc. Providing ability to easily inject knowledge to things like known website dumps will crack a very good amount of extra hashes.

<!-- gh-comment-id:266617487 --> @jfoug commented on GitHub (Dec 13, 2016): Single mode is SO powerful, but improving it in this manner makes it MUCH more powerful yet. The single mode 'is' showing a bit of age, and this gets it back up to cutting edge. I really think single mode (if there is GECOS data) is by far the most powerful and fast mode out there. For HUGE and slow cracking (like AM was prior to the legacy crypt bug found), single was pretty much the ONLY way to attack that data. I ran just single mode, and had cracked over a million candidates (I back-filled with 12345 and 123456 when the crack was not 'full'). That mode really handled terribly slow monster dumps well. But having seeds of ashley and madison (or sex, xxx, etc) would really improve AM. Also, this would add a very useful help when a web site is dumped. Many users do things like netflix-password for their netflix account, etc. Providing ability to easily inject knowledge to things like known website dumps will crack a very good amount of extra hashes.
Author
Owner

@jfoug commented on GitHub (Dec 13, 2016):

Can we simply enhance the --single option, vs making 3 of them??

<!-- gh-comment-id:266617587 --> @jfoug commented on GitHub (Dec 13, 2016): Can we simply enhance the --single option, vs making 3 of them??
Author
Owner

@magnumripper commented on GitHub (Dec 13, 2016):

Ideally it should've been --single --rules=RULES instead of --single=RULES and then we could have added options. I don't like overloading options like was done to Markov.

<!-- gh-comment-id:266678464 --> @magnumripper commented on GitHub (Dec 13, 2016): Ideally it should've been `--single --rules=RULES` instead of `--single=RULES` and then we could have added options. I don't like overloading options like was done to Markov.
Author
Owner

@jfoug commented on GitHub (Dec 13, 2016):

It IS --single=RULES (I think). OH, I see, --single without the =rules.

Ok, why can this not be handled?

--single[=TYPE][:TYPE][:TYPE][:.....]

Then TYPE would be any of these:

RULE | -wordlist=FILE | -seed=WORD

That way, original default behavior is maintained --single[=RULE (default --single still meaning --single=single )] BUT we can now add multiple seed words, and or multiple rules (an enhancement in of itself) and or multiple wordlist files, just all in 1 option. The only shortcoming I see, is how to have a seed word with a ':' char, BUT that could be worked around by having that word in a -wordlist=FILE file.

I don't like overloading options like was done to Markov

But is that any worse than overloading the command line options to keep them 'small', but totally interdependent upon each other? I think that is less user friendly ITRW. Single mode is a very powerful, and nuanced option (just like Markov). Having 'easy' default stuff makes it very usable for the masses, but making the option able to provide all (or almost all) required options that squeezes the most out of it makes it very usable by experienced jtr hackers, who really want to push it to the limit.

<!-- gh-comment-id:266734605 --> @jfoug commented on GitHub (Dec 13, 2016): It IS --single=RULES (I think). OH, I see, --single without the =rules. Ok, why can this not be handled? ```--single[=TYPE][:TYPE][:TYPE][:.....] ``` Then TYPE would be any of these: ``` RULE | -wordlist=FILE | -seed=WORD ``` That way, original default behavior is maintained ```--single[=RULE (default --single still meaning --single=single )]``` BUT we can now add multiple seed words, and or multiple rules (an enhancement in of itself) and or multiple wordlist files, just all in 1 option. The only shortcoming I see, is how to have a seed word with a ':' char, BUT that could be worked around by having that word in a -wordlist=FILE file. > I don't like overloading options like was done to Markov But is that any worse than overloading the command line options to keep them 'small', but totally interdependent upon each other? I think that is less user friendly ITRW. Single mode is a very powerful, and nuanced option (just like Markov). Having 'easy' default stuff makes it very usable for the masses, but making the option able to provide all (or almost all) required options that squeezes the most out of it makes it very usable by experienced jtr hackers, who really want to push it to the limit.
Author
Owner

@ghost commented on GitHub (Dec 13, 2016):

I like "--single=RULES" (but this is personal). Since JtR already has it, Jim's "one option" is a choice:

RULE | -wordlist=FILE | -seed=WORD

Maybe awkward (?!). I'm afraid I don't like its "muchness".

--single=-seed=brand
--single=-wordlist=family_names.txt
--single=-wordlist=car_brands.lst --rules=jumbo #If I want both.
<!-- gh-comment-id:266750456 --> @ghost commented on GitHub (Dec 13, 2016): I like "--single=RULES" (but this is personal). Since JtR already has it, Jim's "one option" is a choice: ``` RULE | -wordlist=FILE | -seed=WORD ``` Maybe awkward (?!). I'm afraid I don't like its "muchness". ``` --single=-seed=brand --single=-wordlist=family_names.txt --single=-wordlist=car_brands.lst --rules=jumbo #If I want both. ```
Author
Owner

@jfoug commented on GitHub (Dec 13, 2016):

Maybe awkward (?!). I'm afraid I don't like its "muchness".

I came up with it off the cuff. If you have better ideas, toss them out. I also think what I have is awkward, but usable.

--single=-wordlist=car_brands.lst --rules=jumbo #If I want both.

Could also do both like this:

--single=jumbo:-wordlist=car_brands.lst
or
--single=-wordlist=car_brands.lst:jumbo

The colon : is the option separator. If an option starts with -wordlist= then it is a wordlist. If it starts with -seed= then it is a seed word. If it starts with neither, then it is a rule name.

<!-- gh-comment-id:266789876 --> @jfoug commented on GitHub (Dec 13, 2016): > Maybe awkward (?!). I'm afraid I don't like its "muchness". I came up with it off the cuff. If you have better ideas, toss them out. I also think what I have is awkward, but usable. > --single=-wordlist=car_brands.lst --rules=jumbo #If I want both. Could also do both like this: ``` --single=jumbo:-wordlist=car_brands.lst or --single=-wordlist=car_brands.lst:jumbo ``` The colon : is the option separator. If an option starts with -wordlist= then it is a wordlist. If it starts with -seed= then it is a seed word. If it starts with neither, then it is a rule name.
Author
Owner

@magnumripper commented on GitHub (Dec 13, 2016):

You are kidding, right!? I really hate what we did to --markov and now you are proposing the same crap again 😆
How would anyone remember that oddball syntax? How would we tell getopt how to check syntax? How would we implement bash completion for it?

I'm done adding the functionality and right now it's separate options --single-seed and --single-wordlist. Personally I see absolutely no need for making it harder than that. Try it out instead, it rocks.

<!-- gh-comment-id:266826256 --> @magnumripper commented on GitHub (Dec 13, 2016): You are kidding, right!? I really hate what we did to --markov and now you are proposing the same crap again 😆 How would anyone remember that oddball syntax? How would we tell getopt how to check syntax? How would we implement bash completion for it? I'm done adding the functionality and right now it's separate options `--single-seed` and `--single-wordlist`. Personally I see absolutely no need for making it harder than that. Try it out instead, it rocks.
Author
Owner

@magnumripper commented on GitHub (Dec 13, 2016):

A less important decision is whether --single-wordlist and/or --single-seed should imply --single so you don't need to write that too.

+1 to imply.

Haven't tried it yet and I'm not sure I will bother. There's some caveats with option flags and stuff... I think I'll just leave it as-is.

<!-- gh-comment-id:266826902 --> @magnumripper commented on GitHub (Dec 13, 2016): >> A less important decision is whether --single-wordlist and/or --single-seed should imply --single so you don't need to write that too. > > +1 to imply. Haven't tried it yet and I'm not sure I will bother. There's some caveats with option flags and stuff... I think I'll just leave it as-is.
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#201
No description provided.