ETW Bypasses
ETW is used by windows to trace and log system events. Attackers can clear these logs but this itself creates a new event log. The CLR sends ETW events to any ETW consumers, which provides means to detect suspicious .NET use.
Here are some ways to tamper and disable ETW so that event logs don't popup.
(note that the commands below can be replicated by just modifying the registry)
Autologger Provider Removal
This removes a provider entry from autologger, this will cause events to stop flowing to their trace session. To list all providers, we can issue this command:
To remove a provider:
This will end up deleting the registry key:
Provider Enable Property Modification
This alerts the enable keyword of an autologger session. By default ETW provider entries in the EventLogApplication autoloffer sessions have a value of 0x41, this is equals to EVENT_ENABLE_PROPERTY_SID and EVENT_ENABLE_PROPERTY_ENABLE_KEYWORD_0. Events generated by a provider are logged even if the keyword value is set to 0.
If we replaces the property EVENT_ENABLE_PROPERTY_ENABLE_KEYWORD_0 for EVENT_ENABLE_PROPERTY_IGNORE_KEYWORD_0, it will result in events where the keyword is 0 not logged.
PowerShell events supplies a 0 keyword value and as a result they will not appear in the PowerShell event log.
Removing ETW Providers From a Trace Session
We can just simply remove an ETW provider from a trace session which will not log until the next reboot or if the provider is restored.
EtwEventWrite Patching
EtwEventWrite function is responsible of writing events to a session. This can be patched to evade ETW patches due to the fact that this is userland and is in a process that an attacker can control.
We can also do this in c++:
Last updated