Overview
Windows Event Logs are structured records of system activity generated by Windows components, applications, drivers, and services. They serve as the primary audit and forensic data source on Windows systems — SOC analysts use them to detect attacks, incident responders use them to reconstruct timelines, and pentesters review them to understand the environment or cover tracks. Logs are stored in .evtx format, accessible via Event Viewer, wevtutil, Get-WinEvent, or SIEM ingestion agents.
Default log storage path: C:\Windows\System32\winevt\logs
Terminology
| Term | Definition |
|---|---|
| Event | An individual record entry in an event log; the atomic unit of log data |
| Event ID | A numeric identifier that uniquely identifies the type of event within its source |
| Channel | A logical destination for events — organizes events by source and type (e.g., Security, System) |
| Provider | The component or application that generates and publishes events (e.g., Microsoft-Windows-Security-Auditing) |
| SACL | System Access Control List; records access attempts to secured objects in the Security log |
| ACE | Access Control Entry; individual rule within an ACL or SACL that defines what access triggers auditing |
| Logon Type | Numeric code indicating how a logon occurred (2=interactive, 3=network, 4=batch, 5=service, 7=unlock, 10=remote interactive) |
| .evtx | Windows XML Event Log file format; binary container for event records |
| ETL | Event Trace Log; binary file produced by ETW-based tracing |
| Forwarded Events | Log that aggregates events pushed from remote hosts via Windows Event Forwarding (WEF) |
| Subscription | A WEF configuration that defines which events to collect from which remote machines |
Core Concepts
Default Log Channels
| Log | Purpose |
|---|---|
| Application | Events from installed software and application-layer components |
| Security | Logon events, object access, privilege use, policy changes, and account management |
| Setup | Events generated during Windows installation; Active Directory-related events on domain controllers |
| System | Events from Windows OS components — drivers, services, hardware |
| Forwarded Events | Aggregated events forwarded from remote hosts via WEF |
Beyond these five, Windows has hundreds of additional logs under Applications and Services Logs — including Microsoft-Windows-Sysmon/Operational, Microsoft-Windows-PowerShell/Operational, and Microsoft-Windows-WinRM/Operational.
Anatomy of an Event Record
Every event contains the following fields:
| Field | Description |
|---|---|
| Log Name | The channel the event was written to (e.g., Security, System) |
| Source | The provider or application that generated the event |
| Event ID | The numeric identifier for the event type |
| Task Category | Sub-classification within the source (e.g., “Logon” within the Security provider) |
| Level | Severity of the event — see severity table below |
| Keywords | Filtering tags applied by the provider (e.g., Audit Success, Audit Failure) |
| User | Account context under which the event was generated |
| Computer | Hostname of the system that generated the event |
| Date and Time | UTC timestamp of when the event occurred |
| Description | Human-readable text that varies per Event ID and includes key forensic data |
| Event Data | Structured XML data containing event-specific fields (e.g., SubjectLogonId, TargetUserName) |
The Keywords field is especially useful in Event Viewer for filtering by Audit Success vs Audit Failure. Event Data fields (like SubjectLogonId) enable correlation across events — an analyst can trace all activity tied to a specific logon session.
Severity Levels
| Level | Value | Meaning |
|---|---|---|
| Critical | 1 | Significant failure requiring immediate attention |
| Error | 2 | Non-critical issue related to a service or component |
| Warning | 3 | Potential problem worth investigating |
| Information | 4 | Normal operational event |
| Verbose | 5 | Diagnostic or progress messages |
SACL and Object Access Auditing
A System Access Control List (SACL) enables administrators to log access attempts to secured objects — files, registry keys, processes, Active Directory objects. Each ACE within a SACL specifies:
- The trustee (user or group) whose access should be audited
- The access types that trigger an event (read, write, delete, etc.)
- Whether to log successes, failures, or both
SACL-triggered events appear in the Security log. Without a SACL configured on the target object, events like 4656 (handle requested) and 5145 (share object access check) will not fire. SACL configuration is done through the Advanced Security Settings for a file or object.
A comprehensive list of Windows privileges: https://docs.microsoft.com/en-us/windows/win32/secauthz/privilege-constants
Custom XML Queries in Event Viewer
Event Viewer’s built-in filters only expose common fields. For precise, multi-condition filtering, use raw XML queries:
Path: Filter Current Log → XML tab → Edit Query Manually
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[EventData[Data[@Name='SubjectLogonId']='0x3E7']]
</Select>
</Query>
</QueryList>
This example retrieves all Security events where the SubjectLogonId equals 0x3E7 (the SYSTEM account’s logon ID) — useful for filtering all events performed under the SYSTEM context.
XML queries support:
- Filtering on any EventData field by name and value
- System-level fields (
EventID,Level,TimeCreated) - Boolean operators (
and,or) - Multiple
<Select>paths in a single query
Accessing Event Logs
| Method | Description |
|---|---|
| Event Viewer GUI | eventvwr.msc — view, filter, export; can open saved .evtx files via “Open Saved Log” |
| wevtutil (CMD) | Query, export, clear, and manage logs from the command line — see Windows Command Line |
| Get-WinEvent (PS) | PowerShell cmdlet with advanced filtering via FilterHashtable, FilterXML, FilterXPath — see Windows PowerShell |
| Windows Event Forwarding | Collects logs from remote hosts centrally without agents; configured via subscriptions |
| SIEM Agents | Beats/Winlogbeat, NXLog, or Splunk Universal Forwarder ship logs to a central SIEM — see Elastic Stack, Intro to SIEM |
Important Windows Event IDs
System Log Events
| Event ID | Event Name | Security Relevance |
|---|---|---|
| 1074 | System Shutdown / Restart | Records initiating process, type (shutdown/restart), and reason code — useful for correlating with suspicious activity or post-exploitation cleanup |
| 6005 | Event Log Service Started | System startup indicator; establishes timeline anchors |
| 6006 | Event Log Service Stopped | System shutdown indicator; establishes timeline anchors |
| 6013 | Windows Uptime | Reports uptime in seconds — confirms system was not recently rebooted (important for volatile memory preservation decisions) |
| 7040 | Service Start Type Changed | A service’s startup type was modified (e.g., Automatic → Disabled or Manual → Auto) — attackers modify service startup for persistence |
| 7045 | New Service Installed | A new service was installed — common persistence and privilege escalation vector; review the service binary path for suspicious paths |
Security Log Events
| Event ID | Event Name | Security Relevance |
|---|---|---|
| 1102 | Audit Log Cleared | The Security audit log was cleared — highest-priority post-exploitation anti-forensics indicator; immediate investigation required |
| 1116 | Antimalware Detection | Windows Defender detected malware — note the threat name, file path, and detection action |
| 1118 | Antimalware Remediation Started | Defender began removing the detected threat |
| 1119 | Antimalware Remediation Succeeded | Defender successfully removed the threat |
| 1120 | Antimalware Remediation Failed | Defender failed to remove the threat — file may still be present |
| 4624 | Successful Logon | A user account successfully logged on — inspect Logon Type and LogonID for context |
| 4625 | Failed Logon | Logon attempt failed — high-frequency failures indicate brute force; review Failure Reason and TargetUserName |
| 4648 | Logon with Explicit Credentials | A process used explicit credentials (e.g., RunAs, lateral movement via Pass-the-Hash) — Source and Target account mismatch is suspicious |
| 4656 | Handle to Object Requested | A process requested a handle to a secured object — only fires if a SACL is configured on the target object |
| 4672 | Special Privileges Assigned to New Logon | A privileged account logged on with sensitive privileges (SeDebugPrivilege, SeTcbPrivilege, etc.) — indicates admin or SYSTEM-level access |
| 4698 | Scheduled Task Created | A new scheduled task was created — common attacker persistence mechanism; review the task action and trigger |
| 4700 | Scheduled Task Enabled | A previously disabled scheduled task was re-enabled |
| 4701 | Scheduled Task Disabled | A scheduled task was disabled — attacker may be disabling defensive tasks |
| 4702 | Scheduled Task Updated | An existing scheduled task’s configuration was modified |
| 4719 | System Audit Policy Changed | The system audit policy was modified — attackers may disable audit categories to suppress future logging |
| 4738 | User Account Changed | A user account’s properties were modified (password reset, group membership, account enabled/disabled) |
| 4771 | Kerberos Pre-Authentication Failed | Failed Kerberos TGT request — AS-REP Roasting or brute force against domain accounts |
| 4776 | NTLM Authentication Attempt | The DC attempted to validate NTLM credentials — failed attempts indicate NTLM brute force or credential spraying |
| 5001 | Windows Defender Real-Time Protection Changed | Real-time protection was disabled or its configuration was altered — strong indicator of attacker disabling AV |
| 5140 | Network Share Was Accessed | A network share object was accessed — review ShareName, SubjectUserName, and IpAddress for lateral movement indicators |
| 5145 | Network Share Object Access Check | Detailed permission check on a shared folder/file; only fires if SACL is configured |
| 5157 | Windows Filtering Platform Blocked Connection | Windows Firewall blocked an outbound or inbound connection — may indicate C2 or lateral movement attempts being stopped |
Log Storage and Rotation
Event logs have configurable maximum sizes and retention behaviors:
| Mode | Behavior |
|---|---|
| Circular (Overwrite as needed) | New events overwrite oldest events when the log is full — default for most logs |
| Retain (Archive the log, do not overwrite) | Log is archived when full; no new events until manually cleared |
| AutoBackup | Log is automatically backed up and cleared when full |
Security log size should be increased significantly in high-activity environments — the default 20 MB fills quickly under attack conditions. Centralized log forwarding (SIEM or WEF) protects against local log clearing (Event ID 1102).
Related Concepts
- Windows Command Line
- Windows PowerShell
- Windows Fundamentals
- Log Fundamentals
- Event Tracing for Windows (ETW)
Related Techniques
Related Tools
References / Images
- Windows XML Event Log (EVTX) Format: https://github.com/libyal/libevtx/blob/main/documentation/Windows%20XML%20Event%20Log%20(EVTX).asciidoc
- Advanced XML Filtering in Event Viewer: https://techcommunity.microsoft.com/t5/ask-the-directory-services-team/advanced-xml-filtering-in-the-windows-event-viewer/ba-p/399761
- Ultimate Windows Security Event ID Encyclopedia: https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/
- Windows Privilege Constants: https://docs.microsoft.com/en-us/windows/win32/secauthz/privilege-constants