一个安全、无依赖的扫描器,用于对 NGINX 服务器进行指纹识别,以检测 F5 于 2026-11-18 披露的两个 HTTP/2 内存破坏漏洞:
| CVE | 类别 | 受影响的 NGINX OSS | 影响 |
|---|---|---|---|
| CVE-2026-123007 | HTTP/2 流控整数下溢 → 堆缓冲区溢出(CWE-191 → CWE-787) | 1.9.5 – 1.31.0 | Worker 崩溃(DoS);在 ASLR 关闭/被绕过的情况下可导致 RCE |
| CVE-2026-123633 | 反向代理配置中低 worker_connections 下的 HTTP/2 释放后使用(CWE-416) | 1.19.7 – 1.31.0 | Worker 崩溃(DoS);在 ASLR 关闭/被绕过的情况下可导致 RCE |
该扫描器是非破坏性的。它从不尝试触发漏洞(那可能导致目标崩溃,且真正的触发方式尚未公开)。相反,它检查两个网络可观测的前提条件:HTTP/2 是否实际被提供,以及所报告的 NGINX 版本是否处于受影响范围内。
h2)或明文 h2c(prior-knowledge 前导)检测 HTTP/2。Server 响应头获取版本指纹,并与每个 CVE 的版本范围进行匹配。git clone https://github.com/<your-org>/nginx-http2-cve-scanner.git
cd nginx-http2-cve-scanner
python3 scanner.py --help
或者直接下载 scanner.py 并运行它。
python3 scanner.py [targets ...] [options]
Targets:
host[:port] cleartext h2c (default port 80)
https://host TLS (ALPN h2), default port 443
host:port with --tls for TLS on a custom port
10.0.0.0/24[:port] a CIDR is expanded to one scan per host address
Options:
-f, --input FILE read targets from FILE (one per line, '#' comments);
'-' means stdin; may be given multiple times
--stdin also read targets from stdin
--tls force TLS (ALPN h2) for bare host[:port] targets
--timeout SECONDS per-connection timeout (default 5.0)
-w, --workers N concurrent scans (default 20)
--json emit JSON
--csv FILE write CSV to FILE ('-' = stdout)
--only-affected print only affected targets
# single target (cleartext HTTP/2)
python3 scanner.py scanme.example.com
# TLS target
python3 scanner.py https://scanme.example.com
python3 scanner.py --tls scanme.example.com:8443
# bulk from a file, 50 workers, only show hits
python3 scanner.py -f targets.txt -w 50 --only-affected
# scan a whole subnet
python3 scanner.py 10.0.0.0/24 -w 100
# read targets from a pipe
cat hosts.txt | python3 scanner.py -f -
# machine-readable output
python3 scanner.py -f targets.txt --csv results.csv
python3 scanner.py -f targets.txt --json > results.json
========================================================================
10.0.0.5:80 (h2c)
Server : nginx/1.27.4
HTTP/2 : yes
[!] CVE-2026-123007 likely-affected
nginx 1.27.4 is in the affected range 1.9.5..1.31.0; needs HTTP/2 enabled (present here)
[!] CVE-2026-123633 likely-affected
nginx 1.27.4 is in the affected range 1.19.7..1.31.0; also needs reverse-proxy config + worker low on worker_connections (verify locally)
========================================================================
[*] summary: 1 scanned, 1 affected, 0 error(s)
| 判定结果 | 含义 |
|---|---|
likely-affected | 已提供 HTTP/2 服务,且版本处于受影响范围内 |
potentially-affected | 已提供 HTTP/2 服务,但版本被隐藏(server_tokens off);请手动核实构建版本 |
not-affected | 版本不在受影响范围内 |
not-exposed | 此端点未提供 HTTP/2 服务 |
| 退出码 | 含义 |
|---|---|
2 | 至少有一个目标为 likely-affected 或 potentially-affected |
1 | 没有目标受影响,但至少有一次扫描出错 |
0 | 所有目标扫描结果均无问题 |
h2,检查服务器是否选择它。对于明文,它发送 HTTP/2 连接前言加上一个空的 SETTINGS 帧,并检查服务器是否以自己的 SETTINGS 帧回复。GET / 读取 Server 头并解析 nginx/X.Y.Z 版本。由于 CVE-2026-123633 还要求反向代理配置以及 worker_connections 不足的 worker,而这两者都无法通过网络观察到,因此该漏洞的阳性结果会附带“本地核实”的说明。
Server 头;隐藏或伪造的 banner 会降低可信度(报告为 potentially-affected)。1.31.0 的版本视为超出范围。http2 off;)。对于 CVE-2026-123633,还需为 worker_connections 设置具有真实余量的值,以免 worker 资源耗尽。仅扫描你拥有或明确获授权测试的系统。该扫描器是非破坏性的,但未经授权的扫描在你的司法管辖区内仍可能违法。你对如何使用它负责。
为 SECPlayground Platform 开发 — https://www.secplayground.com