Event ID 4771
Event ID 4771: Kerberos Pre-Authentication Failed
Kerberos pre-authentication failed
- Log source
- Security
- How to enable it
- Account Logon > Audit Kerberos Authentication Service (Failure)
- Category
- Kerberos
- Priority
- Medium
- Typical volume
- High
- MITRE ATT&CK
What Event ID 4771 means
4771 is the Kerberos form of a wrong password. It is written on a domain controller when a client fails to prove that it knows the account's key. No 4625 is created anywhere if the attacker speaks Kerberos directly to the controller, and that is why spraying tools prefer this route.
Failure code 0x18 is the one to count. It means that the account exists and the password was wrong. Unknown names do not appear here at all. They produce 4768 with status 0x6, so the two events together give both halves of an attack.
The client address is reliable, since it comes from the network connection. A few failures a day for a person are normal. A workstation that fails for thirty different people in ten minutes is not, even when no account reaches the lockout threshold.
Key fields to inspect
| Field | Meaning | Suspicious when |
|---|---|---|
TargetUserName | Account whose password was wrong. | Many accounts from one address, or service accounts. |
IpAddress | Client address, often with ::ffff: in front. | A single host for many names, or a server in a perimeter network. |
Status | Failure code. | 0x18 across many accounts. |
PreAuthType | Method that was tried. 2 is a password. | 16 or 17 failures, which are certificate logons that were refused. |
TicketOptions | Request flags in hexadecimal. | A value that differs from the one your Windows clients send. |
ServiceName | Requested service, normally krbtgt and the realm. | kadmin/changepw, which indicates password change attempts. |
Failure codes in 4771
| Code | Meaning | Action |
|---|---|---|
0x10 | Pre-authentication type not supported | Often a smart card or certificate problem |
0x12 | Credentials revoked | Account disabled, expired or locked |
0x17 | Password expired | User must change it |
0x18 | Wrong password | Count distinct accounts for each address |
0x25 | Clock skew | Fix time synchronization |
Detection queries
Find addresses that fail with a wrong password for many accounts, including slow attempts over a day. Adjust names and thresholds to your environment. About these queries.
Splunk SPL
index=windows source="XmlWinEventLog:Security" EventCode=4771
Status="0x18"
| eval src=replace(IpAddress, "^::ffff:", "")
| bin _time span=1d
| stats dc(TargetUserName) AS accounts count BY _time src
| where accounts>=10
| sort - accounts Microsoft Sentinel KQL
SecurityEvent
| where EventID == 4771
| where Status =~ "0x18"
| extend Source = replace_string(IpAddress, "::ffff:", "")
| summarize Accounts = dcount(TargetUserName), Attempts = count(), Names = make_set(TargetUserName, 50) by Source, bin(TimeGenerated, 1d)
| where Accounts >= 10 PowerShell
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4771; StartTime = (Get-Date).AddDays(-1) } |
ForEach-Object { $d = @{ Time = $_.TimeCreated }; ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }; [pscustomobject]$d } |
Where-Object { $_.Status -eq '0x18' } |
Select-Object Time, TargetUserName, IpAddress, Status, PreAuthType | Format-Table -AutoSize Attack scenarios
Kerberos password spray
Kerbrute and similar tools test one password against every account by sending requests to port 88. There are no host logons, no 4625 and no NTLM, only 4771 on the controllers and one 4768 success for the weak account.
Credential stuffing after a breach
Pairs from a leaked database are tried once each. Every account fails exactly once from the same source, which a lockout policy never notices.
Guessing a service account
Continuous 0x18 for a single service account may be an attack, or an application with an old password. The interval between failures separates the two, because applications retry on a fixed schedule.
Investigation checklist
- Normalize IpAddress and count distinct accounts over ten minutes and over a day.
- Look for 4768 with status 0x0 from the same address, which marks a hit.
- Look for 4768 with status 0x6 to see whether names were being guessed.
- Identify the process on the source host, using Sysmon event 3 for port 88 outside lsass.exe.
Common benign causes
- Mistyped passwords, highest on Monday mornings and after password changes.
- Services, phones and mapped drives with an old password.
- Terminal servers and proxies that represent many users.
Event ID 4771 FAQ
What does failure code 0x18 mean in event 4771?
The pre-authentication data was invalid, which in practice means a wrong password for an account that exists.
Why do I see 4771 but no 4625?
Kerberos pre-authentication takes place at the domain controller before any logon on a host. If it fails there, the target computer is never contacted and records nothing.
Does 4771 appear for user names that do not exist?
No. Unknown names are reported in 4768 with status 0x6. Monitor both events to see a spray that mixes real and guessed names.