【Sec】John the ripper | hashcat
John
参数:
使用方法:
例:破解Linux的用户密码hashcat
地址:https://github.com/hashcat/hashcat
参数:
--potfile-disable # 总是显示已破解结果,否则以破解的记录被存放于:/Users/MichaelScofield/.hashcat/hashcat.potfile
-m 指定hash类型
-a 选择爆破方式
- [ Attack Modes ] -
# | Mode
===+======
0 | Straight # hashcat -a 0 -m xx <hashfile> <zidian1> <zidian2>...
1 | Combination
3 | Brute-force
6 | Hybrid Wordlist + Mask
7 | Hybrid Mask + Wordlist
- [ Built-in Charsets ] -
? | Charset
===+=========
l | abcdefghijklmnopqrstuvwxyz
u | ABCDEFGHIJKLMNOPQRSTUVWXYZ
d | 0123456789
h | 0123456789abcdef
H | 0123456789ABCDEF
s | !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
a | ?l?u?d?s
b | 0x00 - 0xff
使用方法:
例:PDF文件密码破解
1、使用john的提取pdf文件密码hash的脚本pdf2john。或使用一个在线的网站https://www.onlinehashcrack.com/tools-pdf-hash-extractor.php
./pdf2john.pl xxx.pdf
2、选择hash类型和破解模式
hashcat -m 10700 -a 3 $pdf$4*4*128*-4*1*16*f8e0565b3c4d9795db089448fcf5426e*32*6cff45e6bdfcecaf9039ba17cdb06ae700000000000000000000000000000000*32*f78487d59915fc93bd17f9c687bf84d1360e98df8e382132d494ed78dc3518b1 -1 ?l?u?d ?1?1?1?1?1?1
-1 字符集 这里是?l?u?d 指数字+字母大小写
总共?1有6个,代表有6位
高级组合:
但如果不确定某一位是什么类型则需要进行高级组合:
-1, --custom-charset1=CS
-2, --custom-charset2=CS
-3, --custom-charset3=CS
-4, --custom-charset4=CS
例子1:
--custom-charset1=?l?d 那么就表示 ?1代表小写字母与数字组合,那么8位随机的数字与小写字母组合可以写成 ?1?1?1?1?1?1?1?1
完整代码:
hashcat test.txt -a 3 -m 0 --custom-charset1=?l?d ?1?1?1?1?1?1?1?1
例子2:
--custom-charset2=xiao106347 那么就表示 ?2 代表字符串由 x i a o 1 0 6 3 4 7 组成的所有可能组合
完整代码:
hashcat test.txt -a 3 -m 0 --custom-charset2=xiao106347 ?2?2?2?2?2?2?2?2
Chances are for those who are prepared.