Zip压缩包密码恢复
Zip压缩包密码恢复
由于历史原因丢失了zip密码,使用john和hashcat进行密码恢复
下载工具
- john:https://www.openwall.com/john/
- hashcat:https://hashcat.net/hashcat/
操作
- 运行前跑个分:
hashcat -b -m 13600,可以得到当前设备算力在指定模式的速度; - zip2john 提取hash string:
zip2john attachment.zip > hash.txt,去除多余字符串,保留$zip2$*0*3 开头到 032*$/zip2$,保存为 hash.0.txt; - 调用 hashcat 进行6位数密钥的爆破:
hashcat -a 3 -m 13600 hash.0.txt -1 "?l?u?d" "?1?1?1?1?1?1";
hash格式-m 13600,参考文档 Hashcat 官方 wiki - Example Hashes,依据zip2john输出格式确定类型值;
密码格式-1 "", 定义密码单个char的范围,随后是固定密码长的掩码。不定长密码长度使用参数-i --increment-min=4 --increment-max=8;
命令行输出会得到包含密钥的结果,如果成功。
参考
- 使用 John the Ripper 和 Hashcat破解 RAR、ZIP 与 7z 文件密码(Windows教程)
- 使用Hashcat
- ===
