4 Dec 2026Security news updated around the clock

NTLM

NTLM is Microsoft's challenge-response authentication protocol. It is the fallback when Kerberos cannot be used, and the main target of relay and hash attacks.

ProtocolsAdvancedUpdated 22 min read

Overview

NTLM (NT LAN Manager) is a challenge-response authentication protocol from Microsoft. A server sends a random challenge, the client answers with a value computed from that challenge and a hash of the user's password, and the server (or a domain controller on its behalf) checks the answer. The password itself never crosses the network.

In an Active Directory domain, Kerberos is the preferred protocol. NTLM is what Windows falls back to when Kerberos cannot be used: when a client connects to a server by IP address instead of name, when no domain controller is reachable, when the account is a local account, or when an application asks for NTLM directly. In most enterprise networks that still adds up to a large share of all authentication.

NTLM has no port of its own. Its three messages travel inside other protocols: SMB, HTTP, LDAP, RPC, SQL Server, SMTP, and the Remote Desktop credential exchange.

Defenders care because NTLM's design makes several attacks possible that Kerberos makes hard. The client cannot verify which server it is talking to, so an attacker in the middle can forward (relay) a victim's authentication to another server. The password hash is enough to log on, so a stolen hash works like a password (pass-the-hash). And captured challenge-responses can be cracked offline. Relay, coercion, and pass-the-hash remain common steps in real intrusions, including ones that end in ransomware.

History and evolution

EraVersionWhat changed
Late 1980sLAN Manager (LM)The LM hash: password converted to upper case, padded or cut to 14 characters, split into two 7-character halves, each used as a DES key. Very weak
1993NTLM (version 1)Shipped with Windows NT 3.1. Introduced the NT hash: MD4 of the password in UTF-16 little-endian. Responses still built with DES
1998NTLMv2Introduced in Windows NT 4.0 Service Pack 4. Responses built with HMAC-MD5 over the server challenge, a client challenge, a timestamp, and target information
2000Kerberos becomes the defaultWindows 2000 Active Directory uses Kerberos first. NTLM stays as the fallback
2007 onwardHardening defaultsWindows Vista and Server 2008 stop storing LM hashes by default and send only NTLMv2 responses by default
2019Drop the MIC (CVE-2019-1040)A flaw that let attackers strip NTLM's integrity check and relay across protocols. Patched in June 2019
2024DeprecationMicrosoft listed all NTLM versions as deprecated and removed NTLMv1 from Windows 11 version 24H2 and Windows Server 2025

The protocol is documented in Microsoft's open specification MS-NLMP. The pass-through validation between a server and a domain controller is documented in MS-NRPC (Netlogon).

Where NTLM is used in enterprise networks

NTLM shows up wherever Kerberos is not possible or not attempted:

  • Connections by IP address, such as \\10.0.4.20\share. There is no service principal name for an IP, so Kerberos cannot issue a ticket
  • Local accounts on workstations and servers, including the built-in Administrator account
  • Workgroup machines, appliances, and devices that are not domain-joined
  • Applications and web servers configured for NTLM, or for Negotiate where Kerberos fails and NTLM takes over
  • Older line-of-business applications, scanners, multifunction printers, and network storage that only support NTLM
  • Cross-forest access where the trust or name resolution does not support Kerberos
  • Remote Desktop and WinRM connections that fall back when Kerberos fails

Two facts make NTLM traffic valuable for detection. First, most organizations have far more of it than they think; Microsoft's own guidance is to audit before restricting, for exactly that reason. Second, legitimate NTLM traffic is repetitive: the same service accounts, the same servers, the same applications. New sources, new destinations, and NTLM leaving the network are what stand out.

Architecture and components

