Sploitus

Exploit for CVE-2026-41089

kitploit · 2026-09-01

Exploit Code

MARKDOWN136 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-JELASIN-CVE-2026-41089
# CVE-2026-41089

root@kitploit:~
    
    
     ██████╗██╗   ██╗███████╗    ██╗  ██╗ ██╗ ██████╗  ██████╗
    ██╔════╝██║   ██║██╔════╝    ██║  ██║███║██╔═████╗██╔═████╗
    ██║     ██║   ██║█████╗      ███████║╚██║██║██╔██║██║██╔██║
    ██║     ╚██╗ ██╔╝██╔══╝      ██╔══██║ ██║████╔╝██║████╔╝██║
    ╚██████╗ ╚████╔╝ ███████╗    ██║  ██║ ██║╚██████╔╝╚██████╔╝
     ╚═════╝  ╚═══╝  ╚══════╝    ╚═╝  ╚═╝ ╚═╝ ╚═════╝  ╚═════╝
    

**Windows Netlogon 远程代码执行:CLDAP 栈缓冲区溢出**

![CVSS](https://img.shields.io/badge/CVSS_3.1-9.8_CRITICAL-red?style=for-the-badge) ![CWE](https://img.shields.io/badge/CWE-121-orange?style=for-the-badge) ![Python](https://img.shields.io/badge/Python-3.8+-blue?style=for-the-badge&logo=python&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)

* * *

一个精心构造的 UDP 数据包发往 389 端口,即可在任何未打补丁的 Windows 域控制器上溢出 LSASS 内部的 528 字节栈缓冲区。LSASS 崩溃,DC 在约 60 秒内重启。无需任何凭据。

|   
---|---  
**攻击向量**|  UDP 389(CLDAP),预认证,零凭据  
**影响**|  LSASS 崩溃,DC 重启,潜在 RCE  
**CWE**|  CWE-121(基于栈的缓冲区溢出)  
**CVSS 向量**| `AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`  
**发布时间**|  2026 年 5 月 12 日,Microsoft  
  
* * *

## 快速开始

root@kitploit:~
    
    
    python3 poc.py 10.0.50.21 corp.local
    

该 PoC 先发送一个正常 ping,然后发送一个包含 130 字符用户名的溢出 ping,最后检查 DC 是否仍然存活。整个过程约 10 秒。

## 受影响系统

充当域控制器的 Windows Server 版本:

## 根本原因

`NlGetLocalPingResponse` 分配一个 528 字节的栈缓冲区,并将其传递给 `BuildSamLogonResponse`。该函数调用 `NetpLogonPutUnicodeString` 将服务器名称、域名、GUID 以及攻击者控制的用户名写入缓冲区。

缺陷在于:`NetpLogonPutUnicodeString` 接收的最大长度以字节为单位,却将其当作 WCHAR 计数来读取。通过该路径写入的每个字符串都会占用预期两倍的空间。CLDAP 过滤器中的“User”字段(最多 130 个 wchar,在线路上为 260 字节)将总写入量推过了 528 字节的边界。

root@kitploit:~
    
    
    I_NetLogonLdapLookupEx
      -> NlGetLocalPingResponse           // 528-byte stack buffer
        -> LogonRequestHandler
          -> BuildSamLogonResponse
            -> NetpLogonPutUnicodeString   // byte/WCHAR size confusion
    

## 用法

root@kitploit:~
    
    
    python3 poc.py <target_ip> <domain_name> [options]
    

标志| 说明| 默认值  
---|---|---  
`-l`| 用户名长度(字符数)| 130  
`-t`| UDP 接收超时(秒)| 5  
  
root@kitploit:~
    
    
    # Connectivity test (short username, no overflow)
    python3 poc.py 10.0.50.21 corp.local
    
    # Default overflow attempt
    python3 poc.py 10.0.50.21 corp.local -l 130
    
    # Larger payload, longer timeout for slow networks
    python3 poc.py 10.0.50.21 corp.local -l 200 -t 10
    

需要 Python 3.8+。无需第三方软件包。

## 工作原理

  1. **阶段 1.** 使用用户名“testuser”发送一个正常 CLDAP ping,以确认 DC 在 UDP 389 上响应。
  2. **阶段 2.** 发送相同的数据包,但将用户名改为 130 个以上“A”字符。过长的用户名溢出了 528 字节的栈缓冲区。如果 LSASS 崩溃,recv 调用将超时。
  3. **阶段 3.** 等待配置的延迟时间。发送一个正常 ping。若无响应,则说明 LSASS 已宕机。



该溢出导致 DoS(LSASS 崩溃,DC 重启)。栈破坏可能实现 RCE,但此 PoC 仅停留在 DoS 层面。

## 检测方法

**网络层面。** 留意“User”过滤器属性超过 20-30 个字符的 CLDAP 搜索请求。正常的 DC 定位器 ping 使用简短的服务帐户名称。

**主机层面。** 关注与 netlogon.dll 相关的 LSASS 崩溃(事件 ID 1000)。开启 Netlogon 调试日志:

root@kitploit:~
    
    
    nltest /dbflag:0x2080ffff
    

## 缓解措施

  * 安装 Microsoft 2026 年 5 月安全更新
  * 将 UDP 389 入站流量限制到受信任的管理子网
  * 超出 ESU 范围的旧版 Server:0patch 提供微补丁(一条指令的修复:`mov edx, 0x40` 将最大用户名长度减半)



## 参考资料

  * Microsoft 安全更新指南
  * NVD - CVE-2026-41089
  * 0patch 分析与微补丁
  * Aretiq AI 逆向工程
  * RFC 4511 - LDAP
  * MS-ADTS - CLDAP DC Locator



* * *

> **法律声明。** 本代码仅用于经授权的安全研究和教育目的。请仅对您拥有或已获得书面许可的系统进行测试。未经授权访问计算机系统违反 CFAA 及大多数司法辖区的同等法律。

**MIT 许可证**