feat: add ETW patching support for self-injection indirect syscall te… - #72
Merged
Conversation
…mplates - Add --etw-patch CLI flag for ETW function patching (EDR evasion) - Add uses_indirect_syscalls() and supports_etw_patch() methods to Execution enum - Implement add_etw_patch_replacements() in replacements.rs using rust_syscalls - Integrate ETW patch placeholders into sysFIBER template - Add validation to restrict ETW patch to eligible templates only - Update tests for new functionality ETW patching is only available for templates that combine: - Self-injection (executes in current process) - Indirect syscalls (uses rust_syscalls for NtProtectVirtualMemory) Current eligible template: sysFIBER The patch works by: 1. Parsing PEB to find ntdll.dll base address 2. Parsing export directory to find ETW functions 3. Using NtProtectVirtualMemory (via rust_syscalls) to change permissions 4. Patching function prologues with RET (0xC3) + NOPs 5. Restoring original permissions This avoids hardware breakpoints and uses only indirect syscalls. Co-authored-by: Nariod <Nariod@users.noreply.github.com>
Nariod
added a commit
that referenced
this pull request
Aug 26, 2026
- Add --etw-patch flag to Command Line Options (container and native modes) - Add 'ETW patching compatible' column to Self-Execution Templates table - Add ETW Patching description to Detection Evasion section - Add usage example with --etw-patch for sysfiber template Closes documentation gap for ETW patching feature (PR #72) Co-authored-by: Nariod <Nariod@users.noreply.github.com>
Nariod
added a commit
that referenced
this pull request
Aug 26, 2026
- Add --etw-patch flag to Command Line Options (container and native modes) - Add 'ETW patching compatible' column to Self-Execution Templates table - Add ETW Patching description to Detection Evasion section - Add usage example with --etw-patch for sysfiber template Closes documentation gap for ETW patching feature (PR #72) Co-authored-by: Nariod <Nariod@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…mplates
ETW patching is only available for templates that combine:
Current eligible template: sysFIBER
The patch works by:
This avoids hardware breakpoints and uses only indirect syscalls.