In the following example, we will collect process event data from the
Kernel provider and use image loads to identify Mimikatz execution. We
can collect the required data with this command:
SilkETW.exe -t kernel -kk |
With data in hand it is easy to sort, grep and filter for the
properties we are interested in (Figure 2).
Figure 2: PowerShell event filtering
SilkETW has a number of command line flags that allow the user to
restrict the events that are captured. These include the event name,
the process ID, the process name, and the opcode. To further enhance
this capability, Yara support is included to filter or tag trace
events. While Yara has immediate defensive connotations, the reader is
reminded that Yara rules are equally useful to augment research capabilities.
In the following contrived example we will use a Yara rule to detect
Seatbelt
execution in memory through Cobalt Strike's execute-assembly.
rule } |
We can start collecting .NET ETW data with the following command
(note here the "-yo" option indicating that we will only
write the Yara matches to file!):
SilkETW.exe -t user -pn |
We can see at runtime that our Yara rule was hit (Figure 3).
Figure 3: Yara rule hit
Note also that we are only capturing a subset of the
"Microsoft-Windows-DotNETRuntime" events (0x2038),
specifically: JitKeyword, InteropKeyword, LoaderKeyword and NGenKeyword.
As outlined in the introduction, SilkETW is currently a research
focused data-collection tool with robust yet rudimentary capabilities.
Upcoming changes for SilkETW include, but are not limited to:
SilkETW is currently available for href="https://github.com/fireeye/SilkETW">download on GitHub.
Special thanks to the whole Advanced Practices team – and Nick Carr
in particular – for their indulgence of my antics! Thanks also to
Stephen Davis, Anthony Berglund and Kevin Boyd of the FireEye Labs and
Data Science teams for their help on reviewing this project and their
prior work on href="https://www.fireeye.com/blog/threat-research/2017/09/pywintrace-python-wrapper-for-etw.html">pywintrace.
If you are looking for Python ETW bindings you can use
programmatically, definitely check out that project.