ComponentWhat it isWhat it holds
ClientThe machine and user trying to log onThe user's NT hash, cached in memory by the Local Security Authority (LSASS) after logon
ServerThe service being accessed: a file server, web server, or SQL ServerNothing about domain users. For domain accounts it forwards the response to a domain controller
Domain controllerValidates responses for domain accountsThe NT hash of every domain account, in the directory database (NTDS.dit)
SAM databaseLocal account database on each Windows machineThe NT hashes of local accounts
Netlogon secure channelAn authenticated channel between each domain member and a domain controllerUsed for pass-through validation (MS-NRPC)
NT hashMD4 of the UTF-16LE password, 16 bytesThe secret that NTLM proves knowledge of. It is equivalent to the password for NTLM
Server challenge8 random bytes chosen by the server per authenticationMakes each response unique
Session keysKeys derived during authenticationUsed for signing and sealing, when the application protocol turns those on

The key point is in the NT hash row. Kerberos also derives keys from the password, but NTLM uses the hash directly as the proof. Whoever has the hash can complete NTLM authentication without ever knowing the password.

How NTLM works step by step

  1. NEGOTIATE (type 1). The client tells the server it wants to use NTLM and lists the features it supports as flags: Unicode, signing, sealing, extended session security, 128-bit keys, and others.
  2. CHALLENGE (type 2). The server replies with an 8-byte random server challenge, the flags it agrees to, and a block of target information: its NetBIOS and DNS names, the domain names, and a timestamp.
  3. AUTHENTICATE (type 3). The client computes its response from the server challenge, its own random client challenge, the timestamp, the target information, and the user's NT hash. It sends the response together with the user name, domain name, and its own workstation name, plus a message integrity code (MIC) covering all three messages.
  4. Validation. For a local account, the server checks the response against its SAM database. For a domain account, the server sends the challenge and response to a domain controller over its Netlogon secure channel. The domain controller recomputes the expected response from the stored NT hash and replies with success or a failure code, along with the user's group memberships and a session key.
  5. Access. If validation succeeds, the server grants access. If signing was negotiated and is required, all further messages on the connection are signed with the session key.

Notice what is missing: at no point does the client verify the server's identity. The client answers whichever server sent the challenge. That gap is the root of relay attacks.

sequenceDiagram
  participant C as Client
  participant S as Server
  participant DC as Domain controller
  C->>S: NEGOTIATE with supported flags
  S->>C: CHALLENGE with server challenge and target info
  C->>S: AUTHENTICATE with response, user, domain, workstation, MIC
  S->>DC: Netlogon pass-through with challenge and response
  DC->>S: Success, group memberships, session key
  S->>C: Access granted

Packet-level anatomy

Transport and encapsulation

NTLM messages ride inside the application protocol:

CarrierWhere NTLM appearsHow to spot it
SMB (445/TCP)Session Setup requests and responses, usually inside SPNEGOThe NTLMSSP mechanism OID 1.3.6.1.4.1.311.2.2.10 inside the security blob
HTTP (80 or 443/TCP)Authorization: NTLM <base64> or Authorization: Negotiate <base64> headers, and WWW-Authenticate challengesBase64 of the NTLM signature starts with TlRMTVNTUA
LDAP (389/TCP)SASL bind with GSS-SPNEGO, or the Microsoft "sicily" bindBind requests carrying NTLMSSP
RPC and DCOM (135 plus dynamic ports)Bind and alter-context authenticationNTLMSSP in the auth verifier
SQL Server (1433/TCP)Login with integrated securityNTLMSSP in the login packet
Remote Desktop (3389/TCP)CredSSP during Network Level AuthenticationNTLMSSP inside CredSSP when Kerberos fails

Pass-through validation from a member server to a domain controller uses Netlogon RPC, not NTLMSSP. The domain controller sees the user name, domain, workstation name, and the challenge and response, and logs Event 4776.

Common header

Every NTLM message starts with the same 12 bytes:

OffsetSizeFieldValue
08 bytesSignatureNTLMSSP\0 (hex 4E 54 4C 4D 53 53 50 00)
84 bytesMessageType1 (NEGOTIATE), 2 (CHALLENGE), or 3 (AUTHENTICATE), little-endian

Variable-length fields such as names and responses are not stored inline. Each is described by an 8-byte security buffer: a 2-byte length, a 2-byte maximum length, and a 4-byte offset into the payload that follows the fixed fields.

