Skip to content
leg3ndProjects & tools
01Home02Projects03Tools04Notes
GMT+8
O/ OSCP exploitation reference
Workspace controls Memory only · 0 steps
Visualize path ↗
Command values 0 filled

Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.

Reference index ↗ Search all procedures & variants ↗
01Discovery02Enumeration03Initial access04Usable access05Local privilege06Active Directory07Internal access08Evidence & reporting

QUICK REFERENCE

Discovery›Services›Web mapping›Web exploitation›Credentials›Public exploits›Sessions & transfers›Linux escalation›Windows escalation›AD enumeration›AD identity attacks›Lateral movement›Pivoting & tunnels›Execution troubleshooting›Integration & evidence›
174 methods · 15 topicsFull reference on GitHub ↗Commands · scripts · next steps
Tools/OSCP/Usable access/Credentials
← All credentials tasks

Recover passwords with feasible dictionary, rule and mask attacks

CommandsIf → thenExplanation & examples

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 ↓

If → then

  • A password tied to a plausible user and service → Validate known passwords and context-specific reuse

    Needs: Correct local/domain/application identity, reachable compatible service, accepted authentication and account state

  • A private key from a file read, share, repository or home directory → Inspect and recover SSH private-key access

    Needs: Correct key format, passphrase if encrypted, matching server account/key authorization and accepted algorithm/policy

  • A user-owned SPN and a useful service-account relationship → Request a selected service ticket for offline service-account recovery

    Needs: A valid domain authentication/TGT context, reachable KDC, target SPN and a feasible password/encryption candidate strategy

No useful finding → another task in this topic. Failed check → resolve the failure before ruling out the path.

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
SYNTHETIC EXAMPLE OUTPUT
Artifact format matches SUPPORTED_MODE
Candidate model: relevant words plus a justified suffix pattern

Means: 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 0 is dictionary mode. Do not use -a 3 with 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 →

Study guide ↗Full procedure ↗Cheatsheet ↗
HomeProjectsToolsNotes
Interactive toolsOSCP notes ↗Extended OSCP workspace ↗Attack-path visualizer ↗

© 2026 Armaan. Built with curiosity.

GitHub ↗GMT+8