NTLM Relay
Also calledSMB relay, LDAP relay, Relay attack
Passes a victim's NTLM sign-in to another server and keeps the session it opens.
- Needs
- Incoming Sign-In
- Gives
- Account Access
How the Attack Works
An NTLM response proves the client knows the NT hash for one challenge, but nothing stops a machine in the middle passing it to a different server, unless that server checks the name or channel it was made for, or the session is signed. The relaying machine passes the victim's messages to a server of its choosing, hands the victim that server's own challenge, and keeps the session that opens. It never learns the hash, because the server has the DC check the response and the DC approves it as it would any other. A message integrity code over all three messages stops it removing the client's request for signing, and where signing is then in force, the session it keeps is useless.
Read first Certificate Sign-In (PKINIT), NTLM Challenge, NTLM Authenticate and Validation, LM, NTLMv1 and NTLMv2
How It Plays Out
The attack step by step. Each step shows which machines take part, what travels, the keys and tickets each side now holds, what is logged and what a defender can see.
ws-017 Client
- dana's key
192.0.2.66 Unknown device
srv-fin-01 File server
- srv-fin-01 key
- Netlogon key
- Step 1 of 6, Negotiate, ws-017 to 192.0.2.66
- Step 2 of 6, Negotiate, Passed On, 192.0.2.66 to srv-fin-01
- Step 3 of 6, Server's Challenge, 192.0.2.66 to ws-017
- Step 4 of 6, Authenticate, ws-017 to 192.0.2.66
- Step 5 of 6, Answer, Passed On, 192.0.2.66 to srv-fin-01
- Step 6 of 6, Access as dana, srv-fin-01 to 192.0.2.66
Step 1 of 6: Negotiate
ws-017 Client to 192.0.2.66 Unknown device
ws-017, sent to the wrong machine by a poisoned answer or a forced callback, starts NTLM with the unknown device.
What Defenders See
No machine in the domain records this step in its Security log. Where NTLM auditing is on, look for event 8001 or 4020 in the Microsoft-Windows-NTLM/Operational log on ws-017, naming a target no server holds.
Hooks into NTLM negotiate
Step 2 of 6: Negotiate, Passed On
192.0.2.66 Unknown device to srv-fin-01 File server
The device opens its own SMB session to srv-fin-01 and passes the victim's negotiate message on.
What Defenders See
Endpoint or network data shows an SMB session to srv-fin-01 from 192.0.2.66, an address with no DHCP lease.
Hooks into NTLM negotiate
Step 3 of 6: Server's Challenge
192.0.2.66 Unknown device to ws-017 Client
The device hands ws-017 srv-fin-01's own challenge, so the answer it gets back will be valid at srv-fin-01.
What Defenders See
The challenge travels in the clear, and no log on ws-017 or any other machine records it.
Hooks into NTLM challenge
Step 4 of 6: Authenticate
ws-017 Client to 192.0.2.66 Unknown device
ws-017 answers with dana's name and an NTLMv2 response computed over srv-fin-01's challenge.
What Defenders See
No log on any machine in the domain records this step, because ws-017's answer goes to the unknown device.
Hooks into NTLM authenticate
Step 5 of 6: Answer, Passed On
192.0.2.66 Unknown device to srv-fin-01 File server
The device forwards dana's answer unchanged, and srv-fin-01 has dc-01 check it as it would any sign-in.
What Defenders See
The Security log on dc-01 shows event 4776 for dana with Source Workstation WS-017, the same as for any sign-in of hers.
Hooks into NTLM authenticate
Step 6 of 6: Access as dana
srv-fin-01 File server to 192.0.2.66 Unknown device
srv-fin-01 accepts the session as dana and the device keeps it. Unless signing is required, it now acts as her there.
What Defenders See
The Security log on srv-fin-01 shows event 4624 with Workstation Name WS-017 but Source Network Address 192.0.2.66. Where enhanced NTLM logging runs, its Microsoft-Windows-NTLM/Operational log shows event 4022 with the same mismatch.
Hooks into NTLM access
Needs First
What the attacker must already hold for this attack to be possible.
- An Incoming Sign-InA victim signing in to the relaying machine, after poisoning or coercion.
Comes From
- Incoming Sign-In: LLMNR, NBT-NS and mDNS Poisoning, Forced Authentication (Coercion)
Gives the Attacker
What running it hands the attacker to use next.
- Access as Another AccountA session on the target server as the victim, without ever learning the victim's hash.
What Defenders See
What this attack leaves for a defender to find, and what to read in each. None of it is proof on its own, so treat each as a lead and confirm it against the rest.
| Event and Log | Written On | Look For | Switch It On |
|---|---|---|---|
| 4624 An account was successfully logged on (opens in a new tab) Security log | The computer that was logged on to | Workstation Name of the victim's machine but a Source Network Address that is not its own, with Authentication Package NTLM.Reading Logon Events explains how to read it. | Audit Logon |
| 4022 and 4023 A remote client is using NTLM to authenticate to this workstation (opens in a new tab) Microsoft-Windows-NTLM/Operational log | The server the NTLM sign-in reaches (4023 flags a weaker one, such as NTLMv1) | On the server, a Client Machine whose Client IP does not match it. Channel Binding and MIC Status show what the client sent. | On by default on Windows 11 24H2, Windows Server 2025 and, with October 2026 updates, Windows Server 2019 and 2022. The NTLM Enhanced Logging policy (System > NTLM) controls it |
| 4776 The computer attempted to validate the credentials for an account (opens in a new tab) Security log | The computer that holds the account, a domain controller for a domain account or the computer itself for a local one | On the DC, an ordinary success for the victim, where Source Workstation is the name the message claimed, not where it came from.NTLM Authenticate and Validation explains how to read it. | Audit Credential Validation |
| 5168 SPN check for SMB/SMB2 failed (opens in a new tab) Security log | The server that holds the share | Where the server checks SPNs, a sign-in refused because the client meant to reach a different name. | Audit File Share |
| 2889 The following client performed a SASL (Negotiate/Kerberos/NTLM/Digest) LDAP bind without requesting signing (integrity verification) (opens in a new tab) Directory Service log | Domain controllers | Clients and accounts trying unsigned LDAP binds, the kind a relay to LDAP depends on while DCs still accept them. | The 16 LDAP Interface Events diagnostic setting at 2 (Basic) on each domain controller |
| 3039 The following client performed an LDAP bind over SSL/TLS and failed the LDAP channel binding token validation (opens in a new tab) Directory Service log | Domain controllers | A bind over TLS that failed channel binding, a sign-in arriving over a connection it was not made on. | The 16 LDAP Interface Events diagnostic setting at 2, with the LDAP channel binding policy at When Supported or Always |
What It Looks Like
One event from the worked example, decoded field by field, so you can see what to read in it and what each value means.
4624 An account was successfully logged on
In the Security log on srv-fin-01,
dana's sign-in, relayed, with her workstation's name but another machine's address.
The victim the session runs as. dana did sign in, but to the unknown device, not to srv-fin-01.
As Windows writes it:
Account NamedanaA network logon, as an SMB session is.
As Windows writes it:
Logon Type3The name inside the NTLM message, the victim's machine, which the relaying device passed on unchanged.
As Windows writes it:
Workstation NameWS-017The address that actually connected, which is not ws-017's 192.0.2.17 and has no DHCP lease. A mismatch like this is what a relay leaves.
As Windows writes it:
Source Network Address192.0.2.66NTLM, where a domain client reaching srv-fin-01 by its name would normally use Kerberos.
As Windows writes it:
Authentication PackageNTLMNTLMv2 alone does not stop a relay. Signing, channel binding or a name check on the server does.
As Windows writes it:
Package Name (NTLM only)NTLM V2
Defender for Identity Alerts
Where Defender for Identity runs, its sensors raise these from what they read on the servers they are installed on, domain controllers above all. Each names what it flags, which is a lead to confirm, not proof on its own.
- Suspected NTLM relay attack (Exchange account) (opens in a new tab)An Exchange server's own sign-in used from a suspicious source.
- Suspected NTLM authentication tampering (opens in a new tab)A machine in the middle removing the message integrity code (CVE-2019-1040).
- Suspicious Domain Controller certificate request (ESC8) (opens in a new tab)A DC's sign-in relayed to certificate web enrolment.
- Suspicious Active Directory Certificate Services (AD CS) machine certificate issuance abuse (ESC8) (opens in a new tab)A machine certificate issued in a way that fits a relayed sign-in.
Blind Spots
Where this attack leaves little or nothing to see, so a quiet log is not read as an all-clear.
- The victim's machine writes at most its own outgoing NTLM events, and the DC's 4776 looks like any sign-in, so the mismatch on the target is the main sign.
- Required SMB signing makes the session useless, but the logon has already succeeded, so a 4624 can appear with no access following it.
Hunt It
The query to run in each tool, and how well each one sees this attack. Pick the tool you use, and the others load their query when you open them.
Needs Defender for Endpoint on the servers and the workstations. Printers and other unmanaged devices also sign in with NTLM, so a hit is an address to explain. A relayed logon names the victim's workstation in RemoteDeviceName but comes from the relaying machine's address.
// NTLM network logons from addresses that belong to none of your onboarded deviceslet Known = DeviceNetworkInfo | where Timestamp > ago( 30d) | mv-expand Entry = parse_json( IPAddresses) | project Address = tostring( Entry.IPAddress) | distinct Address;DeviceLogonEvents| where Timestamp > ago( 30d)| where ActionType == "LogonSuccess" and LogonType == "Network" and Protocol =~ "NTLM"| where isnotempty( RemoteIP) and RemoteIPType != "Loopback" and RemoteIP !in ( Known)| project Timestamp, DeviceName, AccountDomain, AccountName, RemoteDeviceName, RemoteIP| order by Timestamp descHow to Prevent It
The controls that break this attack, each with how it helps here and, where the Registry topic has it, where to check it on a machine.
SMB signing (opens in a new tab)
Require SMB signing on every server. Windows 11 24H2 Enterprise, Pro and Education require it both ways, but a Windows Server 2025 file server does not require it of clients by default.
SMB server SPN validation (opens in a new tab)
Have SMB servers check the name the client meant to reach, and refuse sign-ins meant for another machine.
LDAP signing (opens in a new tab)
Require LDAP signing on domain controllers, so a relayed sign-in cannot bind unsigned.
LDAP channel binding (opens in a new tab)
Require channel binding for LDAP over TLS, so a sign-in relayed over another connection is refused.
Extended Protection for Authentication (opens in a new tab)
Require Extended Protection on AD CS web enrolment and other NTLM web services. Windows Server 2025 turns it on for AD CS, for clients that support it.
NTLM restrictions (opens in a new tab)
Audit, then refuse, NTLM wherever Kerberos works, which leaves less to relay.
Sources
- MITRE ATT&CK T1557.001: Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay (opens in a new tab)
- MSRC: Mitigating NTLM Relay Attacks by Default (opens in a new tab)
- [MS-NLMP]: AV_PAIR, the target name and channel bindings in a response (opens in a new tab)
- Microsoft Learn: control SMB signing (opens in a new tab)
- Microsoft Learn: Server SPN target name validation level (opens in a new tab)
- Microsoft Support: LDAP channel binding and LDAP signing (KB4520412) (opens in a new tab)