HTTP/2 Bomb (CVE-2026-49975) 非破坏性漏洞检测工具 — 针对 Nginx / Apache httpd
CVE-2026-49975 是一个影响广泛的 HTTP/2 协议层远程拒绝服务漏洞,由安全研究员 Quang Luong 发现。该漏洞利用 HPACK 头部压缩 和 流控制机制 的组合性设计缺陷,攻击者无需身份验证即可在 10-20 秒内耗尽服务器 32GB 内存。
| 服务器 | 受影响版本 | 放大比 | 修复状态 |
|---|---|---|---|
| Apache httpd | 2.4.17 – 2.4.67 (mod_http2 < 2.0.41) | ~4,000:1 | ✅ 已修复 |
| Nginx | < 1.29.8 | ~70:1 | ✅ 已修复 |
| Envoy | ≤ 1.37.2 | ~5,700:1 | ❌ 未修复 |
| Microsoft IIS | 含 Windows Server 2025 | ~68:1 | ❌ 未修复 |
| Cloudflare Pingora | ≤ 0.8.0 | ~62:1 | ❌ 未修复 |
本工具基于真实 PoC 实现,采用两种检测模式:
探测 HPACK 索引引用炸弹:插入动态表项 ("a", ""),然后发送索引引用。每个引用 1 byte 线上 → 59 bytes 服务器内存(3B pool copy + 56B ngx_table_elt_t)。攻击参数 refs=32000,检测仅用 refs=3。
探测 Cookie crumb 合并炸弹:利用 mod_http2 的 Cookie 合并机制(apr_table_setn 用 "; " 连接重复 cookie),合并后的 cookie 不计入 LimitRequestFields。攻击参数 refs=4091(~4000:1 放大),检测仅用 refs=3。
ENHANCE_YOUR_CALM → 🛡️ 已部署防护RST_STREAM 拒绝 → 🛡️ 有防护GOAWAY → 🛡️ 有防护零依赖,仅使用 Python 标准库(ssl, socket, struct)。
git clone https://github.com/adminlove520/http2-bomb-detector.git
cd http2-bomb-detector
需要 Python 3.7+。
# 自动检测(Nginx + Apache 两种模式)
python http2_bomb_detector.py --host example.com
# 指定模式
python http2_bomb_detector.py --host example.com --mode nginx
python http2_bomb_detector.py --host example.com --mode httpd
# 指定端口
python http2_bomb_detector.py --host example.com --port 8443
# 仅输出漏洞信息,不发送探测包
python http2_bomb_detector.py --host example.com --no-probe
# JSON 格式输出
python http2_bomb_detector.py --host example.com --json
# 从文件读取目标列表
python http2_bomb_detector.py -f targets.txt
# 输出报告
python http2_bomb_detector.py -f targets.txt -o report.txt
targets.txt 格式(每行一个,# 开头为注释):
# Web 服务器列表
example.com
https://example.org:8443
192.168.1.100
[INFO] 连接 example.com:443 ...
[OK] HTTP/2 连接建立
[INFO] --- NGINX 模式检测 ---
[INFO] 攻击向量: HPACK 索引引用炸弹:动态表项 ('a','') × 32000 引用
[INFO] 修复版本: 1.29.8 | 放大比: ~70:1
[INFO] 发送探测包 (refs=3, 非破坏性)...
[WARN] ⚠️ 服务器静默接受探测包 — 可能受影响!
[INFO] --- HTTPD 模式检测 ---
[INFO] 攻击向量: Cookie crumb 合并炸弹:空 cookie × 4091 引用
[INFO] 修复版本: mod_http2 2.0.41 / httpd 2.4.68 | 放大比: ~4000:1
[INFO] 发送探测包 (refs=3, 非破坏性)...
[OK] 服务器 RST_STREAM 拒绝探测流 — 有防护
==================================================
🛡️ NGINX: potentially_vulnerable
⚠️ HTTPD: protected
本工具仅用于授权安全测试。使用本工具检测未授权的目标可能违反法律。使用者需自行承担所有法律责任。
MIT