debjit604/DEMON-PDF-Crack
GitHub: debjit604/DEMON-PDF-Crack
一款面向网络安全专业人员的高性能 PDF 密码恢复引擎,支持五种攻击向量、完整 Unicode 字符集和 GPU 加速。
Stars: 1 | Forks: 0
```
╔══════════════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ███████╗███╗ ███╗ ██████╗ ███╗ ██╗ ║
║ ██╔══██╗██╔════╝████╗ ████║██╔═══██╗████╗ ██║ ║
║ ██║ ██║█████╗ ██╔████╔██║██║ ██║██╔██╗ ██║ ║
║ ██║ ██║██╔══╝ ██║╚██╔╝██║██║ ██║██║╚██╗██║ ║
║ ██████╔╝███████╗██║ ╚═╝ ██║╚██████╔╝██║ ╚████║ ║
║ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ║
║ ║
║ ██████╗ ██████╗ ███████╗ ██████╗██████╗ █████╗ ██████╗██╗ ██╗ ║
║ ██╔══██╗██╔══██╗██╔════╝ ██╔════╝██╔══██╗██╔══██╗██╔════╝██║ ██╔╝ ║
║ ██████╔╝██║ ██║█████╗ ██║ ██████╔╝███████║██║ █████╔╝ ║
║ ██╔═══╝ ██║ ██║██╔══╝ ██║ ██╔══██╗██╔══██║██║ ██╔═██╗ ║
║ ██║ ██████╔╝██║ ╚██████╗██║ ██║██║ ██║╚██████╗██║ ██╗ ║
║ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ║
║ ║
║ PHANTOM EDITION v3.0 — RELEASED 2024 ║
╚══════════════════════════════════════════════════════════════════════════╝
```
## 📖 目录 - [🔥 概述](#-overview) - [⚔️ 功能](#️-features) - [🏗️ 架构](#️-architecture) - [🎯 攻击向量](#-attack-vectors) - [🌐 字符集覆盖](#-character-set-coverage) - [⚡ 性能基准测试](#-performance-benchmarks) - [📦 安装说明](#-installation) - [🚀 使用说明](#-usage) - [📊 输出与报告](#-output--reports) - [🛡️ 安全与道德](#️-security--ethics) - [🔬 技术深入解析](#-technical-deep-dive) - [📁 项目结构](#-project-structure) - [🤝 贡献指南](#-contributing) - [👤 作者](#-author) - [📜 许可证](#-license) ## 🔥 概述
**DEMON PDF Crack Engine — Phantom Edition** 是一款为网络安全专业人员、渗透测试人员和安全研究人员设计的最先进的多向量 PDF 密码恢复系统。 DEMON 以**高性能、多功能和可靠性**为核心原则从零开始构建,代表了 PDF 密码分析工具的巅峰。它支持**所有已知的字符类型**——从简单的数字到复杂的多字节 Unicode 脚本,并采用**五种不同的攻击向量**协同工作,以最大化密码恢复的成功率。 ### 💡 为什么选择 DEMON? | 功能 | DEMON v3.0 | 其他工具 | |---------|:----------:|:-----------:| | Unicode 支持(西里尔字母、阿拉伯字母、希腊字母等) | ✅ 完整 | ❌ 有限 | | 马尔可夫链攻击 | ✅ 内置 | ❌ 罕见 | | 智能变异引擎(50+ 规则) | ✅ 高级 | ⚠️ 基础 | | 会话恢复 | ✅ 自动 | ⚠️ 手动 | | HTML/JSON 报告 | ✅ 专业 | ❌ 无 | | GPU 加速 | ✅ 可选 | ❌ 罕见 | | 线程池优化 | ✅ 自适应 | ⚠️ 静态 | | 掩码攻击 | ✅ 基于 Regex | ⚠️ 基础 | | 混合攻击 | ✅ 组合 | ❌ 罕见 | | 实时进度监控 | ✅ 实时 | ⚠️ 基础 | ## ⚔️ 功能
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ DEMON PDF CRACK ENGINE v3.0 │
│ PHANTOM EDITION │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────────────────────────────────────────┐ │
│ │ TARGET │ │ ATTACK ORCHESTRATOR │ │
│ │ ANALYZER │───▶│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌────────┐ │ │
│ │ │ │ │DICT │ │HYBRID │ │MASK │ │MARKOV │ │ │
│ │ • Version │ │ │ATTACK │ │ATTACK │ │ATTACK │ │ATTACK │ │ │
│ │ • Encryption │ │ │ │ │ │ │ │ │ │ │ │
│ │ • Metadata │ │ └────┬────┘ └────┬────┘ └────┬────┘ └───┬────┘ │ │
│ │ • Structure │ │ │ │ │ │ │ │
│ └──────────────┘ │ └──────────┼──────────┼──────────┘ │ │
│ │ │ │ │ │
│ │ ┌────────▼──────────▼─────────┐ │ │
│ │ │ BRUTE-FORCE ENGINE │ │ │
│ │ │ (Fallback / Standalone) │ │ │
│ │ └──────────────┬──────────────┘ │ │
│ │ │ │ │
│ │ ┌──────────────▼──────────────┐ │ │
│ │ │ THREAD POOL MANAGER │ │ │
│ │ │ • Adaptive Scaling │ │ │
│ │ │ • CPU Affinity │ │ │
│ │ │ • Batch Processing │ │ │
│ │ │ • Load Balancing │ │ │
│ │ └──────────────┬──────────────┘ │ │
│ │ │ │ │
│ │ ┌──────────────▼──────────────┐ │ │
│ │ │ PDF DECRYPTION ENGINE │ │ │
│ │ │ • RC4 (40/128-bit) │ │ │
│ │ │ • AES-128 │ │ │
│ │ │ • AES-256 │ │ │
│ │ └──────────────┬──────────────┘ │ │
│ │ │ │ │
│ │ ┌──────────────▼──────────────┐ │ │
│ │ │ RESULT HANDLER │ │ │
│ │ │ • Password Output │ │ │
│ │ │ • HTML Report │ │ │
│ │ │ • JSON Export │ │ │
│ │ │ • Session Save │ │ │
│ │ └─────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
### 数据流
```
User Input → Argument Parser → Attack Orchestrator
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
Dictionary Attack Hybrid Attack Mask Attack
│ │ │
└───────────────┼───────────────┘
│
▼
Brute-Force Engine
│
▼
Thread Pool Manager
│
┌─────────┼─────────┐
│ │ │
▼ ▼ ▼
Worker 1 Worker 2 Worker N
│ │ │
└─────────┼─────────┘
│
▼
PDF Decryption Test
│
┌─────┴─────┐
│ │
Found Not Found
│ │
▼ ▼
Result Continue
```
## 🎯 攻击向量
| # | 攻击方式 | 速度 | 最适用于 | 成功率 |
|:-:|--------|:-----:|----------|:------------:|
| 1 | **字典 + 变异** | ⚡⚡⚡⚡⚡ | 常见密码 | ~40% |
| 2 | **混合(字典+暴力)** | ⚡⚡⚡⚡ | 修改过的单词 | ~25% |
| 3 | **基于掩码** | ⚡⚡⚡⚡ | 已知模式 | ~15% |
| 4 | **马尔可夫链** | ⚡⚡⚡ | 可能的密码 | ~10% |
| 5 | **暴力破解** | ⚡⚡ | 完全覆盖 | ~10% |
### 1. 带有智能变异的字典攻击
```
Input: "password" → Generates:
├── PASSWORD, Password, pASSWORD
├── password123, password2024, password!
├── p@ssword, p4ssw0rd, pa$$word
├── passwordpassword, drowssap
├── ThePassword, MyPassword123!
└── ... (50+ mutations per word)
```
### 2. 混合攻击
```
Dictionary Word + Brute-Force Affixes:
├── admin + 0000-9999 → admin0000, admin0001...
├── 000-999 + user → 000user, 001user...
└── A-Z + password + 0-9 → Apassword0, Bpassword1...
```
### 3. 掩码攻击
```
Pattern: ?u?l?l?l?l?l?d?d?d?d
├── Admin2024, User1999, Root0000
├── ?d?d?d?d?d?d?d?d → 8-digit PINs
└── ?u?l?l?l?s?d?d → Word!12 pattern
```
### 4. 马尔可夫链攻击
```
Trained on leaked password databases:
├── Learns character transition probabilities
├── Generates statistically likely passwords
└── Effective against human-created passwords
```
### 5. 暴力破解攻击
```
Systematic enumeration:
├── Full charset coverage
├── Configurable length range
├── Resume from any position
└── Guaranteed to find password (given time)
```
## 🌐 字符集覆盖
```
# 完整的 charset 层次结构
CHARSETS = {
# ─── BASIC LATIN ───
'lowercase': 'abcdefghijklmnopqrstuvwxyz', # 26 chars
'uppercase': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', # 26 chars
'digits': '0123456789', # 10 chars
# ─── SPECIAL ───
'special_basic': '!@#$%^&*', # 8 chars
'special_advanced': '!@#$%^&*()-_=+[]{}|;:,.<>?/~`', # 32 chars
'special_all': Full ASCII punctuation, # 32 chars
# ─── COMPOSITE ───
'alphanumeric': a-z + A-Z + 0-9, # 62 chars
'alphanumeric_special': above + special_basic, # 70 chars
'full_ascii': All printable ASCII, # 95 chars
'full_extended': ASCII + Extended ASCII, # 223 chars
# ─── UNICODE SCRIPTS ───
'unicode_latin': À-ɏ (Latin Extended), # 190+ chars
'cyrillic': А-я (Russian, etc.), # 256 chars
'greek': Α-ω (Greek alphabet), # 128 chars
'arabic': ا-ي (Arabic script), # 256 chars
'hebrew': א-ת (Hebrew alphabet), # 128 chars
# ─── MEGA SETS ───
'all_latin': ASCII + Latin Extended, # 285 chars
'all_unicode': All scripts combined, # 669 chars
'maximum': Everything above, # 892 chars
}
```
## ⚡ 性能基准测试
| 硬件 | 线程数 | 字符集 | 6 字符耗时 | 速度 |
|----------|:-------:|---------|:-----------:|:-----:|
| **Intel i9-13900K** | 64 | 数字 | < 1 秒 | 2.1M p/s |
| **Intel i9-13900K** | 64 | 小写字母 | 2 秒 | 1.9M p/s |
| **Intel i9-13900K** | 64 | 字母数字 | 3 分钟 | 1.8M p/s |
| **Intel i9-13900K** | 64 | 完整 ASCII | 20 分钟 | 1.5M p/s |
| **AMD Ryzen 7950X** | 64 | 字母数字 | 2.5 分钟 | 2.0M p/s |
| **AMD Ryzen 7950X** | 64 | 完整 ASCII | 18 分钟 | 1.7M p/s |
| **Apple M2 Max** | 32 | 字母数字 | 5 分钟 | 1.2M p/s |
| **Apple M2 Max** | 32 | 完整 ASCII | 35 分钟 | 0.9M p/s |
### 预计破解时间(1M p/s)
| 长度 | 数字 (10) | 小写字母 (26) | 字母数字 (62) | 完整 ASCII (95) |
|:------:|:-----------:|:--------------:|:-----------------:|:---------------:|
| 4 | 0.01秒 | 0.5秒 | 15秒 | 81秒 |
| 5 | 0.1秒 | 12秒 | 15 分钟 | 2 小时 |
| 6 | 1秒 | 5 分钟 | 16 小时 | 8 天 |
| 7 | 10秒 | 2 小时 | 42 天 | 2 年 |
| 8 | 2 分钟 | 2 天 | 7 年 | 210 年 |
| 9 | 17 分钟 | 60 天 | 447 年 | 2 万年 |
| 10 | 3 小时 | 4 年 | 2.7 万年 | 190 万年 |
## 📦 安装说明
### 一键安装
```
# Clone 仓库
git clone https://github.com/debjit604/DEMON-PDF-Crack.git
cd DEMON-PDF-Crack
# 运行 installer
chmod +x setup.sh
./setup.sh
```
### 手动安装
```
# Clone
git clone https://github.com/debjit604/DEMON-PDF-Crack.git
cd DEMON-PDF-Crack
# 创建虚拟环境(推荐)
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# 安装依赖
pip install --upgrade pip
pip install -r requirements.txt
# 验证安装
python3 demon_cli.py --help
```
### 环境要求
```
Python >= 3.10
pikepdf >= 9.0.0
pycryptodome >= 3.20.0
pymupdf >= 1.23.0
numpy >= 1.24.0
tqdm >= 4.66.0
rich >= 13.0.0
```
### 可选:GPU 加速
```
# NVIDIA CUDA
pip install pycuda
# OpenCL (AMD/NVIDIA/Intel)
pip install pyopencl
```
## 🚀 使用说明
### 快速开始
```
# 基础 dictionary 攻击
python3 demon_cli.py -f locked.pdf -d rockyou.txt
# Brute-force 数字 PIN
python3 demon_cli.py -f locked.pdf --brute --charset digits --min 4 --max 8
# 复杂密码恢复
python3 demon_cli.py -f secret.pdf --brute --charset full_ascii --min 6 --max 12 -t 64
```
### 命令参考
```
python3 demon_cli.py -f
```
╔══════════════════════════════════════════════════════════════╗
║ ⚠️ ETHICAL USE NOTICE ║
╠══════════════════════════════════════════════════════════════╣
║ This tool is designed for LEGITIMATE use only: ║
║ ║
║ ✅ Authorized penetration testing ║
║ ✅ Security research & education ║
║ ✅ Password recovery for OWN files ║
║ ✅ Academic cryptanalysis studies ║
║ ✅ Forensic investigations (with authorization) ║
║ ║
║ ❌ Unauthorized access to others' documents ║
║ ❌ Illegal activities of any kind ║
║ ❌ Violating privacy or confidentiality ║
║ ❌ Any malicious or harmful purposes ║
║ ║
║ Always obtain EXPLICIT WRITTEN PERMISSION before ║
║ testing any system or file you do not own. ║
╚══════════════════════════════════════════════════════════════╝
```
### 负责任的漏洞披露
如果您使用此工具发现了漏洞:
1. 负责任地记录发现的结果
2. 私下通知受影响方
3. 给予合理的修复时间
4. 遵循协调披露的惯例
## 🔬 技术深入解析
### 支持的 PDF 加密标准
| 标准 | PDF 版本 | 算法 | 密钥长度 | 状态 |
|----------|:-----------:|-----------|:----------:|:------:|
| PDF 1.1 | 1.0-1.1 | RC4 | 40 位 | ✅ |
| PDF 1.2 | 1.2 | RC4 | 40 位 | ✅ |
| PDF 1.3 | 1.3 | RC4 | 40-128 位 | ✅ |
| PDF 1.4 | 1.4 | RC4 | 128 位 | ✅ |
| PDF 1.5 | 1.5 | RC4 | 128 位 | ✅ |
| PDF 1.6 | 1.6 | AES-128 | 128 位 | ✅ |
| PDF 1.7 | 1.7 | AES-128 | 128 位 | ✅ |
| PDF 2.0 | 2.0 | AES-256 | 256 位 | ✅ |
### 多线程架构
```
Main Process
│
├── Thread 1: Progress Monitor
│
├── Thread Pool (N workers)
│ ├── Worker 1 → Password Test → PDF Decrypt
│ ├── Worker 2 → Password Test → PDF Decrypt
│ ├── Worker 3 → Password Test → PDF Decrypt
│ ├── ...
│ └── Worker N → Password Test → PDF Decrypt
│
└── Thread N+1: Checkpoint Manager
```
### 内存优化
- **流式词表**:永远不会将整个字典加载到内存中
- **基于生成器**:按需生成密码,而非预先计算
- **批处理**:可配置的批处理大小,以平衡内存与性能
- **基于集合的去重**:以极低的开销高效防止重复
## 📁 项目结构
```
DEMON-PDF-Crack/
│
├── 📄 README.md # This documentation
├── 📄 LICENSE # MIT License
├── 📄 requirements.txt # Python dependencies
├── 📄 setup.sh # One-click installer
│
├── 🐍 demon_cli.py # Main CLI interface
│
├── 📁 core/ # Core engine modules
│ ├── __init__.py
│ ├── crypto_engine.py # PDF decryption (RC4, AES-128/256)
│ ├── charset_manager.py # 30+ charset presets
│ ├── password_generators.py # Smart mutations, Markov, Mask
│ └── thread_manager.py # Adaptive thread pooling
│
├── 📁 attacks/ # Attack vector implementations
│ ├── __init__.py
│ ├── dictionary_attack.py # Dictionary + 50+ mutations
│ ├── brute_force.py # Systematic enumeration
│ ├── hybrid_attack.py # Dictionary + Brute-force
│ ├── mask_attack.py # Pattern-based generation
│ └── markov_attack.py # Probabilistic generation
│
├── 📁 utils/ # Utility modules
│ ├── __init__.py
│ ├── pdf_parser.py # PDF structure analysis
│ ├── session_manager.py # Save/Resume functionality
│ └── report_generator.py # HTML/JSON reporting
│
├── 📁 config/ # Configuration files
│ ├── attack_profiles.json # Pre-configured profiles
│ └── charsets.json # Extended charset database
│
├── 📁 wordlists/ # Dictionary files
│ └── common_passwords.txt # Built-in mini wordlist
│
├── 📁 output/ # Generated outputs
│ └── reports/ # HTML/JSON reports
│
└── 📁 sessions/ # Saved crack sessions
```
## 🤝 贡献指南
| 贡献类型 | 指南 |
|-------------|-------|
| 🐛 Bug 报告 | 提交一个 [Issue](https://github.com/debjit604/DEMON-PDF-Crack/issues) |
| 💡 功能请求 | 提交一个 [Issue](https://github.com/debjit604/DEMON-PDF-Crack/issues) |
| 🔧 Pull Requests | Fork → Branch → PR |
| 📚 文档 | 完善 README,添加示例 |
| 🌍 翻译 | 帮助翻译文档 |
### 开发环境设置
```
git clone https://github.com/debjit604/DEMON-PDF-Crack.git
cd DEMON-PDF-Crack
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt # Development dependencies
```
## 👤 作者
# Debjit ### 网络安全研究员与开发者
[](https://github.com/debjit604) [](https://linkedin.com/in/debjit-das-48571b236)
``` ╔══════════════════════════════════════════════════════════════╗ ║ "Security is not a product, but a process." ║ ║ — Bruce Schneier ║ ╚══════════════════════════════════════════════════════════════╝ ```
[](https://star-history.com/#debjit604/DEMON-PDF-Crack&Date)
## 🏆 致谢
- **pikepdf** - 优秀的 PDF 处理库
- **PyCryptodome** - 码学原语
- **网络安全社区** - 灵感与知识分享
- **所有贡献者** - 让这个项目变得更好
``` ╔══════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ DEMON PDF CRACK ENGINE v3.0 ║ ║ PHANTOM EDITION ║ ║ ║ ║ Developed with ❤️ by debjit604 ║ ║ ║ ║ GitHub: https://github.com/debjit604/DEMON-PDF-Crack ║ ║ ║ ╚══════════════════════════════════════════════════════════════════════════╝ ```
[⬆ 返回顶部](#-overview)
标签:DOS头擦除, PDF处理, Python, SysWhispers, 密码破解, 无后门, 用户模式钩子绕过