Tutorials
Windows Security event IDs every SOC analyst should know
The Windows event IDs that matter in an investigation: logons, account and group changes, Kerberos, processes, services and log clearing, with KQL to find them.
Published 8 min readReviewed by The Ledger EditorBeginner
Windows writes thousands of events a day on every machine, and almost all of them are noise. The skill is knowing the few dozen that tell you who logged on, from where, with what kind of logon, and what they changed once they were in. This guide covers the Windows event log IDs that come up again and again in real investigations, what the important fields mean, and how to find them in a SIEM with KQL.
The queries use the SecurityEvent table in Microsoft Sentinel, which is where Windows Security events land when they are collected with the Azure Monitor Agent. The event IDs and fields are the same in any SIEM and in Event Viewer.
Before you start: is the event even being logged?
Many of the events below only exist if the audit policy is on. Before you conclude that "nothing happened", check what the machine records:
auditpol /get /category:*Look for Success and Failure on Logon, Account Lockout, User Account Management, Security Group Management, Kerberos Authentication Service, Kerberos Service Ticket Operations, Credential Validation and Process Creation. Two settings are commonly missed:
- Process creation (4688) without command lines. The event is logged, but the command line field stays empty until you enable the Group Policy setting Administrative Templates → System → Audit Process Creation → Include command line in process creation events.
- Scheduled tasks (4698). These need the Other Object Access Events subcategory, which is off by default.
Logons: 4624, 4625, 4634, 4648 and 4672
These are the backbone of almost every Windows investigation.
- 4624: an account was successfully logged on. Logged on the machine that was accessed, not the one the user sat at.
- 4625: an account failed to log on. Same place, for failures.
- 4634 and 4647: logoff. 4647 is a user-initiated logoff; 4634 is the end of a session. Useful to estimate how long a session lasted.
- 4648: a logon was attempted using explicit credentials. Logged on the source machine when a process uses different credentials than the logged-on user, for example
runasor a tool connecting to another host with a typed password. - 4672: special privileges assigned to new logon. Logged right after a 4624 when the account has admin-level privileges. A 4672 for an account that should not be an admin is worth a look.
The field that changes everything: logon type
The same 4624 means very different things depending on its logon type:
- 2, Interactive: someone at the keyboard or console.
- 3, Network: access over the network, such as a file share, or remote administration tools that authenticate without an interactive session.
- 4, Batch: a scheduled task.
- 5, Service: a service started by the Service Control Manager.
- 7, Unlock: the workstation was unlocked.
- 8, NetworkCleartext: a network logon where the password reached the authentication package unhashed, for example some IIS basic authentication setups.
- 9, NewCredentials: a process cloned its token with new credentials for outbound connections, as
runas /netonlydoes. - 10, RemoteInteractive: Remote Desktop.
- 11, CachedInteractive: a logon with cached domain credentials, without contacting a domain controller.
A domain admin account with a type 3 logon to a file server may be normal. The same account with a type 10 logon to a workstation in the finance department at 3 a.m. is a different story.
Other fields to read every time: Source Network Address and Workstation Name (where it came from), Authentication Package (Kerberos, NTLM or Negotiate), Elevated Token and the Logon ID. The Logon ID is a hexadecimal value that links the logon to everything the session did afterwards, including 4672, 4688 and 4634 events on the same machine.
Reading failed logons
In a 4625, the Status and Sub Status fields explain why the attempt failed. For a bad password, Status is usually the generic 0xC000006D and the real reason is in Sub Status:
0xC000006A: correct username, wrong password.0xC0000064: the username does not exist. Many in a row suggest user enumeration.0xC0000234: the account is locked out.0xC0000072: the account is disabled.0xC0000193: the account has expired.0xC000006Fand0xC0000070: outside allowed hours, or from a workstation the account may not use.
This query separates a brute-force attack on one account from a password spray across many:
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4625
| summarize Attempts = count(), Accounts = dcount(TargetAccount),
SampleAccounts = make_set(TargetAccount, 5) by IpAddress, SubStatus, LogonType
| sort by Attempts descMany attempts against one account point to brute force. A handful of attempts against each of many accounts, from the same source, is a spray. Then look for a 4624 from the same IP address after the failures: that is the moment the attack worked.
Accounts and groups: 4720 to 4756
Attackers who get in often create an account or add one to a privileged group, so they keep access even after a password reset.
- 4720: a user account was created.
- 4722: a user account was enabled.
- 4724: an attempt was made to reset an account's password.
- 4725 and 4726: an account was disabled, or deleted.
- 4738: a user account was changed.
- 4740: an account was locked out. On a domain, look for it on the domain controllers: its Caller Computer Name field names the machine the failed attempts came from.
- 4728, 4732 and 4756: a member was added to a security-enabled global, local or universal group. The group name is what matters: Domain Admins, Enterprise Admins, Administrators or any group that grants access to sensitive systems.
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID in (4728, 4732, 4756)
| where TargetUserName in ("Domain Admins", "Enterprise Admins", "Administrators", "Schema Admins")
| project TimeGenerated, Computer, ChangedBy = SubjectUserName, Group = TargetUserName, MemberNameEvery result should match a change ticket. One that does not is a possible privilege escalation, and it is one of the few Windows events that justifies an alert on every single occurrence.
Kerberos and NTLM on domain controllers: 4768, 4769, 4771 and 4776
Domain controllers record authentication for the whole domain, which makes them the best place to see an attack spread.
- 4768: a Kerberos authentication ticket (TGT) was requested. Effectively, a user proving their password to the domain.
- 4769: a Kerberos service ticket was requested, to access a specific service. A burst of 4769 events for many service accounts with RC4 encryption (ticket encryption type
0x17) is the classic sign of Kerberoasting, covered in detail in the Kerberoasting explainer. - 4771: Kerberos pre-authentication failed, usually a wrong password. It is the domain controller's view of failures that would otherwise appear as 4625 on member machines.
- 4776: the domain controller attempted to validate the credentials for an account with NTLM.
NTLM network logons (4624 type 3 with authentication package NTLM) from one workstation to many servers in a short time are a common pattern for lateral movement and pass-the-hash. In a domain that mostly uses Kerberos, a sudden rise in NTLM from an unusual host deserves a look.
Processes, services and scheduled tasks: 4688, 7045, 4697 and 4698
Once you know who got in, the next question is what they ran.
- 4688: a new process has been created. It records the new process, its parent (Creator Process Name) and, if enabled, the full command line. The Token Elevation Type shows whether it ran elevated.
- 7045: a service was installed in the system. This one is in the System log, not the Security log. Tools such as PsExec and many remote-execution frameworks install a service on the target, so an unfamiliar service name with a binary in a temporary folder or a long command line is a strong lead.
- 4697: a service was installed in the system, the Security log equivalent, when the Security System Extension subcategory is audited.
- 4698: a scheduled task was created, a favorite way to persist. The event includes the task's XML, with the command it runs.
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 4688
| where ParentProcessName has_any ("winword.exe", "excel.exe", "outlook.exe", "w3wp.exe")
| where NewProcessName has_any ("cmd.exe", "powershell.exe", "rundll32.exe", "mshta.exe")
| project TimeGenerated, Computer, Account, ParentProcessName, NewProcessName, CommandLineOffice applications and web server worker processes rarely have a good reason to start a shell. For richer process data, with hashes and network connections tied to each process, Sysmon fills the gaps; see Sysmon for beginners.
Covering tracks: 1102 and 104
- 1102: the audit log was cleared. Logged in the Security log, and it records who cleared it.
- 104: the System log was cleared, in the System log.
Administrators almost never clear the Security log on purpose. Treat 1102 as high severity until you have a confirmed reason, and remember that if logs are forwarded to a SIEM, the events from before the clearing are still there.
SecurityEvent
| where TimeGenerated > ago(30d)
| where EventID == 1102
| project TimeGenerated, Computer, AccountA worked example: putting a timeline together
Here is how these events fit together in a lab scenario where an attacker sprays passwords from a compromised workstation, WKS-042, and moves to a file server:
- 09:12 to 09:20, domain controller and servers. Dozens of 4625 events from
WKS-042against 60 accounts, Sub Status0xC000006A, logon type 3. A spray. - 09:21, file server
FS-01. A 4624, logon type 3, NTLM, for the service accountsvc_backupfromWKS-042, followed by a 4672: the account has admin rights on the server. - 09:24,
FS-01. A 7045 with a new service running a randomly named executable fromC:\Windows\Temp, then 4688 events withcmd.exerunningwhoamiandnet group "Domain Admins" /domain. Remote execution and discovery. - 09:31, domain controller. A 4720 creating the account
helpdesk2, then a 4728 adding it to Domain Admins, both withsvc_backupas the subject. - 09:40,
FS-01. A 1102: the Security log was cleared.
None of these events is conclusive alone. Together, in order, with the Logon ID and the source host tying them up, they tell the whole story: initial access, credential abuse, execution, persistence and an attempt to hide. That timeline is what goes into the ticket and drives containment: disable svc_backup and helpdesk2, isolate WKS-042 and FS-01, and scope what else svc_backup touched.
Common mistakes
- Reading the wrong machine. A 4624 is logged where the logon landed. To see what a user's own workstation did, look at its 4648 events or at the destination servers.
- Ignoring logon type. Counting 4624 events without splitting by type mixes service logons, file shares and Remote Desktop into one meaningless number.
- Stopping at Status. For failed logons, Sub Status holds the real reason.
- Forgetting the System log. Service installs (7045) and System log clearing (104) are not in the Security log.
- Trusting local logs alone. An attacker with admin rights can clear them. Forward events to a SIEM as close to real time as possible.
Why it matters for a SOC analyst
Endpoint and identity products raise the alert, but Windows events are often what you use to confirm it, scope it and build the timeline, especially on servers and domain controllers. You do not need to memorize hundreds of IDs: the ones on this page cover most investigations. Keep the list close, learn what normal looks like in your environment, and practice turning a pile of events into a short, ordered story. That is the work, and it is what the next analyst on shift will need from your ticket.
Terms in this article
- Windows event log
- Windows' built-in record of system activity, organized in channels such as Security and System, where each event type has a numeric ID.
- Logon type
- A number in Windows logon events (4624, 4625) that says how the logon happened: at the console, over the network, as a service, by Remote Desktop and so on.
- Password spray
- An attack that tries a few common passwords against many accounts, staying under lockout limits that per-account guessing would trigger.
- Brute force
- Gaining access by systematically trying passwords or keys until one works, either online against a login or offline against stolen hashes.
- Lateral movement
- The techniques attackers use to move from the first compromised system to other systems and accounts inside a network.
- Pass-the-hash
- Authenticating as a user with their stolen password hash instead of the password itself, abusing how NTLM works to move between Windows systems.
- Kerberoasting
- Requesting Kerberos service tickets for service accounts and cracking them offline to recover those accounts' passwords.
- Privilege escalation
- Gaining higher permissions than an account was given, such as moving from a standard user to local administrator, domain admin or cloud global admin.
- NTLM
- An older Windows challenge-response authentication protocol, still used as a fallback to Kerberos and a frequent target of relay and pass-the-hash attacks.
- Kerberos
- The ticket-based authentication protocol used by Active Directory, in which a domain controller issues tickets that prove a user's identity to services.
- Sysmon
- A free Microsoft Sysinternals tool that runs as a Windows service and logs detailed process, network and file activity to the event log.
- SIEM
- A platform that collects logs from across an organization, correlates them and raises alerts, giving the SOC one place to investigate.
- KQL
- The read-only query language used by Microsoft Sentinel, Defender XDR advanced hunting, Azure Monitor and Azure Data Explorer.
Last reviewed on by The Ledger Editor, Security Engineer