Windows EVTX Log Structure and Forensic Analysis Techniques
Starting with Windows Vista and Windows Server 2008 (NT 6.0), Microsoft transitioned from the legacy evt format to the binary XML-based evtx format. These files are generated by the Windows Event Log service and store a sequential history of system, application, and security events. Understanding the internal layout and extraction methods is critical for digital investigations.
Internal Architecture
An evtx file is logically segmented into three primary components:
- A fixed-size file header
- Sequential data chunks
- Zero-byte padding at the end
File Header Layout The initial 4096 bytes contain metadata governing the entire log file. Key offsets include:
| Offset (Hex) | Size | Value / Marker | Description |
|---|---|---|---|
0x00 |
8 | ElfFile\x00 |
File signature |
0x08 |
8 | Integer | Oldest chunk sequence number |
0x10 |
8 | Integer | Newest chunk sequence number |
0x18 |
8 | Integer | Next available event record ID |
0x20 |
4 | 128 | Valid header data length |
0x24 |
2 | 1 | Minor version |
0x26 |
2 | 3 | Major version |
0x28 |
2 | 4096 | Total header size |
0x2A |
2 | Integer | Total chunk count |
0x7C |
4 | Integer | CRC32 checksum (covers first 120 bytes) |
Chunk Segmentation Following the header, the file is divided into 64KB (65536-byte) blocks. Each block operates independently and contains:
- A 512-byte chunk header
- A sequence of variable-length event records
- Unused padding space
Chunk Header Structure:
| Offset (Hex) | Size | Description |
|---|---|---|
0x00 |
8 | Signature (ElfChnk\x00) |
0x08 - 0x20 |
8 bytes each | First/Last record IDs (log-level and file-level) |
0x28 |
4 | Header size (always 512) |
0x2C |
4 | Offset to the final record |
0x30 |
4 | Offset to the next record |
0x34 |
4 | CRC32 checksum for event data |
0x7C |
4 | CRC32 for the chunk header itself |
Event Record Composition
Individual records are not fixed in size. Each begins with a 4-byte signature (*\*\x00\x00), followed by the total record length, a unique 8-byte record ID, an 8-byte FILETIME timestamp, and a variable-length Binary XML payload. A duplicate of the record length is appended at the end to facilitate backward parsing. Since records cannot span across chunk boundaries, parsing engines process each block sequentially.
Storage Locations and Log Categories
Windows maintains event archives in %SystemRoot%\System32\winevt\Logs\. The three fundamental logs are:
- System: Tracks OS-level operations, driver failures, service startups, and hardware events.
- Application: Captures software-specific output, database errors, and program crashes.
- Security: Contains audit trails for authentication, privilege escalation, policy modifications, and object access. This log is prioritized during forensic triage.
When the maximum file size limit is reached, the Event Log service overwrites the oldest entries in a circular buffer fashion.
Event Classification and Identification
Each log entry is categorized by a numeric identifier. Critical security-related identifiers include:
| Event ID | Significance |
|---|---|
4608 / 4609 |
OS startup and shutdown |
4616 |
System clock modification |
4624 / 4625 |
Successful / Failed logon attempts |
4634 / 4648 |
Session termination / Explicit credential logon |
4720 / 4725 |
User account creation / Account disablement |
4704 |
Privilege assignment to an account |
4768 / 4769 |
Kerberos TGT request / Service ticket request |
4779 |
Remote desktop session disconnect |
Extraction and Querying Utilities
Analysts can inspect raw evtx files natively via Event Viewer, which provides graphical filtering, search capabilities, and XML export. For automated or large-scale parsing, command-line and third-party utilities are preferred.
Microsoft Log Parser This legacy SQL-like engine processes structured and semi-structured data. The syntax requires specifying input and output formats before executing a query. Example Command:
logparser.exe -i:EVT -o:CSV "SELECT TimeGenerated, SourceName, EventID, Strings FROM C:\Logs\audit.evtx WHERE EventID=4624" > auth_success.csv
The tool supports multiple input parsers (EVTX, IIS, CSV, FS) and output formats (CSV, XML, CHART). Built-in help details supported functions and grammar.
EvtxECmd & Modern Alternatives
Community-driven parsers like EvtxECmd convert binary logs into structurde JSON, XML, or CSV outputs.
Execution Pattern:
EvtxECmd.exe -d C:\Evidence\Logs\ -f Security.evtx --csv C:\Output\parsed_events.csv --json C:\Output\events.json
GUI wrappers such as Event Log Explorer and Log Parser Lizard provide visual query builders and timeline visualization, streamlining manual review.
Forensic Case Application: Lateral Movement Detection
During an incident response engagement, analysts received domain controller and endpoint event archives to investigate a suspected Pass-the-Hash intrusion. The scenario indicated anomalous desktop file appearances followed by repeated Windows Defender deactivation prompts.
Cross-referencing timestamps across multiple hosts revealed a critical pivot point. Converting FILETIME UTC values to the local timezone showed an authentication spike at approximately 21:59 UTC. Querying the domain controller's security log for Event ID 4624 with Logon Type 3 (Network) and Logon Type 2 (Interactive) highlighted a specific domain account executing remote management.
The logs showed the attacker leveraged an extracted NTLM hash to authenticate via SMB, subsequantly deploying PsExec to establish a remote command shell on the primary controller. The investigation focused on mapping the compromised credentials, correlating Event ID 4648 (explicit credential use) with Event ID 4672 (special privileges assigned to new logon), and isolating the originating IP address from Event ID 4625 or 4675 failure trails. This chain of evidence confirmed credential dumping followed by lateral propagation using native administration tools.