☼
⌃
☰

Crunch

Table of Contents

Wordlist generator that creates lists based on character sets and patterns. Use when you know something about the password structure — a specific length, known prefix or suffix, or limited character set. Avoids downloading large generic lists when a targeted approach is more efficient.

Related: Wordlists Hydra Hashcat

Syntax

SHELL
crunch <min-length> <max-length> [charset] [options]

Character Sets

SHELL
# Built-in charsets (defined in /usr/share/crunch/charset.lst)
crunch 4 4 -f /usr/share/crunch/charset.lst mixalpha-numeric

# Custom charset inline
crunch 6 6 abcdef0123456789    # hex chars only
crunch 4 4 0123456789          # digits only
crunch 8 8 "ABC abc 123 !@#"  # specific chars

Common Workflows

SHELL
# All 4-digit PINs
crunch 4 4 0123456789 -o pins.txt

# All 6-8 character lowercase alphabetic
crunch 6 8 abcdefghijklmnopqrstuvwxyz -o lowercase.txt

# Pattern-based — @ = lowercase, , = uppercase, % = digit, ^ = symbol
crunch 8 8 -t "@@@@%%%%" -o pattern.txt   # 4 letters + 4 digits

crunch 10 10 -t "Pass%%%%!!"              # Password with 4 digits in middle

# Known prefix/suffix
crunch 8 8 -t "Winter%%"                  # Winter + 2 digits

# Pipe directly to Hydra (avoids creating large file)
crunch 4 4 0123456789 | hydra -l admin -P - \
  target.com http-post-form "/login:user=^USER^&pass=^PASS^:Invalid"

Pattern Characters

Symbol Matches
@ Lowercase letters
, Uppercase letters
% Digits (0-9)
^ Symbols

Tips

  • Pipe to Hydra or Hashcat directly to avoid writing large files to disk — crunch 4 4 0123456789 | hashcat …
  • Crunch output can be enormous — estimate size before running: 8-character alphanumeric is 62⁸ ≈ 218 billion combinations
  • Use -t patterns when you know the password structure — far more efficient than brute-forcing all combinations
  • For CTFs, try common PIN formats first (4 digits = 10,000 combinations) before generating larger lists