john在非kali下好像会报错,本文使用的是ubuntu22.04,使用docker安装的kali
使用 John the Ripper 破解压缩包(ZIP 或 RAR)的密码一般需要两个步骤:
- 提取哈希值(使用
zip2john或rar2john工具) - 使用
john进行暴力破解
1. 提取哈希值
(1)ZIP 文件
zip2john protected.zip > hash.txt
(2)RAR 文件
rar2john protected.rar > hash.txt
(如果 rar2john 不存在,可尝试 sudo apt install rar)
2. 使用 John 破解密码
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
其中 rockyou.txt 是常用的密码字典,可用 apt install wordlists 安装。
如果想使用暴力破解:
john --incremental hash.txt
3. 查看破解的密码
john --show hash.txt
如果破解成功,就会显示解密的密码。










