Kali Linux 加密文档密码破解完整教程

重要声明:本教程仅用于破解本人所有、已获得合法授权的加密文档,未经授权破解他人文档属于违法行为,需承担相应法律责任。
支持:适用范围
PDF(打开密码、权限密码)Word(doc/docx)Excel(xls/xlsx) PowerPoint(ppt / pptx) 全都用 John the Ripper + hashcat 方案,通用且稳定。
一、前期准备
1. 解压系统自带密码字典
Kali 默认内置 rockyou.txt 高频密码字典,需先解压使用:
gunzip /usr/share/wordlists/rockyou.txt.gz
2. 安装依赖工具
apt update && apt install -y john msoffcrypto-tool poppler-utils
二、破解 PDF 文档
1. 提取文档哈希值
pdf2john 目标文件.pdf > pdf.hash
2. 字典爆破密码
john --wordlist=/usr/share/wordlists/rockyou.txt pdf.hash
3. 查看破解结果
john --show pdf.hash
4. GPU 加速破解(hashcat)
hashcat -m 10500 -a 0 pdf.hash /usr/share/wordlists/rockyou.txt
三、破解 Word/Excel/PPT 文档
Office 全系列文档(docx/xlsx/ppt/doc/xls/ppt)破解流程一致,统一使用 office2john 工具。
1. 提取文档哈希
# Word 文档office2john 文档.docx > office.hash# Excel 文档office2john 表格.xlsx > office.hash# PPT 文档office2john 演示文稿.pptx > office.hash
2. 字典爆破密码
john --wordlist=/usr/share/wordlists/rockyou.txt office.hash
3. 查看破解结果
john --show office.hash
4. GPU 加速破解(hashcat)
hashcat -m 9400 -a 0 office.hash /usr/share/wordlists/rockyou.txt
四、暴力破解模式(无字典时)
适用于密码简单、无可用字典的场景,以 PDF 为例:
# 纯数字暴力破解john --incremental=Digits pdf.hash# 纯字母暴力破解john --incremental=Alpha pdf.hash# 全字符组合破解john --incremental=All pdf.hash
Office 文档替换哈希文件即可使用。
五、补充说明
-
现代文档加密强度较高,仅简单弱密码可快速破解,复杂长密码几乎无法破解。 -
自定义专属字典(生日、手机号、常用字符)可大幅提升破解成功率。 -
所有操作仅限合法合规场景,严禁用于非法获取他人文档信息。
夜雨聆风