NEGOTIATE message (type 1)

FieldSizePurposeSecurity note
Signature, MessageType12 bytesHeader, type 1None
NegotiateFlags4 bytesFeatures the client supportsA client that does not offer extended session security or 128-bit keys is old or misconfigured
DomainNameFields8 bytesOptional domain nameUsually empty in modern clients
WorkstationFields8 bytesOptional workstation nameUsually empty in modern clients
Version8 bytesWindows version and build, if the version flag is setLets passive sensors fingerprint the client operating system

CHALLENGE message (type 2)

FieldSizePurposeSecurity note
TargetNameFields8 bytesThe server's domain or computer nameVisible in clear text
NegotiateFlags4 bytesFlags the server acceptsSigning and sealing are only as strong as what is agreed here
ServerChallenge8 bytesRandom nonce for this authenticationA fixed, repeated challenge such as 1122334455667788 is the signature of tools that try to capture crackable NTLMv1 responses
Reserved8 bytesMust be zeroNone
TargetInfoFields8 bytesPoints to a list of attribute-value pairs (AV_PAIRs)Carries the names and timestamp that NTLMv2 binds the response to
Version8 bytesServer Windows versionFingerprints the server

The AV_PAIR list in TargetInfo uses these IDs:

IDNameContents
1MsvAvNbComputerNameServer NetBIOS name
2MsvAvNbDomainNameDomain NetBIOS name
3MsvAvDnsComputerNameServer DNS name
4MsvAvDnsDomainNameDomain DNS name
5MsvAvDnsTreeNameForest DNS name
6MsvAvFlagsFlags. Value 0x2 means the client includes a MIC
7MsvAvTimestampServer time, used in the NTLMv2 response
9MsvAvTargetNameThe service name the client intends to reach, such as cifs/fs01.corp.local (added by the client in the AUTHENTICATE message)
10MsvAvChannelBindingsA hash of the TLS channel, for Extended Protection for Authentication (added by the client)
0MsvAvEOLEnd of list

AUTHENTICATE message (type 3)

FieldSizePurposeSecurity note
LmChallengeResponseFields8 bytesLM or LMv2 responseWith NTLMv2 and a server timestamp present, this is 24 bytes of zeros
NtChallengeResponseFields8 bytesNT responseIts length tells you the version: exactly 24 bytes is NTLMv1, longer is NTLMv2
DomainNameFields8 bytesUser's domainClear text
UserNameFields8 bytesUser nameClear text, so sensors see every account that authenticates
WorkstationFields8 bytesClient's claimed computer nameChosen by the client. In a relay it names the victim, not the machine that actually connected
EncryptedRandomSessionKeyFields8 bytesSession key exchangeUsed when key exchange is negotiated
NegotiateFlags4 bytesFinal agreed flagsNone
Version8 bytesClient versionFingerprinting
MIC16 bytesHMAC-MD5 over all three messages, keyed with the session keyStops tampering with the flags. Its removal was the core of CVE-2019-1040

Key negotiate flags

FlagValueMeaning
NTLMSSP_NEGOTIATE_UNICODE0x00000001Strings in UTF-16LE
NTLMSSP_REQUEST_TARGET0x00000004Server should send its target name
NTLMSSP_NEGOTIATE_SIGN0x00000010Message signing
NTLMSSP_NEGOTIATE_SEAL0x00000020Message encryption
NTLMSSP_NEGOTIATE_NTLM0x00000200NTLM authentication
NTLMSSP_NEGOTIATE_ALWAYS_SIGN0x00008000Signature on every message, even if no signing key
NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY0x00080000NTLM2 session security. Mixes a client challenge into NTLMv1 and strengthens keys
NTLMSSP_NEGOTIATE_TARGET_INFO0x00800000TargetInfo is present
NTLMSSP_NEGOTIATE_VERSION0x02000000Version field is present
NTLMSSP_NEGOTIATE_1280x20000000128-bit session keys
NTLMSSP_NEGOTIATE_KEY_EXCH0x40000000Explicit session key exchange
NTLMSSP_NEGOTIATE_560x8000000056-bit keys

