A proof-of-concept tool that demonstrates ETW (Event Tracing for Windows) evasion by patching the EtwpEventWriteFull internal function in memory. This technique prevents ETW from logging events by making the function return immediately.
The tool works by:
- Locating
ntdll.dllin memory - Finding the
EtwEventWriteTransferor any other function that usesEtwpEventWriteFullusingGetProcAddress - Searching for the internal call to
EtwpEventWriteFulland calculates it's address like that:
baseAddressOfExportedFunction + i(call instruction offset) + 5(call instruction with argument) + relativeOffset(call argument)
- Patching at found address with an early RET instruction (0xC3)
gcc .\stealthy_etw_patch.c -o .\stealthy_etw_patch.exe -ldnsapiRun the compiled executable with administrator privileges:
.\stealthy_etw_patch.exeThe program also test the technique by using DnsQuery_A which can later be examined using the Microsoft-Windows-DNS-Client ETW provider (e.g Sysmon)



