EVTX
Windows DFIR notes are no longer maintained on InfoSec-Notes. Updated versions can be found on: artefacts.help.
Export Windows event logs
The entirety of the C:\Windows\System32\winevt\Logs
directory can be copied to export all the Windows event logs EVTX hives. The event logs can also be exported through the Windows GUI Event Viewer (eventvwr.msc)
application and the CLI wevtutil
utilities. The PowerShell cmdlet Get-WinEvent
does not provide a way to export logs in the EVTX format.
To be able to view some event logs, notably the Security
event logs, the Manage auditing and security log (SeSecurityPrivilege)
right is required. Note that this right also grant the ability to clear the event logs. Additionally, in order to remotely copy the C:\Windows\System32\winevt\Logs
directory, Administrator privileges are required to access the C$
share.
The following commands can be used to unitary export a event logs hive in the evtx
format:
The following batch script can be used to retrieve all Windows event logs from a remote specified target.
Usage:
List and query Windows event logs
GUI event logs viewers
The Windows Event Viewer
built-in application and the Event Log Explorer
application can be used to analyze event logs through graphical application.
Event Log Explorer
offers the possibility to separate loaded hives by system, parametrize and save advance filters and consolidate event logs hives from different systems.
CLI utilities
The PowerShell cmdlet Get-WinEvent
and the wevtutil
utility can be used to list available event log hives and filter event log, from both local or remote system.
The following commands can be used to enumerate the available event logs hives:
The following commands can be used to retrieve information and metadata about the specified event logs hives:
The following commands can be used to filter the event logs.
The wevtutil
utility supports only XPath
queries. The Windows Event Viewer can be used to define a filter query through the GUI and export the filter in a XPath format.
The PowerShell cmdlet Get-WinEvent
can be used to filter the event logs on the following attributes:
LogName (
<String[]>
)Path (
<String[]>
)ID (
<Int32[]>
)StartTime (
<DateTime>
)EndTime (
<DateTime>
)UserID (
<SID>
)Data (
<String[]>
)
Convert Windows evtx to text / csv format
The Python utilities suite python-evtx
can be used to parse and export to a text format Windows event log hives. The EvtxECmd
utility can also be used to parse Windows event log hives into a CSV format.
It can notably be used to take advantage of Linux utilities such as grep
and awk
.
CSV searching
The Linux sort
utility can be used to sort CSV fields:
q
is a command line tool that allows direct execution of SQL-like queries on CSV files.
Automated analysis
hayabusa
hayabusa
is a tool written in Rust that leverage Sigma-based rule, converted in the "hayabusa" YML
format as well as custom detection rules to generate a timeline of notable events from Windows EVTX
logs. The resulting timeline is exported in CSV
format.
hayabusa
currently supports most the Sigma rule specification and delivers better results on default Windows events (without Sysmon
notably) than Chainsaw
.
DeepBlueCLI
The DeepBlueCLI
PowerShell script can be used to automate a basic analysis of Windows events logs. A number of detection cases are implemented, related to:
Suspicious account behavior (user creation and group membership operations, bruteforce attempts, etc.)
Command line / Sysmon / PowerShell auditing (long command line, PowerShell obfuscated command or download one-liner, etc.)
Service operations (suspicious service creation, Windows Event Log service stating / stopping, etc.)
The following Windows event logs / providers are supported:
Windows Security (
Security.evtx
)Windows System (
System.evtx
)Windows Application (
Application.evtx
)Windows PowerShell
Sysmon
Last updated