A typical modern Windows client sends 0xe2888215, which combines Unicode, request target, signing, NTLM, always sign, extended session security, target info, version, 128-bit, key exchange, and 56-bit.

How the responses are built

NTLMv1 encrypts the 8-byte server challenge three times with DES, using the 16-byte NT hash padded to 21 bytes and split into three 7-byte keys. The result is a 24-byte response. Because DES keys are small and the scheme is fixed, an NTLMv1 response can be turned back into the NT hash, which is then usable for pass-the-hash.

NTLMv2 works in two steps:

  1. The client derives a per-user key: NTOWFv2 = HMAC-MD5 of the upper-cased user name and the domain name, keyed with the NT hash.
  2. It builds a blob containing a timestamp, an 8-byte client challenge, and the target information, then computes NTProofStr = HMAC-MD5 of the server challenge plus that blob, keyed with NTOWFv2. The NT response is NTProofStr followed by the blob.

The NTLMv2 response cannot be replayed to a different challenge, and it cannot be reversed into the NT hash directly. It can still be cracked offline by guessing passwords, which is fast against weak ones.

Captured materialHashcat modeWhat cracking gives you
NT hash (from SAM, NTDS.dit, or memory)1000The password. The hash itself already works for pass-the-hash
NetNTLMv1 response5500The password, or with DES key recovery, the NT hash itself
NetNTLMv2 response5600The password, if it is weak enough

Example decoded AUTHENTICATE message

This is an illustrative NTLMv2 AUTHENTICATE message as Wireshark shows it, from an SMB session setup.

NTLM Secure Service Provider
    NTLMSSP identifier: NTLMSSP
    NTLM Message Type: NTLMSSP_AUTH (0x00000003)
    Lan Manager Response Length: 24          (all zeros, timestamp present)
    NTLM Response Length: 330
    NTLMv2 Response
        NTProofStr: 4d1e7c...
        Response Version: 1
        Hi Response Version: 1
        Time: Nov  9, 2026 08:12:44 UTC
        NTLMv2 Client Challenge: 9b5c02...
        Attribute: NetBIOS domain name: CORP
        Attribute: DNS computer name: fs01.corp.local
        Attribute: Flags: 0x00000002          (MIC present)
        Attribute: Target Name: cifs/fs01.corp.local
        Attribute: Channel Bindings: 00000000...
    Domain name: CORP
    User name: jdoe
    Host name: WS-0142
    Negotiate Flags: 0xe2888215
    MIC: 9e1fa3...

Zeek writes one line per NTLM authentication to ntlm.log, with fields including username, hostname, domainname, server_nb_computer_name, server_dns_computer_name, and success. An illustrative line:

username=jdoe  hostname=WS-0142  domainname=CORP  server_dns_computer_name=fs01.corp.local  success=T

Configuration in practice

SettingDefaultRecommendedWhy
Network security: LAN Manager authentication level (LmCompatibilityLevel)Send NTLMv2 response only (level 3) on modern WindowsSend NTLMv2 response only. Refuse LM and NTLM (level 5)Stops the domain controller from accepting LM and NTLMv1 responses
Network security: Do not store LAN Manager hash value on next password changeEnabledEnabledKeeps the weak LM hash out of the database
Network security: Minimum session security for NTLM SSP (clients and servers)Require 128-bit encryption on recent versionsRequire NTLMv2 session security and 128-bit encryptionPrevents weak session keys
Microsoft network server: Digitally sign communications (always)Required on domain controllers. On member servers it depends on the Windows versionEnabled everywhereSMB signing makes relay to SMB fail. Recent Windows releases require it by default
Domain controller: LDAP server signing requirementsVaries by version and update levelRequire signingBlocks relay to LDAP over unencrypted connections
LDAP channel binding (LdapEnforceChannelBinding)Varies by update levelAlways (value 2)Blocks relay to LDAPS
Extended Protection for Authentication on IIS, including AD CS web enrollmentOff for many applicationsRequiredBinds NTLM to the TLS channel, which defeats relay to HTTPS services
Turn off multicast name resolution (LLMNR)LLMNR enabledEnabled (which turns LLMNR off)Removes the most common source of captured hashes on internal networks
NetBIOS over TCP/IP on network adaptersEnabled by defaultDisabled, through DHCP option or adapter settingsRemoves NBT-NS, the other common poisoning target
Network security: Restrict NTLM policiesNot definedAudit first, then deny with exceptionsThe only safe route to reducing NTLM: find what depends on it before blocking it

