Credential accessMedium
Password Spraying
How password spraying shows up: 4771 Status 0x18 or 4625 SubStatus 0xC000006A spread across many accounts from one source.
Signals in the logs
Kerberos pre-authentication failures for the wrong-password reason across many distinct accounts from one source.
- Status
- 0x18 (KDC_ERR_PREAUTH_FAILED, correct account and wrong password)
- TargetUserName
- many different accounts
- IpAddress
- a single source
Interactive or network logon failures for the wrong-password sub-status spread across accounts.
- SubStatus
- 0xC000006A (correct user name, wrong password)
- TargetUserName
- many different accounts
- IpAddress
- a single source
- 03Security4776The domain controller attempted to validate the credentials for an accountDomain controller
NTLM credential validations failing with the wrong-password status across many accounts.
- Status
- 0xC000006A (wrong password)
- TargetUserName
- many different accounts
- Workstation
- a single source workstation name
What happens
Password spraying tries one or a few common passwords against many accounts, pacing attempts to stay under lockout thresholds. Each wrong guess is a failed authentication, so the technique surfaces not as repeated failures against one account but as a thin spread of failures across many accounts from a single source in a short window. The exact event depends on the protocol: Kerberos pre-authentication failures, NTLM validation failures on a domain controller, or interactive and network logon failures, each carrying the status code that specifically means a correct account with a wrong password.
Logging you need
- Audit subcategory Account Logon > Kerberos Authentication Service = Failure on domain controllers (for 4771).
- Audit subcategory Account Logon > Credential Validation = Failure on domain controllers for domain accounts, and on member hosts for local accounts (for 4776).
- Audit subcategory Logon/Logoff > Logon = Failure on the targeted hosts (for 4625).
Hunt queries
Starting points. Tune thresholds and exclusions to your environment before alerting on them.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4771} | ForEach-Object {
$x = [xml]$_.ToXml(); $d = @{}; $x.Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{ Time=$_.TimeCreated; User=$d['TargetUserName']; Code=$d['Status']; Ip=$d['IpAddress'] }
} | Where-Object { $_.Code -eq '0x18' } |
Group-Object Ip | Where-Object { ($_.Group.User | Sort-Object -Unique).Count -gt 10 }Benign look-alikes
- A user who changed their password but left it cached on a phone, mapped drive or service generates repeated wrong-password failures that can look like a thin spray.
- An application or service with stale stored credentials hammers one or a few accounts from one host.
- Account lockouts from a legitimate but misconfigured client produce 4771 with code 0x12 alongside the 0x18 failures; do not mistake the lockout for the spray itself.
Notes
- Username enumeration is a separate signal: probes for accounts that do not exist fail as 4768 with code 0x6 or 4625 with sub-status 0xC0000064, so hunt those alongside 0x18 and 0xC000006A.
- Spraying is deliberately slow; widen the time window to hours or days, because a few failures per account can hide under per-account thresholds.