Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time

SilkETW & SilkService

SilkETW & SilkService are flexible C# wrappers for ETW, they are meant to abstract away the complexities of ETW and give people a simple interface to perform research and introspection. While both projects have obvious defensive (and offensive) applications they should primarily be considered as research tools.

For easy consumption, output data is serialized to JSON. The JSON data can either be written to file and analyzed locally using PowerShell, stored in the Windows eventlog or shipped off to 3rd party infrastructure such as Elasticsearch.

For more information on the future of SilkETW & SilkService, see the Roadmap section.


For more background on SilkETW and SilkService please consult the following resources.

  • SilkETW: Because Free Telemetry is … Free! - here
  • SilkETW & SilkService BlackHat Arsenal 2019 - here
  • Threat Hunting with ETW events and HELK — Part 1: Installing SilkETW (by @Cyb3rWard0g) - here
  • Threat Hunting with ETW events and HELK — Part 2: Shipping ETW events to HELK (by @Cyb3rWard0g) - here
  • Events from all manifest-based and mof-based ETW providers across Windows 10 versions (by @jdu2600) - here
  • Hunting for Suspicious LDAP Activity with SilkETW and Yara - here

Implementation Details


SilkETW is buit on .Net v4.5 and uses a number of 3rd party libraries, as shown below. Please see LICENSE-3RD-PARTY for further details.

ModuleId                                 Version LicenseUrl                                                   
--------                                 ------- ----------                                                   
McMaster.Extensions.CommandLineUtils     2.3.2                        
Microsoft.Diagnostics.Tracing.TraceEvent 2.0.36
Newtonsoft.Json                          12.0.1                               
System.ValueTuple                        4.4.0     
YaraSharp                                1.3.1


Command Line Options

Command line usage is fairly straight forward and user input is validated in the execution prologue. See the image below for further details.




SilkService was created because a large number of people wanted to run SilkETW headless and perform ETW collection for multiple sources at the same time. While there is obvious appeal to this, the following points should be kept in mind.

  • SilkETW & SilkService were created by a one-man engineering army, (@FuzzySec), they are not backed by a department of developers and as such may contain bugs. If you do encounter bugs or see ways to improve these projects you are strongly encouraged to file tickets and/or submit pull requests.
  • ETW collection can be resource intensive. Do not roll out SilkService across a wide range of hosts without thorough performance testing. Ensure that the configuration can run stably on your least powerful machines.


After compiling or downloading the release package you can install the service by issuing the following command from an elevated prompt.

sc create SillkService binPath= "C:\Path\To\SilkService.exe" start= demand


SilkService ingests an XML configuration file, "SilkServiceConfig.xml", which should be placed in the same directory as the service binary. An example configuration file can be seen below.

		This is a user collector
		-> Microsoft-Windows-DotNETRuntime
		-> GUID or string based name
		This is a user collector
		This is a kernel collector

Note that each ETWCollector element should have a random GUID, this is used for internal tracking and logging purposes. You can generate GUID's in PowerShell using the following command:

PS C:\> [guid]::NewGuid()



At runtime SilkService will create a "Logs" subfolder to record service runtime information. This is an invaluable resource to poll the service state, verify service parameter validation and review error information. SilkService has a preference to shut down gracefully if it encounters any type of error, even if such an error does not strictly require termination. This design decision was made purposely as it is not a sound strategy to have dangling collectors or partial operability.

Always consult the service log if the service shuts itself down!

Something went wrong?

It is always possible that something goes wrong. Consult the service log for further details. While SilkService is configured to terminate and clean up ETW collectors or error it is possible that a stale collector remains registered after process termination. To list running collectors you can use the following command.

logman -ets

If any stale collectors are identified they can be removed by issuing the following commands from an elevated prompt.

Get-EtwTraceProvider |Where-Object {$.SessionName -like "SilkService*"} |ForEach-Object {Stop-EtwTraceSession -Name $.SessionName}
Get-EtwTraceProvider |Where-Object {$_.SessionName -like "SilkService*"} |Remove-EtwTraceProvider

Output Format

JSON Output Structure

The JSON output, prior to serialization, is formatted according to the following C# struct.

public struct EventRecordStruct
    public Guid ProviderGuid;
    public List<String> YaraMatch;
    public string ProviderName;
    public string EventName;
    public TraceEventOpcode Opcode;
    public string OpcodeName;
    public DateTime TimeStamp;
    public int ThreadID;
    public int ProcessID;
    public string ProcessName;
    public int PointerSize;
    public int EventDataLength;
    public Hashtable XmlEventData;

Note that, depending on the provider and the event type, you will have variable data in the XmlEventData hash table. Sample JSON output can be seen below for "Microsoft-Windows-Kernel-Process" -> "ThreadStop/Stop".


      "FormattedMessage":"Thread 11,996 (in Process 8,416) stopped. ",


Filter data in PowerShell

You can import JSON output from SilkETW in PowerShell using the following simple function.

function Get-SilkData {
	$JSONObject = @()
	Get-Content $Path | ForEach-Object {
		$JSONObject += $_ | ConvertFrom-Json

In the example below 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 the following command.

SilkETW.exe -t kernel -kk ImageLoad -ot file -p C:\Users\b33f\Desktop\mimikatz.json

With data in hand it is easy to sort, grep and filter for the properties we are interested in.



SilkETW includes Yara functionality to filter or tag event data. Again, this has obvious defensive capabilities but it can just as easily be used to augment your ETW research.

In this example we will use the following Yara rule to detect Seatbelt execution in memory through Cobalt Strike's execute-assembly.

rule Seatbelt_GetTokenInformation
		$s1 = "ManagedInteropMethodName=GetTokenInformation" ascii wide nocase
		$s2 = "TOKEN_INFORMATION_CLASS" ascii wide nocase
		$s3 = /bool\(native int,valuetype \w+\.\w+\/\w+,native int,int32,int32&/
		$s4 = "locals (int32,int64,int64,int64,int64,int32& pinned,bool,int32)" ascii wide nocase
		all of ($s*)

We can start collecting .Net ETW data with the following command. The "-yo" option here indicates that we should only write Yara matches to disk!

SilkETW.exe -t user -pn Microsoft-Windows-DotNETRuntime -uk 0x2038 -l verbose -y C:\Users\b33f\Desktop\yara -yo matches -ot file -p C:\Users\b33f\Desktop\yara.json

We can see at runtime that our Yara rule was hit.


Note also that we are only capturing a subset of the "Microsoft-Windows-DotNETRuntime" events (0x2038), specifically: JitKeyword, InteropKeyword, LoaderKeyword and NGenKeyword.

How to get SilkETW & SilkService?

You can either download the source and compile it in Visual Studio. Please note that you can get the community edition of Visual Studio free of charge. Or you can grab the latest pre-built version from releases.

Future Work


For details on version specific changes, please refer to the Changelog.


  • Offer users the option to write trace data to disk as *.etl files.
  • Offer users the option to write trace data to the Windows event log. (v0.5+)
  • Offer users pre-compiled releases. (v0.6+)
  • Create a separate instance (SilkService) which can be deployed as a service with a configuration file. (v0.7+)
  • Suggestions welcome!


No description, website, or topics provided.




No packages published