Restricting NTLM is a project, not a switch. The sequence that works in practice:

  1. Turn on "Network security: Restrict NTLM: Audit NTLM authentication in this domain" on domain controllers, and the matching incoming and outgoing audit policies on servers and clients.
  2. Collect the events from the Microsoft-Windows-NTLM/Operational log for several weeks. On Windows 11 24H2, Windows Server 2025, and recent updates for Windows Server 2019 and later, also turn on the newer "NTLM Enhanced Logging" policy (Microsoft KB5064479). Its events add the process that started each NTLM attempt, which makes finding the responsible application much faster.
  3. Fix the sources: add SPNs, switch connections from IP addresses to names, update or replace applications.
  4. Block NTLM for the most sensitive accounts first by adding them to the Protected Users group.
  5. Deny NTLM by policy with an exception list for what cannot be fixed yet.

Security model and common misconfigurations

NTLM rests on these assumptions:

  1. The NT hash stays secret. In practice it is cached in memory on every machine the user logs on to, and it is enough to authenticate.
  2. The response proves the client knows the hash for this challenge. It does not prove which server the client meant to reach, unless the target name and channel bindings are checked.
  3. Signing protects the session after authentication. It only works if both sides require it.

The misconfigurations behind most NTLM attacks in enterprise networks:

  • SMB signing not required on member servers and workstations
  • LDAP signing and channel binding not enforced on domain controllers
  • AD CS web enrollment reachable over HTTP, or over HTTPS without Extended Protection
  • LLMNR and NBT-NS left on across the network
  • Outbound SMB (445/TCP) allowed to the internet
  • The same local administrator password on many machines, so one hash opens them all
  • The Print Spooler service running on domain controllers, which helps attackers force the domain controller to authenticate to them
  • Applications and scripts that authenticate by IP address, which forces NTLM even where Kerberos would work

Attacks against NTLM

Name resolution poisoning

How it works: when a Windows host fails to resolve a name through DNS, it asks the local network using LLMNR (UDP 5355) and NBT-NS (UDP 137). An attacker on the same network answers, "that is me." The victim then connects and authenticates to the attacker, handing over a NetNTLMv2 response.

Prerequisites: a foothold on the same network segment, and LLMNR or NBT-NS left on.

Tools: Responder, Inveigh.

ATT&CK: T1557.001 (Adversary-in-the-Middle: Name Resolution Poisoning and SMB Relay).

On the wire and in logs: LLMNR or NBT-NS responses from a host that is not a DNS server, followed by SMB or HTTP authentication to that host. Mistyped share names in user activity make this attack productive without any further action from the attacker.

Forced authentication (coercion)

How it works: instead of waiting for victims, the attacker makes a machine authenticate on demand. Several RPC interfaces accept a file path and will connect to it, including the printer interface (MS-RPRN, the "printer bug"), the encrypting file system interface (MS-EFSRPC, known as PetitPotam, CVE-2021-36942), and the DFS namespace interface (MS-DFSNM). Files can also do it: a shortcut or document on a shared folder with an icon path pointing to \\attacker\share triggers authentication when someone browses the folder. CVE-2023-23397 let an attacker trigger it from an Outlook calendar reminder with no user interaction.

Prerequisites: network access to the target's RPC interfaces (some need a domain account), or the ability to place a file where users will see it.

Tools: PetitPotam, Coercer, SpoolSample.

ATT&CK: T1187 (Forced Authentication).

