使用hashcat破解压缩包密码
🕙
支持模式
- 字典攻击
- 组合字典攻击
- 暴力破解
- 字典+掩码攻击
环境需要
- zip2john
- hashcat
kali都有内置
获取hash mode
使用zip2john生成压缩包的hash
zip2john test.zip > res.txt
打开res.txt取包含$pkzip$
至$/pkzip$
的所有内容
根据获取到的内容进行查表(前面匹配到最多的那个)
查表地址:https://hashcat.net/wiki/doku.php?id=example_hashes
查表可知此zip的对应码为17210
字典攻击
hashcat -m 17210 -a 0 $pkzip$1*1*2*0*1f*13*20e267dd*0*26*0*1f*20e2*3d51e405bb7fb92cfb08a3dc5a73efce5d7f32118839e832166f9104d6d724*$/pkzip$ dic.txt
或者
hashcat -a 0 -m 17210 hash.txt dic.txt
组合字典攻击
hashcat -a 1 -m 0 hash.txt dic1.txt dic2.txt
暴力破解
hashcat -a 3 -m 17210 hash.txt
定长掩码破解
已知明文密码为8位数字,使用掩码进行破解,能在很大程度上缩短破解时间(次数为62^8->10^8),?d?d?d?d?d?d?d?d 表示8位数字
hashcat -m 0 -a 3 3d9865a2843dcb59e7a6296c894732a4 ?d?d?d?d?d?d?d?d
指定掩码破解
现有数字或字符(包含大小写)组成的4位明文密码,使用自定义掩码进行破解
hashcat -a 3 -1 ?l?u?d 7AB295AF2A8380599E3B38EBA18EEB93 ?1?1?1?1
混合攻击
字典内容混掩码
假设加密zip文件的密码为password1994
hashcat -a 6 -m 17210 hash.txt passwd.dict ?d?d?d?d
或
hashcat -a 6 -m 17210 $pkzip2$1*1*2*0*20*14*6a6c2ccf*0*28*0*20*6a6c*8e8e*6e54911e3be3984fa4989c72bf137696599978 8807e234b906068da7e60f0583a*$/pkzip2$ passwd.dict ?d?d?d?d
掩码混字典内容
假设加密zip文件的密码为1994password
hashcat -a 7 -m 17210 hash.txt ?d?d?d?d passwd.dict