← All Challenges

Challenge 43: ETW Patching

Difficulty: Hard
Category: AMSI Bypass


Objective

Blind the Event Tracing for Windows (ETW) telemetry pipeline by patching the EtwEventWrite function in memory. Even after bypassing AMSI, ETW can log your activity to security tools — disable it completely.

Scanner Behavior

Even if you successfully bypass AMSI (so the provider never sees your payloads), Windows has a second telemetry channel: Event Tracing for Windows (ETW). ETW is a high-performance logging framework built into the Windows kernel and user-mode libraries.

PowerShell logs extensive information via ETW, including:

Security tools and EDR (Endpoint Detection & Response) solutions consume these ETW events. So even with AMSI dead, your activity can still be observed through ETW logs.

All user-mode ETW events flow through a single function: EtwEventWrite in ntdll.dll. This is the final bottleneck before events are written to the ETW infrastructure. Patching this function blinds all ETW providers in the process.

Rules

Hints

  1. The technique is identical to Challenge 32 (memory patching) but targets a different function in a different DLL.
  2. ntdll.dll is always loaded in every Windows process — you can find it reliably.
  3. EtwEventWrite should return 0 (STATUS_SUCCESS / ERROR_SUCCESS) without doing any work.
  4. Same pattern: VirtualProtect to make it writable, overwrite the first few bytes with instructions that return 0, restore protections.
  5. On x64, the return instruction sequence may differ from x86. Consider the calling convention.
  6. This must be done after or alongside AMSI bypass for complete stealth.

View Solution