On the wire and in logs: RPC calls to efsrpc, spoolss, or netdfs from unusual sources, followed by the target connecting out over SMB or HTTP to that source. Domain controllers connecting to workstations is the clearest signal.

NTLM relay

How it works: the attacker receives an authentication attempt (from poisoning or coercion) and forwards each message to a different server in real time. The relayed server sends its challenge, the attacker passes it to the victim, the victim answers, and the attacker forwards the answer. The server logs the victim in, and the attacker now holds an authenticated session as the victim.

Where it goes depends on what the target allows:

  • SMB targets without required signing: command execution as the victim, if the victim is a local administrator there
  • LDAP without signing, or LDAPS without channel binding: changes to the directory, such as creating a computer account, setting resource-based constrained delegation, or adding shadow credentials
  • AD CS web enrollment without Extended Protection (known as ESC8): a certificate for the victim. Combined with coercing a domain controller, this gives a certificate for the domain controller, and from there full domain compromise

A machine cannot be relayed back to itself over the same protocol; Microsoft closed that path in 2008 (MS08-068). Cross-protocol relay, such as SMB to LDAP, was helped by CVE-2019-1040, which let attackers remove the MIC.

Prerequisites: a source of victim authentication, and a target that does not enforce signing, channel binding, or Extended Protection.

Tools: Impacket ntlmrelayx.py, Responder in relay mode.

ATT&CK: T1557.001.

On the wire and in logs: the same user authenticating to two different servers within a second, once from the real workstation to the attacker and once from the attacker to the target. On the target, Event 4624 with logon type 3 and NTLM, where the Workstation Name field does not match the computer at the source IP address.

Pass-the-hash

How it works: NTLM proves knowledge of the NT hash, so a stolen hash works like the password. Attackers dump hashes from memory (LSASS), from the local SAM database, or from NTDS.dit, then authenticate to other machines with the hash directly.

Prerequisites: administrator rights on a machine where privileged users have logged on, or access to a credential database.

Tools: Mimikatz (sekurlsa::pth), Impacket (psexec.py, wmiexec.py with -hashes), and many post-exploitation frameworks.

ATT&CK: T1550.002 (Pass the Hash). Hash theft from memory is T1003.001 (LSASS Memory).

On the wire and in logs: on the attacker's machine, Event 4624 with logon type 9 (NewCredentials) and logon process seclogo, which is what sekurlsa::pth and runas /netonly create. On targets, NTLM network logons by privileged accounts from machines they do not normally use. The same local administrator account logging on to many machines in a short time.

Offline cracking of captured responses

How it works: a captured NetNTLMv2 response can be checked against password guesses at high speed. NetNTLMv1 is worse: with a known challenge, the DES-based response can be reversed into the NT hash itself.

Prerequisites: a captured response, from poisoning, coercion, or a packet capture.

Tools: Hashcat (modes 5500 and 5600), John the Ripper.

ATT&CK: T1110.002 (Password Cracking).

On the wire and in logs: cracking happens offline and leaves nothing. Detect the capture step instead. Also find any NTLMv1 in use (Event 4624 with Package Name NTLM V1), because those responses are the most valuable to an attacker.

Password spraying over NTLM

How it works: the attacker tries one or two common passwords against many accounts through any NTLM endpoint: SMB, Exchange web services, or internal web applications.

ATT&CK: T1110.003 (Password Spraying).

On the wire and in logs: on domain controllers, bursts of Event 4776 with error 0xC000006A (wrong password) across many accounts from the same workstation name. Watch for 0xC0000064 (no such user) as well, which shows the attacker is guessing account names.

Detection engineering

Log sources

