Recover passwords with feasible dictionary, rule and mask attacks
Needs: Correct format/mode, complete salt/context, justified candidates and an available offline tool/backend
Shell commands
# Baseline
hashcat -b -m MODE
python3 -c "print((CHARSET_SIZE ** LENGTH) / GUESSES_PER_SECOND)"
Prefer candidates in this order
# Prefer candidates in this order
exact recovered/default candidates -> organization/user/product words
-> observed policy and mutations -> small dictionary plus rules
-> known mask/hybrid -> broader curated lists/rules
-> exhaustive search only when its measured cost is defensible
Preview mutations before spending the candidate budget
# Preview mutations before spending the candidate budget
hashcat -r /usr/share/hashcat/rules/best64.rule --stdout wordlist.txt | head -n 50
john --wordlist=wordlist.txt --rules=Jumbo --stdout | head -n 50
# Baseline
hashcat -a 0 -m MODE hashes.txt wordlist.txt -r /usr/share/hashcat/rules/best64.rule --session job
hashcat -m MODE hashes.txt --show
# Baseline
hashcat -h | grep -Ei 'NTLM|NetNTLMv2|KeePass|OpenSSH'
# Mask and session variants
hashcat -m MODE hashes.txt -a 3 '?u?l?l?l?l?d?d?d' --session targeted-mask
hashcat --session targeted-mask --restore
# Hybrid variant — base word plus three digits
hashcat -a 6 -m MODE hashes.txt wordlist.txt '?d?d?d' --session targeted-hybrid
Mask order is a hypothesis about structure. Estimate its keyspace before committing time.
Hybrid variant — base word plus three digits
Use only when evidence supports both the base words and suffix shape.
# Hybrid variant — base word plus three digits
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
john --show hash.txt
# Hybrid variant — base word plus three digits
john --format=FORMAT --wordlist=wordlist.txt --rules=Jumbo hash.txt
john --session=crack-job --wordlist=wordlist.txt hash.txt
john --restore=crack-job
# File-to-hash converters
zip2john archive.zip > archive.hash
7z2john archive.7z > archive.hash
ssh2john id_rsa > ssh.hash
keepass2john vault.kdbx > keepass.hash
pdf2john document.pdf > pdf.hash
office2john document.docx > office.hash
rar2john archive.rar > rar.hash
unshadow passwd.copy shadow.copy > linux.hash
# Converter availability varies by package/path; locate it rather than assuming
command -v ssh2john || find /usr/share/john -maxdepth 2 -iname '*2john*' 2>/dev/null
Preserve the complete converter output. Some formats include a filename label before
:that John accepts but Hashcat may require removed from a separate tool-specific copy.
Verify → Use the tool's show/result output and then validate the recovered credential in its correct context.
If it fails → Token/separator errors imply wrong or incomplete input; no recovery means only the tested candidate space was exhausted. More detail ↓
Explanation & examples
Recover passwords with feasible dictionary, rule and mask attacks
- USE WHEN
- A supported stored verifier or converted protected artifact
- STARTING ACCESS
- A credential artifact with a recorded source and possible account context
- RESULT
- A recovered candidate password or a documented exhausted search strategy
Recognize the clue
Identify a supported verifier/converter and build candidate structure from relevant names/policy/context rather than selecting an arbitrary hash mode.
hashcat --example-hashes
john --list=formats
Artifact format matches SUPPORTED_MODE
Candidate model: relevant words plus a justified suffix patternMeans: A verified format and feasible candidate model enable offline recovery; a hash-shaped string alone does not.
Confirm: Check complete salt/context, conversion correctness, tool backend and whether all required factors are present.
- After validation
- The verifier and candidate space are valid: use the selected offline strategy and verify recovered credentials.
- Ruled out in this context
- The artifact is a non-crackable token or unsupported format under this workflow: reject that mode.
- Still inconclusive
- Parsing errors or an incomplete source require input repair; no recovery only exhausts the tested candidates.
Troubleshooting: Token/separator errors imply wrong or incomplete input; no recovery means only the tested candidate space was exhausted.
Use the actual mode and hardware rate. Salts prevent reusable precomputation; iterations and memory-hard KDFs reduce guesses per second. Prefer candidates in this order:
Preview mutations before spending the candidate budget:
-a 0is dictionary mode. Do not use-a 3with a wordlist; attack mode 3 expects a mask.
Common source examples identify NTLM as mode 1000, Net-NTLMv2 as 5600 and KeePass as 13400, but confirm against the installed version:
Mask and session variants
Mask order is a hypothesis about structure. Estimate its keyspace before committing time.
Hybrid variant — base word plus three digits
Use only when evidence supports both the base words and suffix shape.
File-to-hash converters:
Converter availability varies by package/path; locate it rather than assuming:
Preserve the complete converter output. Some formats include a filename label before
:that John accepts but Hashcat may require removed from a separate tool-specific copy.
Why it works
Offline cracking compares candidate-derived values without contacting the service. Dictionary rules and masks model likely structure; infeasible keyspaces do not become useful through a different tool name.
Worked example · hypothetical
Observation: a supported verifier and a naming/password-pattern clue exist. Test: validate the mode with a known-format sample and apply a focused rule strategy. Illustrative output: one candidate recovers the verifier. Interpretation: verify it against the intended identity/service.
New identity, privilege, host or route? Re-enumerate → All topic tasks →