Introduction
EVTX is the format of the Windows event
logs, used since Windows Vista. The System, Application and Security logs, and the logs
of many other services, are EVTX files kept in
C:\Windows\System32\winevt\Logs. Each event records its source, an event ID,
a level, a time and details that depend on the event.
Events are shown as XML, but stored in a compact binary form of XML that reuses templates, so that thousands of similar events take little space. The format replaced the older EVT format of Windows XP.
Structure
The file starts with a 4096-byte file
header beginning ElfFile and a zero
byte. It records the first and last chunk numbers, the next record number, the format
version, the number of chunks, flags such as whether the log was closed cleanly, and a
checksum.
Chunks of 64 KB follow, each starting ElfChnk and a zero byte. A chunk
header gives the range of records in the chunk and checksums, and holds tables of the
strings and templates its records share. Event records fill the rest of the chunk. Each
record starts with the signature 2A 2A 00 00, then its size, record number
and time, then the event as binary XML, and
ends with its size again.
0File headerElfFile, chunk count, next record number, checksum4,096 bytes4096Chunk one per 64 KB of the logrepeated+0Chunk headerElfChnk, record range, checksums, string and template tables512 bytes+512Event records2A 2A 00 00, size, number, time, binary XMLrepeated
Not described
Known, not yet covered
- Reference: from [MS-EVEN6]: the event identifier layout and levels, the keyword bitmask, the recovery steps for a damaged file, the file validity check, and the float string forms (binary XML).
- Viewer: there is no viewer for EVTX files yet.
Unknown
- Reference: the 4 bytes at the start of each name in a chunk, the unknown field of 74 bytes in the file header, the meaning of some template header fields, and whether a Bool value is one or four bytes: Microsoft and libevtx disagree.
Links
Software
- Event Viewer – built into Windows, shows and filters event logs (Windows)
- wevtutil and Get-WinEvent – the command-line tool and PowerShell command for event logs, built into Windows (Windows)
- EvtxECmd – Eric Zimmerman’s event log parser for forensic work (Windows)
- Chainsaw – tool for searching event logs for signs of attack (Windows, macOS, Linux)
Developers
- python-evtx – library that parses EVTX files (Python)
- evtx – library and command-line tool that parses EVTX files (Rust)
- libevtx – library with Python bindings that reads EVTX files, with notes on the format (C)