SourceEvent or fieldWhat to look for
Domain controller Security log4776, credential validationError codes: 0xC000006A wrong password, 0xC0000064 unknown user, 0xC0000234 locked out, 0xC0000072 disabled, 0xC0000071 expired password
Member server Security log4624, logon type 3Authentication Package NTLM, Package Name NTLM V1 or NTLM V2, Workstation Name, Source Network Address
Attacker's or admin workstation4624, logon type 9Logon process seclogo: alternate credentials used for network access, including pass-the-hash
Microsoft-Windows-NTLM/Operational8001 to 8004NTLM audit events once the Restrict NTLM audit policies are on. Event 8004 on domain controllers lists the server (as Secure Channel name), user, domain, and workstation for each pass-through
Microsoft-Windows-NTLM/Operational (enhanced logging)4020 and 4021, 4022 and 4023, 4032 and 4033Outgoing NTLM from a machine, incoming NTLM to a machine with the process involved, and pass-through requests a domain controller handled.
Microsoft-Windows-NTLM/Operational4024 and 4025NTLMv1-derived credentials used for single sign-on (4024, audit mode) or blocked (4025, enforce mode), controlled by the BlockNtlmv1SSO registry value (Microsoft KB5066470)
Zeek ntlm.logusername, hostname, domainname, server_*_name, successNew user and server pairs, workstation names that do not match the source address
Zeek conn.logDestination port 445 or 139 to public addressesNTLM leaking out of the network
Zeek http.logAuthorization headers starting with NTLM or NegotiateNTLM to external or unusual web servers

Example detections

Relay indicator: claimed workstation does not match the real source, as pseudo-SQL:

-- NTLM network logons where the workstation name in the message
-- does not match the host that actually connected
SELECT e.TargetUserName, e.WorkstationName, e.IpAddress, a.hostname AS actual_host
FROM security_4624 e
JOIN asset_inventory a ON a.ip = e.IpAddress
WHERE e.LogonType = 3
  AND e.AuthenticationPackageName = 'NTLM'
  AND upper(e.WorkstationName) <> upper(a.hostname);

Expected false positives: VPN concentrators and NAT, which hide the real client address, and stale inventory after DHCP changes. Build an exclusion list for those ranges.

NTLMv1 in use, as Sigma-style YAML:

title: NTLMv1 network logon
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4624
    AuthenticationPackageName: NTLM
    LmPackageName: 'NTLM V1'
  condition: selection
falsepositives:
  - Old devices and applications. Each one is a finding to fix, not to tune out.
level: medium

Pass-the-hash on the source machine, as Sigma-style YAML:

title: Logon with alternate credentials for network use
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4624
    LogonType: 9
    LogonProcessName: 'seclogo'
  condition: selection
falsepositives:
  - Administrators using runas /netonly on purpose. Review the account and the machine.
level: high

NTLM leaving the network, as pseudo-SQL over Zeek data:

SELECT orig_h, resp_h, COUNT(*) AS connections
FROM conn_log
WHERE resp_p IN (139, 445)
  AND NOT is_private(resp_h)
  AND ts > now() - INTERVAL '1 day'
GROUP BY orig_h, resp_h;

Any result here deserves a look: internal Windows machines have almost no legitimate reason to speak SMB to the internet, and this pattern is exactly how hashes leaked in the CVE-2023-23397 attacks.

Prevention and hardening

In order of impact:

  1. Block outbound SMB (139 and 445/TCP) to the internet at the firewall. This one rule stops hash leaks to external servers.
  2. Require SMB signing on every server and workstation, not only domain controllers.
  3. Enforce LDAP signing and LDAP channel binding on all domain controllers.
  4. Require Extended Protection for Authentication on AD CS web enrollment and other IIS applications that use Windows authentication, or turn off HTTP enrollment where it is not needed.
  5. Turn off LLMNR and NetBIOS over TCP/IP everywhere you can.
  6. Set the LAN Manager authentication level to "Send NTLMv2 response only. Refuse LM and NTLM", after confirming no device still needs NTLMv1.
  7. Stop the Print Spooler service on domain controllers and on servers that do not print, and apply the patches and RPC filters for the coercion methods above.
  8. Give every machine a unique local administrator password with Windows LAPS, so one stolen hash does not open the whole fleet.
  9. Add privileged accounts to the Protected Users group, which stops NTLM for them entirely.
  10. Turn on Credential Guard where supported, which keeps NT hashes out of reach of tools that read LSASS memory.
  11. Audit NTLM, fix what depends on it, then restrict it, following the sequence in the configuration section.
  12. Monitor with the detections above, and treat any NTLMv1, any outbound SMB, and any workstation-name mismatch as findings to investigate.

