openwall / openwall/john

multiple ?w behavior in hybrid mask mode

Open
#4,076 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement new cracking mode
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Currently if you use more than one ?w in a mask the same word is repeated.

Wordlist = (One, Two, Three)

mask=?w?w?w

will yield

OneOneOne
TwoTwoTwo
ThreeThreeThree

I would have expected it to yield

OneOneOne
OneOneTwo
OneOneThree
OneTwoOne
...
ThreeThreeTwo
ThreeThreeThree

While outside scripts (example: https://github.com/LordDarkHelmet/WordListHelperScripts) can be used to create permutations for users who have used a combination of multiple words in random order, it is an issue for users who use multiple words where the words are not next to each other.

--mask=?w?d?d?d?d?w

It could be a nice feature to allow several different word lists in a single mask. This will keep the existing functionality of multiple ?w and allow for greater control.

For example ?{w1} references word list 1 and ?{w2} references word list 2, ... ?{wN} references word list N

--wordlist1=wordlist1.lst
--wordlist2=wordlist2.lst
--wordlist3=wordlist3.lst
--mask=?{w1}?{w2}?{w3}

In the above case the user has a word list for each "slot". wordlsit1 could contain names of people, wordlist2 could contain names of pets, wordlist3 could contain street names.

--wordlist1=wordlist1.lst
--wordlist2=wordlist1.lst
--wordlist3=wordlist1.lst
--mask=?{w1}?{w2}?{w3}

In the above case the user will get every combination off of a single list because each of the ?{wN}'s are assigned to the same word list (wordlist1.lst), but iterating independently.

It would also allow for

--mask=?{w1}?d?d?d?d?{w2}

where the first word is different from the second word.

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.

Research direction

Start by locating the mask and wordlist handling code in John the Ripper; the issue does not name specific files or tests. Define completion as independently iterating multiple word-list slots, while preserving existing repeated ?w behavior, and verify the documented ?{w1}, ?{w2}, and mixed mask examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.