repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
local-ntlm-reflection-via-smb-arbitrary-port.mdMarkdown115 lines6.9 KiBsource raw download

title: "Local NTLM Reflection via SMB Arbitrary Port" section: "Windows" sectionSlug: "windows-hardening" sourcePath: "src/windows-hardening/windows-local-privilege-escalation/local-ntlm-reflection-via-smb-arbitrary-port.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/windows-hardening/windows-local-privilege-escalation/local-ntlm-reflection-via-smb-arbitrary-port.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Local NTLM Reflection via SMB Arbitrary Port#

Recent Windows builds introduced SMB client support for alternative TCP ports. That feature can be abused to turn local NTLM authentication into a SYSTEM local privilege escalation when the attacker can:[1]

  1. Open an SMB connection to an attacker-controlled listener on a non-445 port
  2. Keep that TCP connection alive
  3. Coerce a privileged local client to access the same SMB share path
  4. Relay the resulting local NTLM authentication back to the machine's real SMB service

This is the primitive behind CVE-2026-24294, patched in March 2026.[1][4]

Why it works#

The older CMTI / serialized-SPN reflection trick is covered here:

Readme

This newer variant does not need a marshalled hostname. Instead it abuses two SMB client behaviours:[1]

That means a low-privileged user can first create a TCP connection from the SMB client to an attacker SMB server on a high port, then coerce a privileged service to access the exact same UNC path. If Windows decides to reuse the existing TCP connection, the privileged NTLM exchange is sent over the attacker-controlled transport and can be relayed to the local SMB server.[1]

Preconditions#

Userland and internals#

From the command line the feature looks simple:

net use \\192.168.56.3\share /tcpport:12345

Programmatically, the client uses WNetAddConnection4W with undocumented lpUseOptions data. The relevant option is TraP (transport parameters), which eventually reaches the kernel SMB client through an FSCTL and is parsed by mrxsmb.[1][3]

Important practical notes:[1]

Exploitation flow#

1. Create the attacker-controlled SMB transport#

Run an SMB server on a high port and make Windows connect to it:

net use \\192.168.56.3\share /tcpport:12345

The server can accept any credential pair you control, for example user:user. The goal of this step is not privilege escalation yet, only to make the Windows SMB client open and keep a reusable TCP connection to your listener.[1]

2. Coerce a privileged service to the same UNC path#

Use a coercion primitive such as PetitPotam against the same \\192.168.56.3\share path. If the coerced client is privileged and the target name is local (localhost or a local IP/host), Windows performs NTLM local authentication.

Because the TCP connection is reused, that privileged NTLM exchange travels to the attacker SMB service instead of directly to the real local SMB server.[1]

3. Relay the privileged authentication back to local SMB#

The attacker-controlled SMB service forwards the privileged NTLM exchange to ntlmrelayx.py, which relays it to the machine's real SMB listener and obtains a session as NT AUTHORITY\SYSTEM.[1]

Typical tooling from the public writeup:[1]

Operator notes#

Detection and hardening#

References#