cPanel 和 WHM 中的严重未认证 RCE。 四个 HTTP 请求即可通过向预认证会话的密码字段注入 CRLF 来伪造 root 会话。 无需认证、无需任何前置条件,所有受支持的版本分支均受影响。 由 Sina Kheirkhah 于 2026-04-28 披露 / watchTowr Labs。
[!IMPORTANT] 112、114、116、120、122、128 分支没有供应商补丁。 这些 分支上的每个构建版本都存在漏洞;升级或迁移是唯一 持久的修复方案。在此之前:将 TCP/2082、2083、2086、2087、2095、2096 通过防火墙限制到管理网段(
mitigate.sh --apply可完成此操作),并 用 ModSec 规则包加固其余攻击面。
三个单行命令,按操作者优先级顺序排列:```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
退出码专为机群自动化设计:`ioc-scan` 在 COMPROMISED 时退出 `4`,在 VULNERABLE 时退出 `1`;`mitigate` 退出 `0` 表示干净 / `1` 已应用 / `2` 手动 / `3` 工具错误;`remote-probe` 在任一目标为 VULN 时退出 `2`。
---
## 工具
按操作优先级排列。每个工件都会输出结构化结果(`--json` / `--jsonl` / `--csv`),并以 `host`、`os`、`cpanel_version`、`ts` 作为键,便于机群汇总。
| 工具 | 作用 | 运行位置 |
|---|---|---|
| **[`sessionscribe-ioc-scan.sh`](#sessionscribe-ioc-scansh---ioc-ladder--kill-chain)** | 一流的分类排查。IOC 阶梯、代码状态 + 主机状态判定、杀伤链重建、IR 捆绑包。 | 在 cPanel 主机上 |
| **[`sessionscribe-mitigate.sh`](#sessionscribe-mitigatesh---mitigation-orchestrator)** | 关闭攻击窗口。分阶段缓解:补丁检查、防火墙、proxysub、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。所有工件均可通过上方原始 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
两个维度独立报告。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 与防御激活情况进行比对,将每个 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` 中 grep 补丁后的哨兵模式(`no-ob:` 解码分支) |
| `cpsrvd-fingerprint` | 对照补丁构建签名检查 cpsrvd 二进制文件 |
| `access-log` | 在 Apache + cpsrvd 日志中查找利用流量特征(可用 `--no-logs` 跳过) |
| `session-store` | 遍历 `/var/cpanel/sessions/raw/`:供应商 IOC + 4 路共现 + 伪造时间戳启发式(可用 `--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` | 将原始工件打包为 tar 归档,存放于 `/root/.ic5790-forensic/<TS>-<RUN_ID>/`,权限 `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 以变更状态。
幂等:在健康主机上重复运行不会产生任何操作。变更操作
会先将带时间戳的备份写入 /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` 验证、优雅重载) |
| `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 | 工具错误(参数错误、缺少依赖、非 root 用户执行 `--apply`) |
阶段选择:`--only LIST`、`--no-PHASE`、`--no-fw`(`--no-csf --no-apf --no-runfw` 的简写)。
输出:`--json` / `--jsonl` / `--csv`、`-o FILE`。参见 `--help` 获取完整标志列表。
### 六十秒冒烟检查```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 - 非破坏性机群探测配套辅助脚本。以非破坏性方式对目标执行四阶段链路:生成预认证 → CRLF 注入 → 原始会话传播至缓存 → 通过 /json-api/version 验证,随后主动注销。判定依据是阶段 4 的 HTTP 状态码:200,或带 license 响应体的 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`
发现一个或多个 VULN。完整标志列表参见 `--help`,包括
`--auto-host-discover`、`--all`、`--fingerprint-only` 的语义,以及
仅 stage-2 的 `--no-verify` 模式(旧版,在已修补的主机上会产生误报
)。
---
## 配套资料
### `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(二进制文件、strings、dynsym、反汇编、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 管道至 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 对解析器保持干净。
四个 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
判定是第 4 次请求时的 HTTP 状态码。磁盘上的会话文件 `/var/cpanel/sessions/raw/<sessname>` 是唯一的事后取证痕迹。完整的原语(构成该原语的两个不对称性——`filter_sessiondata` 并非覆盖所有写入路径,编码器在缺少 `ob_part` 时会短路)以及关于代理端点强制实施的架构论证,请参阅[研究文章](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
A normal preauth session never contains pass=, hasroot=1,
user=root, tfa_verified=1, or
successful_internal_auth_with_timestamp=. Any of those combined with
origin_as_string=…method=badpass is diagnostic. A forged-timestamp
value beyond now+365d (e.g. 9999999999) is independently diagnostic.```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
访问日志信号:在同一个会话窗口内,来自非基线源 IP 的 `/json-api/`、`/execute/` 或 `/scripts2/` 路径上成功的 `200`/`302`/`307` 响应,且之前没有 `/login/` 200。
---
## 受影响的构建```
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 层此前存在的缺口)以及
110.0.103,作为仍停留在 v110.0.50 的 EL6/CL6 主机的
直接升级目标。
立即执行
sessionscribe-ioc-scan.sh。已修补的主机仍可能
被入侵。后续工作
modsec-sessionscribe.conf 部署到 modsec2.user.conf 中,并
设置 @ipMatch 信任列表。关于代理端点强制执行的架构论证,是 研究文章 最后三分之一的内容。
cpsrvd、cpsrvd.so 或
Cpanel/Session/*.pm。cPanel 为您的层级发布的反向移植补丁
才是真正的修复方案。proxysub + 防火墙阶段以及 ModSec 规则包
可以缩小爆炸半径;升级或迁移才是唯一持久的
解决方案。nxesec_canary_<nonce>
属性以便清理,并主动登出。ioc-scan 用于发现先前被利用
的痕迹;它不会修复这些痕迹。请将 COMPROMISED
判定视为启动全面 IR 的触发器,而非最终结论。[!TIP] 发现了 Bug、遗漏的 IOC、误报,或有运维反馈? 提交 GitHub Issue - 欢迎提交 Bug 报告、野外发现的 IOC 变体、已修补/未修补主机上的 检测遗漏、ModSec 规则误报以及一般的 运维反馈。
敏感信息披露(现场利用证据、客户数据、 尚未公开的新型漏洞利用链)应通过 Keybase 或 电子邮件 发送, 请勿通过 GitHub Issues 提交。
GPL v2。请参阅各个文件头部的说明。
在 SessionScribe 事件响应期间锻造而成 - Ryan MacDonald, R-fx Networks.
| 退出码 | 代码状态 | 主机状态 | 分流处置 |
|---|
| 0 | CLEAN/PATCHED | CLEAN | 无 |
| 1 | VULNERABLE | (任意) | 修补 cpsrvd |
| 2 | INCONCLUSIVE | (任意) | 手动代码状态审查(也指:工具错误) |
| 3 | (任意) | SUSPICIOUS | 审查会话/访问日志 |
| 4 | (任意) | COMPROMISED | 全面 IR;打包 + 上传 |
| Rule | Surface | Action |
|---|
1500030 | 解码后的 Authorization: Basic 载荷中的 CRLF | 拒绝,所有来源,所有路径 |
1500031 | whostmgrsession cookie 缺少有效的 ,OBHEX 后缀 | 拒绝(纵深防御) |
1500010 | 对 /json-api/、/execute/、/acctxfer*/ 的 Authorization: WHM | 当来源不在信任列表中时拒绝 |
1500020 | WebSocket 调度系列上的 Authorization: WHM | 当来源不在信任列表中时拒绝 |
1500021 | SSE 调度路径上的 Authorization: WHM | 当来源不在信任列表中时拒绝 |