Incident response and remediation

When NTLM abuse is suspected:

  1. Scope. Pull Events 4624, 4776, and 4625 from domain controllers and affected servers, and ntlm.log and conn.log from network sensors. Identify the accounts used, the machines they came from, and where they went.
  2. Find the source of the credentials. A poisoning host on the network, a coerced server, or a dumped hash each need a different fix. Isolate any host that was answering LLMNR or NBT-NS, and any host that relayed authentication.
  3. Reset the affected passwords. For accounts whose hashes were stolen, a password change makes the old hash useless. For local administrator accounts, rotate them across all machines, ideally by deploying Windows LAPS.
  4. Undo what the relay changed. If LDAP was reached, look for new computer accounts, changes to msDS-AllowedToActOnBehalfOfOtherIdentity, new msDS-KeyCredentialLink values (shadow credentials), and new group memberships.
  5. Revoke certificates. If AD CS web enrollment was abused, revoke the certificates issued during the attack window. Certificates keep working after password resets.
  6. Close the path that was used: signing, channel binding, Extended Protection, LLMNR, the Print Spooler, or outbound SMB.
  7. Watch for return. Keep the detections at high priority for several weeks.

Real-world cases

  • CVE-2023-23397: an Outlook flaw let attackers send a calendar item whose reminder sound pointed to an external SMB path. Outlook connected and leaked the user's NetNTLMv2 response with no user interaction. Microsoft reported that a Russia-based threat actor exploited it against government, transportation, energy, and military organizations in Europe, and later attributed the activity to the group it tracks as Forest Blizzard, also known as APT28. Microsoft also noted that Windows sent these hashes to internet hosts only over SMB, which is why Microsoft listed blocking outbound port 445 as a mitigation for machines not yet patched.
  • CVE-2021-36942, PetitPotam: coercion through the encrypting file system RPC interface. Combined with relay to AD CS web enrollment, it gave a path from network access to full domain compromise, and pushed many organizations to enable Extended Protection on certificate services.
  • CVE-2019-1040, Drop the MIC: a flaw that let attackers strip NTLM's message integrity check and relay authentication across protocols, such as from SMB to LDAP.
  • Responder: the open-source tool that made LLMNR and NBT-NS poisoning a routine first step in internal penetration tests. It remains one of the fastest ways testers find credentials on networks where those protocols are still on.

NTLM in the news

News stories tagged with NTLM. This list updates on its own while the page is open.

    No news stories are tagged with this topic yet.

    Frequently asked questions

    Do we still use NTLM if we have Kerberos?

    Almost certainly. Connections by IP address, local accounts, non-domain devices, and many applications still use NTLM. Turn on NTLM auditing to see how much, before planning any restriction.

    What is the difference between an NT hash and a NetNTLMv2 hash?

    The NT hash is the stored secret, MD4 of the password, and it can be used directly for pass-the-hash. A NetNTLMv2 response is what crosses the network during one authentication. It cannot be passed, but it can be relayed in real time or cracked offline.

    Does SMB signing stop NTLM relay?

    It stops relay to SMB servers that require signing. Relay to LDAP, LDAPS, and HTTPS needs its own defenses: LDAP signing, LDAP channel binding, and Extended Protection for Authentication.

    Can we turn NTLM off completely?

    Not safely in one step. Audit NTLM use, fix the sources, block it for privileged accounts through Protected Users, then deny it by policy with a short exception list. Microsoft has deprecated NTLM, so the work pays off over time.

    How does network detection spot NTLM relay?

    The clearest signs are one user authenticating to two servers almost at the same moment, a workstation name in the NTLM message that does not match the machine that connected, and authentication arriving from hosts that answered LLMNR or NBT-NS queries.

    References and further reading

    Found a technical error in this entry? Tell us and we will fix it.