官方网站:https://hashcat.net/hashcat/
这里以windows为利使用hashcat4.1.0
https://hashcat.net/wiki/doku.php?id=example_hashes //hashcat 示例hash
比较重要的参数:
hashcat64.exe --help //查看帮助文档 -m (--hash-type=NUM) //要破解hash的种类,用--help找到对应的数字。 -a (--attack-mode=NUM) //破解的模式 -o //保存破解后密码的位置 -D 1/2/3 //选择是cpu破解还是GPU 。1、cpu;2,GPU;3、FPGA, DSP, Co-Processor
attack-mode: //-a 对应的数字
0 = Straight (字典破解)
1 = Combination (组合破解)
2 = Toggle-Case
3 = Brute-force (掩码暴力破解)
4 = Permutation (组合破解)
5 = Table-Lookup
-a 3 Brute-force 掩码暴力破解模式:
例如:?d?d?d?d?d?d 对应纯6位数字组合
?l | abcdefghijklmnopqrstuvwxyz
?u | ABCDEFGHIJKLMNOPQRSTUVWXYZ
?d | 0123456789
?h | 0123456789abcdef
?H | 0123456789ABCDEF
?s | !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
?a | ?l?u?d?s
?b | 0x00 - 0xff
高级组合:
例如:
–custom-charset1=?l?d 那么?1(一)表示小写字母与数字的组合
–custom-charset2=xiao123 于是?2就表示xiao123所有字符的组合
完整例子:
hashcat hash.txt -a 3 -m 0 –custom-charset2=xi123 ?2?2?2
-1, --custom-charset1=CS -2, --custom-charset2=CS -3, --custom-charset3=CS -4, --custom-charset4=CS
最后完整示例:
破解NMLM密码
hashcat64.exe --help |findstr "NTLM" 1000 | NTLM | Operating Systems 得到要破解NTLM密码 -m 的值为1000: hashcat.exe -a 0 -m 1000 hash.txt/hash 字典/掩码
破解wifi密码:
1、用airdump抓取wpa握手包 2、握手包转换 aircrack-ng <out.cap> -J <out.hccap> 3、hashcat.exe -a 0 -m 2500 out.hccap 字典/掩码
破解后如果不显示密码:
用--show显示密码 hashcat.exe -a 0 -m 1000 hash.txt 字典 --show
破解linux密码
Linux密码解释(/etc/passwd):
$1$BZgQSkq2$NNqY3Sv80RSQgOBLwevLJ0 $6$7vXyCOws$Hp/xoGf50Kov51cy83h6CTYoQerInkAFWWYZL22640N6P0kgy9Gfy4NVndDa1hNUevqR122E7ykmA1BIIOg0C. 6:表示一种类型标记为6的密码散列; 7vXyCOws:加盐(Salt)值; Hp/xoGf50Kov51cy83h6CTYoQerInkAFWWYZL22640N6P0kgy9Gfy4NVndDa1hNUevqR122E7ykmA1BIIOg0C.:hash值
1. $0 = DES 对应hashcat -m 1500/12400 2. $1 = MD5 500 3. $2a(2y) = Blowfish 3200 4. $5 = SHA-256 7400 5. $6 = SHA-512 1800
破解命令:
hashcat –m 1800 -a 0 -o found.txt 1.hash pass.txt

