
CVE-2026-41940 (SessionScribe) 向けの検出、緩和、リバースエンジニアリングツール群: 2026-04-28 に公開された cPanel/WHM の未認証セッション偽造の脆弱性に対応。多層防御に基づくアクティブ緩和シム、ModSec ルールパック、リモートプローブ、オンホスト IOC スキャナ、および層別 RE スナップショットコレクタ。GPL v2。
cPanel & WHM における、認証不要の重大な RCE。 4 つの HTTP リクエストで、preauth セッションのパスワードフィールドへの CRLF インジェクションにより root セッションを偽造します。 認証も前提条件も不要で、サポートされているすべてのティアに影響します。 2026-04-28 に Sina Kheirkhah / watchTowr Labs によって公開されました。
Quickstart · ioc-scan · mitigate · remote-probe · Affected builds · Priority order
[!IMPORTANT] ティア 112、114、116、120、122、128 にはベンダーパッチがありません。 これらのティアの すべてのビルドが影響を受けます。恒久的な修正はアップグレードまたは移行のみです。 それまでの間: TCP/2082、2083、2086、2087、2095、2096 を管理 CIDR に ファイアウォールで制限し (
mitigate.sh --applyがこれを実行します)、 残りの攻撃面は ModSec ルールパックで保護してください。
オペレーター優先順位による 3 つのワンライナー:```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --apply
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh | bash -s -- --target HOST
Exit codes are designed for fleet automation: `ioc-scan` exits `4` on
COMPROMISED, `1` on VULNERABLE; `mitigate` exits `0` clean / `1` applied
/ `2` manual / `3` tool error; `remote-probe` exits `2` if any target is
VULN.
---
## ツール
運用優先度の順です。すべてのアーティファクトは、フリート集約用に `host`、`os`、`cpanel_version`、`ts` をキーとした構造化出力(`--json` / `--jsonl` / `--csv`)を出力します。
| Tool | Role | Where it runs |
|---|---|---|
| **[`sessionscribe-ioc-scan.sh`](#sessionscribe-ioc-scansh---ioc-ladder--kill-chain)** | First-class triage. IOCラダー、コード状態 + ホスト状態の判定、キルチェーン復元、IRバンドル。 | cPanelホスト上 |
| **[`sessionscribe-mitigate.sh`](#sessionscribe-mitigatesh---mitigation-orchestrator)** | 侵入の窓を閉じる。段階的緩和: パッチ確認、ファイアウォール、プロキシ置換、ModSec。 | cPanelホスト上 |
| **[`sessionscribe-remote-probe.sh`](#sessionscribe-remote-probesh---non-destructive-fleet-probe)** | 補助的資料。非破壊的な4段階プローブ → ホストごとに VULN/SAFE。 | `curl` が使える任意の場所 |
| [`modsec-sessionscribe.conf`](#supporting-collateral) | `mitigate` によって展開される ModSec ルールパック。 | Apache フロントエンド |
| [`sessionscribe-revsnap.sh`](#supporting-collateral) | バイナリ差分のための階層別 RE スナップショット収集ツール。 | cPanelホスト上、`upcp` の前後 |
GPL v2。すべてのアーティファクトは、上記の raw URL から `curl` で取得できます。
---
## `sessionscribe-ioc-scan.sh` - IOCラダー + キルチェーン
**最初にこれを実行してください。** デフォルトでは検出のみ(高速、フリート向き)。
`--full` を追加すると、フォレンジックフェーズをインラインで実行します(ディフェンスタイムライン、オフェンス取り込み、調整、キルチェーン描画、IRバンドル)。```bash
# fast triage (detection only)
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash
# full kill-chain reconstruction inline
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash -s -- --full
# full + ship IR bundle to intake
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash -s -- --full --upload
# JSONL for SIEM ingest
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash -s -- --jsonl --quiet > host.jsonl
# host IOCs only - periodic post-patch sweep, last 7 days
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash -s -- --ioc-only --since 7
# replay forensic phases against a saved envelope (no re-scan)
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh | bash -s -- --replay /var/cpanel/sessionscribe-ioc/<run_id>.json
2つの軸が独立して報告されます。code_verdict(PATCHED / VULNERABLE / INCONCLUSIVE)は、バージョン、Perlソースパターン、およびcpsrvdバイナリフィンガープリントから得られます。host_verdict(CLEAN / SUSPICIOUS / COMPROMISED)は、セッションファイルのIOCラダー、アクセスログスキャン、およびパターンA~Gの破壊プローブから得られます。パッチ適用済みのホストでも、過去の悪用によってIOCがディスク上に残っている場合、終了コード4で終了することがあります。
nxesec_canary_<nonce> でタグ付けされたセッションは(リモートプローブによって残されたもの)、PROBE_ARTIFACT として分類され、COMPROMISED にはエスカレーションされません。
--full は、すべてのIOCを防御アクティベーションと照合し、それぞれを PRE-DEFENSE、POST-DEFENSE、POST-PARTIAL、または UNDEFENDED に分類し、その後、判定 + 防御ラグの見出しで要約します。PRE-DEFENSE = インディケータが到達した時点でホストがエクスプロイトに対して開放されていたことを意味します。POST-DEFENSE = 副次的なもの、または緩和前のノイズを意味します。```
+-- CVE-2026-41940 / IC-5790 --------------------------------------------
| host cpanel.example.com ()
| cpanel unknown os unknown
| verdict COMPROMISED score 315 ioc-scan v2.5.0
| defenses patch x absent modsec + up csf + clean mitigate + ran
+------------------------------------------------------------------------
| -- PRE-DEFENSE (32 events) -- | 2026-03-25T09:43:19Z ! pattern X ioc_attacker_ip_2xx_on_cpsess 57 hit(s) (last 90d) from IC-5790 IPs returned 2xx on /cpsess/ paths - real exploitation | 2026-04-28T14:35:56Z ! pattern X ioc_cve_2026_41940_crlf_access_chain 15 CRLF-bypass chain(s) — POST /login 401 then GET /cpsess 2xx as root within 2s | 2026-04-28T16:38:45Z ! pattern E ioc_pattern_e_websocket_shell_hits 45 external IP(s) reached /cpsess*/websocket/Shell with 2xx | 2026-04-29T08:41:22Z ! pattern F ioc_pattern_f_smark_envelope S_MARK/E_MARK harvester envelope in /root/.bash_history | 2026-04-29T16:41:24Z ! pattern A ioc_pattern_a_ransom_readme /home/user1/README.md | … (22 more Pattern A ransom_readme events across customer homedirs) | 2026-04-29T16:42:09Z ! pattern A ioc_pattern_a_sorry_files_present 608 .sorry-encrypted files present | 2026-04-29T17:52:58Z ! pattern D ioc_pattern_d_acctlog_encrypted /var/cpanel/accounting.log.sorry
| -- DEFENSES -- | 2026-04-29T23:48:21Z + DEFENSE mitigate_first sessionscribe-mitigate.sh first run | 2026-04-29T23:48:21Z + DEFENSE csf csf.conf cpsrvd ports stripped | 2026-04-29T23:48:46Z + DEFENSE modsec modsec rule 1500030 installed
| -- POST-PARTIAL (1 event) -- | 2026-04-30T12:23:42Z ! pattern E ioc_pattern_e_handoff_burst_present 3 distinct external IPs each minted cpsess + reached websocket Shell within 15-min window
| HEADLINE | verdict COMPROMISED (score 315) | defense lag 37d 9h LATE (first IOC 2026-03-25T09:43:19Z, defense up 37d 9h later)
<details>
<summary><b>チェックリファレンス + フォレンジックフェーズ + バンドルレイアウト</b> (クリックして展開)</summary>
| チェック | 説明 |
|---|---|
| `version` | `cpanel -V` と公開済みパッチ適用ビルドリストの比較 - `code_verdict` を決定 |
| `static-pattern` | `Cpanel/Session/*.pm` をパッチ適用後のセンチネルパターン (`no-ob:` デコード分岐) で grep する |
| `cpsrvd-fingerprint` | パッチ適用済みビルドシグネチャに対する cpsrvd バイナリの検査 |
| `access-log` | Apache + cpsrvd ログから悪用トラフィック形状を確認 (`--no-logs` でスキップ) |
| `session-store` | `/var/cpanel/sessions/raw/` の走査: ベンダーIOC + 4-way共起 + 偽装タイムスタンプのヒューリスティック (`--no-sessions` でスキップ) |
| `destruction` | パターン A–G のプローブ: `/root/sshd` 暗号化プログラム、mysql-wipe、BTCインデックス、`nuclear.x86`、`sptadm` リセラー、`__S_MARK__` ハーベスター、不審なSSHキー (`--no-destruction-iocs` でスキップ) |
| `probe` (オプトイン) | `127.0.0.1:2087` への単一マーカーGET - cpsrvd が応答することを確認。バイパスは試行**しません** |
**`--full` フォレンジックフェーズ** (検出後にインラインで実行):
| フェーズ | 説明 |
|---|---|
| `defense` | 適用されたすべての防御レイヤーにタイムスタンプを付与: cpanelパッチ、パッチ後のcpsrvd再起動、mitigateの実行、ModSecルール、CSF/APFのポート閉鎖、proxysub、`upcp` サマリー |
| `offense` | 観測されたすべての侵害インジケーター (パターン A–G + パターン X CRLFバイパスチェーン) にタイムスタンプを付与 |
| `reconcile` | インジケーターごと: 最初に出現した時点で関連する防御は有効だったか? PRE-DEFENSE / POST-DEFENSE / POST-PARTIAL / UNDEFENDED + 時間デルタ |
| `bundle` | `/root/.ic5790-forensic/<TS>-<RUN_ID>/` 配下の生のアーティファクトのtarball、モード `0700` |
**バンドルレイアウト** (`/root/.ic5790-forensic/<TS>-<RUN_ID>/`):```
manifest.txt host/uid/cpv/run_id/window/cap
sessions.tgz /var/cpanel/sessions/{raw,preauth} (filtered)
access-logs.tgz cpsrvd access + incoming_http_requests + error_log
+ global Apache access/error (NO domlogs)
system-logs.tgz /var/log/{secure,messages,audit/audit.log,auth.log}*
cpanel-state.tgz accounting.log + resellers + cpanel.config + api_tokens_v2
cpanel-users.tgz /var/cpanel/users/ (split out, per-account state)
persistence.tgz ssh keys + all cron tiers + systemd/init.d/profile.d
+ rc.local + root histories + passwd/group + sudoers
defense-state.tgz mitigate backups + csf/apf/modsec configs + updatelogs
ps.txt / connections.txt / iptables.txt
pattern-a-binary-metadata.txt only if /root/sshd present (metadata; binary NOT bundled)
user-histories/ per-user .bash_history (gated on --no-history)
90日間のウィンドウを持つ稼働中のホストでの一般的なバンドル: 圧縮時で約250 MB – 2 GB。
ターボールごとの2 GB上限(--max-bundle-mb)により、容量超過の候補は個別に除外されます。
実行台帳はデフォルトで /var/cpanel/sessionscribe-ioc/ に書き込まれます
(--no-ledger で無効化)。--chain-forensic / --chain-on-critical /
--chain-upload は v1.x 後方互換エイリアスとして保持されます。
展開されたターボールに対するオフラインフォレンジック用のスナップショットテストのオーバーライド:
--root DIR, --version-string S, --cpsrvd-path P。フラグの完全な一覧は
--help を参照してください。
sessionscribe-mitigate.sh - 緩和オーケストレーターデフォルトでは読み取り専用(--check)。状態を変更するには --apply を追加します。
冪等: 正常なホストで再実行しても何も行いません(no-op)。変更を行う際は、
いかなるファイルにも触れる前に /var/cpanel/sessionscribe-mitigation/ の下に
タイムスタンプ付きバックアップを書き込みます。```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --apply
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --apply --only modsec --probe curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --only patch,preflight # pre-upcp gate
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --csv > host.csv curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --jsonl > host.jsonl
| フェーズ | 説明 |
|---|---|
| `patch` | `cpanel -V` と公開済みのパッチ適用ビルドリストを比較(EL6 11.86.0.41、EL6/CL6 110.0.103、tier 124、WP² 136.1.7 を含む) |
| `preflight` | `/etc/yum.repos.d/threatdown.repo` を削除。`epel-release` を確保。壊れた非ベースリポジトリを無効化して、`upcp` が途中で停止しないようにする |
| `upcp` | 未パッチの場合は `/scripts/upcp --force --bg` を開始 |
| `proxysub` | `proxysubdomains` と新規アカウント向けバリアントを有効化。httpd 設定を再構築 |
| `csf` / `apf` / `runfw` | `TCP_IN`/`TCP6_IN`/`IG_TCP_CPORTS` から cpsrvd ポート(2082/2083/2086/2087/2095/2096)を除去。稼働中の iptables INPUT チェーンを検証 |
| `apache` | `httpd` が実行中であり、`security2_module` がロードされていること |
| `modsec` | `modsec2.user.conf` にルール `1500030` と `1500031` が含まれていること。欠落している場合は配備(タイムスタンプ付きバックアップ、`httpd -t` による検証、graceful リロード) |
| `probe` (オプトイン) | `127.0.0.1` に対して `sessionscribe-remote-probe.sh` を実行し、実際に拒否が行われることを確認 |
CentOS / Alma / Rocky の base/appstream/extras/updates/powertools リポジトリは、
現在到達不能であっても、`preflight` によって**決して**無効化されません。
### 終了コード
| 終了コード | 意味 |
|---|---|
| 0 | クリーン - パッチ適用済み + 状態は正常、対応不要 |
| 1 | 修復が正常に適用されました(`--apply` が変更を行いました) |
| 2 | 手動介入が必要です(`--check` では警告、`--apply` では失敗) |
| 3 | ツールエラー(引数が不正、依存関係の欠落、`--apply` に root を使用していない) |
フェーズ選択: `--only LIST`、`--no-PHASE`、`--no-fw`(
`--no-csf --no-apf --no-runfw` の省略形)。出力: `--json` / `--jsonl` / `--csv`、
`-o FILE`。完全なフラグ一覧は `--help` を参照してください。
### 60秒スモークチェック```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --list-phases # surface the phase API
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh | bash -s -- --check # safe read-only audit
echo "exit=$?" # 0 on a non-cPanel host
オーケストレーターは非cPanelホストを検出し、クリーンに終了します — ラボを必要とせずに冪等性を証明しています。
sessionscribe-remote-probe.sh - 非破壊的フリートプローブサポート用の補助ツールです。4段階のチェーンを非破壊的にターゲットに対して実行します:preauth をミント → CRLF を注入 → raw→cache を伝播 → /json-api/version で検証し、その後アクティブにログアウトします。判定を決定するシグナルはステージ4のHTTPコードです:200、またはライセンスボディを伴う5xxはVULN、401または403はSAFEです。
すべてのテストセッションには、フォレンジッククリーンアップ用に nxesec_canary_<nonce> 属性がタグ付けされ、状態を変更するAPI呼び出しは一切行われません。偽造されたセッションは、ステージ3からステージ5のログアウトまでの間 ~1–3秒間 root と同等になります — 完全な安全性モデルについては、スクリプトのヘッダーを参照してください。```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh | bash -s -- --target 1.2.3.4
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh | bash -s -- --target 1.2.3.4 --proxy example.com
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh
| bash -s -- --csv $(awk '{print "--target "$1}' fleet.txt) > fleet.csv
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh | bash -s -- --target 1.2.3.4 --fingerprint-only
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh | bash -s -- --cleanup
出力モード: pretty (デフォルト)、`-q`/`--quiet`、`--oneline`、`--csv`、
`--json`。終了コード: `0` は VULN なし、`1` は判定不能のみ、`2`
は 1 つ以上の VULN。完全なフラグ一覧は `--help` を参照。以下も含む:
`--auto-host-discover`、`--all`、`--fingerprint-only` のセマンティクス、および
ステージ 2 専用の `--no-verify` モード (レガシー、パッチ適用済みホストで
FP を生成)。
---
## 補足資料
### `modsec-sessionscribe.conf` - ModSecurity ルールパック
`mitigate.sh --apply --only modsec` によって自動的にデプロイされます。手動
インストール:```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/modsec-sessionscribe.conf \
| sudo tee /etc/apache2/conf.d/modsec/modsec2.user.conf >/dev/null
sudo apachectl -t && sudo /usr/local/cpanel/scripts/restartsrv_httpd
ID 範囲予約: 1500000–1500099。WHM トークンルールは @ipMatch を
オペレーター定義のトラストリストに対して使用します。デプロイ前にファイル先頭の
CIDR を編集してください。
[!IMPORTANT] これらのルールは Apache 内で実行されます。
cpsrvdは 2082/2083/2086/2087/2095/2096 で直接リッスンし、Apache とは独立して到達可能です。 ルールパックと、cpsrvd ポートを管理 CIDR に限定するファイアウォールを併用してください。
sessionscribe-revsnap.sh - RE スナップショット収集ツールティアごとの tarball(バイナリ、文字列、dynsym、disasm、Perl
モジュール、ランタイムレイアウト)を取得し、cPanel アップグレード間のバイナリ差分に使用します。
upcp を起点に、パッチ適用前後のペアを取得します。```bash
curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-revsnap.sh | bash
/scripts/upcp --force curl -fsSL https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-revsnap.sh | bash
SessionScribe を超えて一般化します。将来のすべての cpsrvd CVE はほぼ同じ攻撃面に該当し、
パッチ適用前と適用後のビルドの tarball ペアがあれば、
分析が数時間で済むか数日かかるかの分かれ目となります。
完全な RE ウォークスルーについては、[研究記事](https://rfxn.com/research/cpanel-sessionscribe-cve-2026-41940)
を参照してください。
---
## フリートでの使用
> [!TIP]
> すべてのアーティファクトは構造化出力(`--json`、`--jsonl`、`--csv`)を生成し、すべてのレコードに
> `host`、`os`、`cpanel_version`、`ts` が含まれます。
> `pdsh | jq` または `ansible -m script` で、数百台のホストを一度に
> ロールアップするように設計されています。
同じ curl-piped-bash プリミティブ — 各ホストに
最新のスクリプトを直接フェッチして実行させます:```bash
IOC=https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-ioc-scan.sh
MIT=https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-mitigate.sh
PRB=https://raw.githubusercontent.com/rfxn/cpanel-sessionscribe/main/sessionscribe-remote-probe.sh
# IOC scan across fleet, JSONL to SIEM
for h in $(cat fleet.txt); do
ssh "$h" "curl -fsSL $IOC | bash -s -- --jsonl --quiet"
done | jq -c '.' > fleet-ioc.jsonl
# kill-chain reconciliation across fleet (no bundles on broad sweep)
ansible -i hosts cpanel -m shell \
-a "curl -fsSL $IOC | bash -s -- --full --no-bundle --jsonl" > fleet-forensic.jsonl
jq -r 'select(.phase=="summary" and .key=="verdict"
and .note=="COMPROMISED_PRE_DEFENSE") | .host' \
fleet-forensic.jsonl > pre-defense-hosts.txt
# bundle collection on the pre-defense subset
ansible -i pre-defense-hosts.txt all -m shell \
-a "curl -fsSL $IOC | bash -s -- --full --jsonl --bundle-dir /root/.ic5790-forensic"
# mitigation posture roll-up
pdsh -w cpanel-fleet "curl -fsSL $MIT | bash -s -- --jsonl --quiet" \
| jq -c 'select(.severity != "info")' > fleet-mitigate.jsonl
# remote probe sweep - exit 2 on any VULN (run from operator workstation)
curl -fsSL $PRB | bash -s -- --csv --quiet \
$(awk '{print "--target "$1}' fleet.txt) > fleet-probe.csv
プローブは独立してフリートセーフです(カナリアタグ付きセッション、
能動的なログアウト、状態を変更するAPI呼び出しなし)。ホスト上のスクリプトは
--quiet および構造化出力フラグを尊重するため、stdout はパーサーにとってクリーンです。
4つのHTTPリクエスト、認証なし、前提条件なし:```mermaid sequenceDiagram autonumber actor A as attacker participant C as cpsrvd participant S as session file A->>C: POST /login/?login_only=1 with user=root, pass=wrong C-->>A: Set-Cookie · whostmgrsession=NAME,OBHEX A->>C: GET / · Authorization Basic b64(root:x + CRLF payload) · Cookie minus OBHEX C->>S: writes pass=x, user=root, hasroot=1, ... (CRLFs land verbatim) C-->>A: HTTP 307 · Location /cpsess[10digits]/ A->>C: GET /scripts2/listaccts · cookie only C->>S: propagate raw to cache · forged keys now readable C-->>A: 401 token denied (side-effect already done) A->>C: GET /cpsess[token]/json-api/version C-->>A: 200 OK means VULN · 403 means SAFE
Verdict is the HTTP code at request 4. The on-disk session file at
`/var/cpanel/sessions/raw/<sessname>` is the only post-hoc forensic
artifact. The full primitive (the two composing asymmetries —
`filter_sessiondata` not on every write path, encoder short-circuits
on missing `ob_part`) and the architectural argument for proxy-endpoint
enforcement are in the
[research article](https://rfxn.com/research/cpanel-sessionscribe-cve-2026-41940).
---
## 侵害の痕跡
偽造されたセッションファイルの形状(悪用後の `/var/cpanel/sessions/raw/<sessname>`):```
local_port=2087
hasroot=1
hulk_registered=1
pass=x
origin_as_string=address=127.0.0.1,app=whostmgrd,method=badpass
token_denied=1
local_ip_address=127.0.0.1
external_validation_token=cS9C19OfV0hCA4uD
cp_security_token=/cpsess6844364556
ip_address=127.0.0.1
user=root
tfa_verified=1
successful_internal_auth_with_timestamp=9999999999
port=39040
login_theme=cpanel
通常の preauth セッションには pass=、hasroot=1、
user=root、tfa_verified=1、または
successful_internal_auth_with_timestamp= が含まれることは決してありません。これらのいずれかが
origin_as_string=…method=badpass と組み合わされていれば診断的です。now+365d を超える
偽造タイムスタンプ値(例: 9999999999)も、単独で診断的です。```bash
for f in /var/cpanel/sessions/raw/*; do
[ -f "$f" ] || continue
if grep -q '^token_denied=' "$f"
&& grep -q '^cp_security_token=' "$f"
&& grep -q '^origin_as_string=.*method=badpass' "$f"; then
echo "IOC0 hit: $f"
fi
done
アクセスログシグナル: 同一セッションウィンドウ内で先行する `/login/` 200 がない、
非ベースラインの送信元 IP からの `/json-api/`、`/execute/`、または `/scripts2/` パスへの
成功した `200`/`302`/`307` レスポンス。
---
## 影響を受けるビルド```
11.86.0.41 (EL6/CL7) 11.110.0.97 11.118.0.63 11.124.0.35
11.126.0.54 11.130.0.19 11.132.0.29 11.134.0.20
11.136.0.5 110.0.103 (EL6/CL6 from .50)
WP Squared: 136.1.7
ベンダーパッチ一覧から除外されたティアにはその場での修正手段がありません: 112, 114, 116, 120, 122, 128。これらのティア上のホストは、パッチ済みのメジャーシリーズへの アップグレード、移行、または修正が完了するまで cpsrvd リスナーのファイアウォールによる 保護が必要です。
11.86.0.41 (EL6/CL7) は04/29のアドバイザリ改訂で追加され、同じ改訂で11.130
は .18 から .19 に引き上げられました。その後の改訂で 11.124.0.35
(ティア124の以前のギャップを解消)と、依然として v110.0.50 を使用している
EL6/CL6 ホスト向けの直接アップグレード先として 110.0.103 が追加されました。
即時
sessionscribe-ioc-scan.sh を全台で実行してください。パッチ適用済みホストでも侵害されている可能性があります。今後の対応
@ipMatch トラストリストを設定した modsec-sessionscribe.conf を modsec2.user.conf に展開します。プロキシエンドポイント強制のアーキテクチャ上の根拠は、リサーチ記事 の最後の3分の1に記載されています。
cpsrvd、cpsrvd.so、Cpanel/Session/*.pm を変更しません。お使いのティア向けにcPanelが発行するバックポートが実際の修正です。proxysub + ファイアウォールフェーズと ModSec ルールパックは爆発半径を縮小しますが、アップグレードまたは移行が唯一の恒久的な解決策です。nxesec_canary_<nonce> 属性をタグ付けし、積極的にログアウトします。ioc-scan は以前の悪用の痕跡を検出しますが、それらを修復するものではありません。その COMPROMISED 判定は結論ではなく、本格的なIRを開始するトリガーとして扱ってください。[!TIP] バグを発見しましたか、見逃したIOC、誤検知、または運用フィードバックがありますか? GitHub イシューを開く - バグ報告、実環境で確認されたIOC亜種、パッチ適用済み/未適用ホストでの検知漏れ、ModSecルールの誤検知、一般的な運用者からのフィードバックをすべて歓迎します。
機密性の高い開示(実行中の悪用の証拠、顧客データ、まだ公開されていない新しいエクスプロイトチェーン)は、GH Issues ではなく Keybase または email で送信してください。
GPL v2。各ファイルのヘッダーを参照してください。
SessionScribeインシデント対応中に作成 - Ryan MacDonald, R-fx Networks.
| 終了コード | コード状態 | ホスト状態 | トリアージアクション |
|---|
| 0 | CLEAN/PATCHED | CLEAN | なし |
| 1 | VULNERABLE | (任意) | cpsrvd にパッチを適用 |
| 2 | INCONCLUSIVE | (任意) | コード状態の手動レビュー(ツールエラーも含む) |
| 3 | (任意) | SUSPICIOUS | セッション/アクセスログをレビュー |
| 4 | (任意) | COMPROMISED | 完全なIR; バンドル + アップロード |
| ルール | 対象 | アクション |
|---|
1500030 | Authorization: Basic デコード済みペイロード内の CRLF | 拒否、すべてのソース、すべてのパス |
1500031 | whostmgrsession Cookie に有効な ,OBHEX サフィックスがない | 拒否(多層防御) |
1500010 | /json-api/、/execute/、/acctxfer*/ 上の Authorization: WHM | ソースがトラストリストにない場合は拒否 |
1500020 | WebSocket ディスパッチファミリー上の Authorization: WHM | ソースがトラストリストにない場合は拒否 |
1500021 | SSE ディスパッチパス上の Authorization: WHM | ソースがトラストリストにない場合は拒否 |