x-glacier/kali-pentest / kali-pentest-zh
kali-pentest-zh
Flagged通过 SSH 或 Docker 使用 Kali Linux CLI 工具执行授权渗透测试。 覆盖:信息收集、漏洞分析、嗅探与欺骗、Web/API 渗透、漏洞利用、密码攻击、无线、云原生安全、RFID/NFC、VoIP/ICS、逆向工程、取证分析、后渗透/C2、报告生成。
references/password/tools/pdfcrack.md
View on GitHub# PDFCrack
- **Category**: Password Attacks / File Cracking
- **Risk Level**: 🟢 Low
---
## 描述
一款用于恢复 PDF 文件密码的命令行工具。支持破解用户密码(打开文档所需)和所有者密码(控制打印、复制和编辑权限)。使用暴力破解和字典攻击方式,支持 PDF 1.6 及以下版本的加密,包括 40 位 RC4、128 位 RC4 和 128 位 AES。在渗透测试中发现受密码保护的 PDF 时非常有用,这些文件可能包含凭据、网络拓扑图或内部文档等敏感信息。
## 安装
```bash
sudo apt update
sudo apt install pdfcrack
```
## 参数说明
| 参数 | 说明 |
|------|------|
| `-f <file>` | 目标 PDF 文件 |
| `-w <wordlist>` | 使用 FILE 作为密码来源 |
| `-c <charset>` | 使用 STRING 中的字符作为字符集 |
| `-n <length>` | 跳过短于此长度的密码 |
| `-m <length>` | 达到此密码长度时停止 |
| `-o` | 处理所有者密码 |
| `-u` | 处理用户密码(默认)|
| `-p <password>` | 提供用户密码以加速破解所有者密码 |
| `-s`, `--permutate` | 尝试对密码进行排列变换 |
| `-l <file>` | 从文件加载保存的状态(继续破解) |
| `-q` | 静默运行 |
| `-b` | 执行基准测试并退出 |
## 常用命令
```bash
# 使用字典攻击破解用户密码
pdfcrack -f protected.pdf -w /usr/share/wordlists/rockyou.txt
# 暴力破解:小写字母,长度 1-6
pdfcrack -f protected.pdf -n 1 -m 6 -c "abcdefghijklmnopqrstuvwxyz"
# 暴力破解:仅数字,长度 4-8
pdfcrack -f protected.pdf -n 4 -m 8 -c "0123456789"
# 破解所有者密码(权限密码)
pdfcrack -f protected.pdf -o -w /usr/share/wordlists/rockyou.txt
# 使用字母数字字符集暴力破解所有者密码
pdfcrack -f protected.pdf -o -n 1 -m 6 -c "abcdefghijklmnopqrstuvwxyz0123456789"
# 带排列组合的字典攻击(追加数字、切换大小写)
pdfcrack -f protected.pdf -w /usr/share/wordlists/rockyou.txt --permutate
# 批量破解多个 PDF
for pdf in *.pdf; do
echo "[*] Cracking: $pdf"
pdfcrack -f "$pdf" -w /usr/share/wordlists/rockyou.txt
done
```
## 注意事项
1. pdfcrack 仅使用 CPU——如需 GPU 加速破解,先用 `pdf2john` 提取哈希,然后使用 `hashcat -m 10400`(PDF 1.1-1.3)、`-m 10500`(PDF 1.4-1.6)或 `-m 10700`(PDF 1.7 AES-256)。
2. 所有者密码通常比用户密码弱,且仅限制权限(打印、复制、编辑)——破解它并不会解密文档内容。
3. 优先进行字典攻击,再考虑暴力破解——大多数实际 PDF 密码都在常用字典中。
4. 支持 PDF 1.6 及以下版本。对于 PDF 1.7+(AES-256),请改用 `hashcat` 或 `john`。
5. PIN 类型的纯数字密码(4-6 位)使用 `-c "0123456789"` 可以非常快速地暴力破解。
---
## 官方参考
- [pdfcrack on SourceForge](https://pdfcrack.sourceforge.net/)
- [Kali pdfcrack](https://www.kali.org/tools/pdfcrack/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |