Defense evasionHigh
Pass the Hash
Also known as PtH, Overpass the hash
How pass-the-hash shows up: 4624 Type 3 NTLM logons with KeyLength 0, or Type 9 new-credentials logons via the seclogo process.
Signals in the logs
A network logon authenticated by NTLM where the session key length is zero, which is the common pass-the-hash footprint for non-anonymous accounts.
- LogonType
- 3 (network)
- AuthenticationPackageName
- NTLM
- LogonProcessName
- NtLmSsp
- KeyLength
- 0 (for a real, non-anonymous account rather than ANONYMOUS LOGON)
A new-credentials logon created by the secondary-logon path, the overpass-the-hash footprint on the host where the hash is injected.
- LogonType
- 9 (NewCredentials)
- LogonProcessName
- seclogo
- AuthenticationPackageName
- Negotiate
- 03Security4776The domain controller attempted to validate the credentials for an accountDomain controller
NTLM validation of a domain account on a DC that pairs with the suspicious network logon on the target.
- PackageName
- MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
- Status
- 0x0 (success)
- TargetUserName
- the account whose hash was reused
What happens
Pass-the-hash reuses a stolen NTLM password hash to authenticate without ever knowing the plaintext password. The hash is injected so that network authentication succeeds through NTLM rather than through an interactive logon. On the destination this appears as a network logon authenticated by NTLM, and a related variant injects the hash into a new-credentials logon used for outbound access. Because the real password was never typed, the pattern is a network or new-credentials logon tied to NTLM whose session-key and process fields differ from a true interactive logon.
Logging you need
- Audit subcategory Logon/Logoff > Logon = Success on all hosts (for 4624). This is on by default.
- Audit subcategory Account Logon > Credential Validation = Success on domain controllers for domain accounts, and on member hosts for local-account reuse (for 4776).
- LogonType 9 / seclogo detection needs the audit on the source host where credentials are injected, not the destination.
Hunt queries
Starting points. Tune thresholds and exclusions to your environment before alerting on them.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624} | ForEach-Object {
$x = [xml]$_.ToXml(); $d = @{}; $x.Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{ Time=$_.TimeCreated; User=$d['TargetUserName']; Type=$d['LogonType']; Pkg=$d['AuthenticationPackageName']; Proc=$d['LogonProcessName']; Key=$d['KeyLength']; Ip=$d['IpAddress'] }
} | Where-Object {
$_.Type -eq '3' -and $_.Proc -eq 'NtLmSsp' -and $_.Key -eq '0' -and $_.User -ne 'ANONYMOUS LOGON'
}Benign look-alikes
- runas /netonly legitimately produces LogonType 9 via the seclogo process; baseline the admin workstations and tooling that use it.
- Environments that still depend on NTLM (older file servers, appliances, non-domain hosts) generate Type 3 NTLM logons as normal traffic.
- ANONYMOUS LOGON sessions also show KeyLength 0; exclude them so the filter catches real accounts only.
Notes
- An unexpected RestrictedAdminMode = Yes on a Type 10 (RDP) logon can indicate a hash passed over Restricted Admin RDP, since that mode accepts NTLM.
- Pass-the-hash is the entry to most lateral movement, so correlate the suspicious logon forward into 4688, 7045 or 4698 for what ran next.
Keep going
- Attack signalsLSASS Memory Dumping
- Attack signalsPass the Ticket
- Attack signalsNTDS.dit Theft
- Attack signalsSilver Ticket
- Lateral movementPsExec and service-based execution
- Lateral movementsmbexec
- Lateral movementWMI remote execution
- Lateral movementRemote service creation
- Lateral movementRemote scheduled task execution
- Lateral movementDCOM execution
- Lateral movementRDP lateral movement