Crunch 是 BackTrack 4 內建的命令列字典生成器,小巧強大,支援長度範圍、字符集、輸出檔案、自定義模板等豐富參數。掌握 Crunch 即掌握彈藥製造能力。
選單路徑:Backtrack → Privilege Escalation → Password Attacks → Office Attacks → Crunch
crunch [charset] [-o output-file] [-t pattern] ...
crunch 6 6 1234567890 -o num6.dic
6 6:最小/最大長度皆為 61234567890:字符集-o num6.dic:輸出檔名生成 10^6 = 1,000,000 條記錄,極快完成。
crunch 8 8 -f charset.lst numeric -o wordlist.dic
-f charset.lst numeric:調用內建 charset.lst 中的 numeric 定義 (即 0-9)cat /pentest/passwords/crunch/charset.lst
常見定義:
numeric = 0123456789alpha = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZalphanum = alpha + numericnumeric-space = 數字 + 空格mixalpha-numeric-all-space = 所有可列印字符 + 空格crunch 1 6 -f charset.lst alpha -o alpha_1-6.dic
crunch 6 6 -f charset.lst alphanum -o alphanum_6.dic
# 生日格式:YYYYMMDD (年固定 1990,月日暴力)
crunch 8 8 -t 1990@@@@ -o birthday_1990.dic
# 手機號:135xxxxxxxx
crunch 11 11 -t 135@@@@@@@@ -o phone_135.dic
# 符號說明:@=小寫, %=大寫, ^=符號, .=數字
| 字典類型 | 長度 | 組合數 | 預估大小 |
|---|---|---|---|
| 純數字 | 8 | 10^8 | ~859 MB |
| 字母+數字 | 6 | 62^6 ≈ 568 億 | ~3.4 TB (不可行) |
| 模板 135@@@@@@@@ | 11 | 26^8 ≈ 2,088 億 | ~2.3 TB (不可行) |
⚠️ 務必先估算大小,避免佔滿磁碟。Crunch 會輸出預估資訊,留意 Crunch will now generate the following amount of data: ...
find / -name "*.lst" -o -name "*.dic" -o -name "*.txt" | grep -i wordlist
重點資源:
/pentest/passwords/wordlists/darkc0de.lst (17.1 MB, 170 萬條,滲透測試黃金字典)wget https://www.skullsecurity.org/wiki/index.php/Passwords -O passwords.html
# 或直接下載知名洩露資料集 (RockYou, LinkedIn, Adobe 等)
Crunch 以極簡語法提供極致靈活性。實戰中:優先使用高品質現成字典 (darkc0de, RockYou);輔以 Crunch 生成針對性模板字典 (生日、手機、員工工號格式);最後才考慮大規模暴力字典。彈藥庫建設好,破解才有底氣。