Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JoasASantos/SysWhispers4/llms.txt
Use this file to discover all available pages before exploring further.
Overview
EDR products employ multiple detection layers to identify direct syscall usage. Understanding these vectors helps you choose the right combination of resolution and invocation methods for your engagement.Detection Vector Comparison
| Detection Vector | Embedded | Indirect | Randomized | Egg |
|---|---|---|---|---|
| User-mode hook bypass | ✅ | ✅ | ✅ | ✅ |
| RIP inside ntdll at syscall | ❌ | ✅ | ✅ | ❌ |
No 0F 05 in binary on disk | ✅¹ | ✅ | ✅ | ✅ |
| Random gadget per call | ❌ | ❌ | ✅ | ❌ |
| Clean call stack | ² | ² | ² | ² |
| Memory scan evasion during sleep | ³ | ³ | ³ | ³ |
| Kernel ETW-Ti bypass | ❌ | ❌ | ❌ | ❌ |
- ¹ The
syscallopcode exists in your PE’s.textsection at your code address, not ntdll - ² Requires
--stack-spoofflag - ³ Requires
--sleep-encryptflag
Detection Layers Explained
User-Mode Hooks
What it is: EDR products place inline hooks (JMP instructions) at the start ofntdll.dll functions to intercept API calls.
Bypass: All SysWhispers4 methods bypass these hooks because they invoke syscalls directly, never calling the hooked functions.
Effectiveness: ✅ All methods
RIP Location Analysis
What it is: When a syscall instruction executes, the kernel can inspect the return address (RIP). Legitimate Windows API calls have RIP pointing intontdll.dll, while direct syscalls from user code point into the calling PE.
Detection signature:
- Indirect (
--method indirect): Jumps to asyscall;retgadget inside ntdll - Randomized (
--method randomized): Same as indirect, but selects a random gadget from a pool of up to 64
- ❌ Embedded: RIP in your PE
- ✅ Indirect/Randomized: RIP in ntdll
- ❌ Egg hunt: RIP in your PE
Static Binary Analysis
What it is: Scanning the on-disk PE file forsyscall opcodes (0F 05) outside of system DLLs.
Detection heuristic:
- Egg hunt (
--method egg): Replacessyscallwith a random 8-byte egg marker at compile time, then patches it at runtime
- ⚠️ Embedded/Indirect/Randomized:
syscallvisible on disk - ✅ Egg hunt: No
syscallopcode in binary
Gadget Whitelisting
What it is: Advanced EDRs catalog legitimate syscall gadgets in ntdll and flag calls from uncatalogued or suspicious gadgets. Detection example:- Randomized indirect (
--method randomized): Uses RDTSC for entropy to select from up to 64 gadgets on every call
- ❌ Indirect: Same gadget every call (detectable pattern)
- ✅ Randomized: Different gadget per call (defeats cataloging)
Call Stack Walking
What it is: EDRs inspect the call stack to verify calls originated from legitimate code paths. Suspicious pattern:- Stack spoofing (
--stack-spoof): Synthetic return address pointing into ntdll
- ❌ Default: Suspicious flat stack
- ✅ With
--stack-spoof: Appears to originate from ntdll
Memory Scanning
What it is: Periodic scans of process memory looking for known malicious patterns, IOCs, or suspicious code signatures. Bypass methods:- Sleep encryption (
--sleep-encrypt): Ekko-style XOR encryption of.textsection during sleep - Obfuscation (
--obfuscate): Junk instruction injection, stub reordering - SSN encryption (
--encrypt-ssn): XOR-encrypted SSN table at rest
- ❌ Default: Syscall stubs visible in memory
- ✅ With evasion flags: Encrypted/obfuscated signatures
Kernel ETW-Ti
What it is:Microsoft-Windows-Threat-Intelligence provider operates at kernel level, logging syscall events regardless of how they’re invoked.
Events logged:
- Process creation
- Thread creation
- Image load
- Memory allocation with executable permissions
- Remote thread creation
- Use kernel driver to disable ETW-Ti callbacks (requires kernel access)
- Operate within normal behavioral bounds to avoid detection triggers
- Combine with other evasion techniques to reduce overall detection score
ETW-Ti bypass requires kernel-level access (driver) or exploiting a kernel vulnerability. SysWhispers4 focuses on user-mode evasion techniques.
Method Selection Guide
Red Team Engagement (Maximum Evasion)
Recommended:- Randomized gadgets defeat pattern analysis
- RecycledGate bypasses all hook types
- Stack spoofing creates legitimate-looking call chains
- Sleep encryption evades periodic memory scans
Bypassing Heavy EDR (CrowdStrike, SentinelOne, etc.)
Recommended:from_diskreads clean ntdll from\KnownDlls(bypasses all hooks)- Indirect keeps RIP in ntdll
- Unhooking removes inline hooks before SSN resolution
- SSN encryption prevents static signature matching
CTF / Quick Testing
Recommended:- Default FreshyCalls works against most basic hooks
- Fast generation and compilation
- Minimal complexity for debugging
Static Analysis Evasion (Sandboxes, AV Scans)
Recommended:- Egg hunt removes
syscallopcode from disk binary - Obfuscation disrupts signature matching
- Halo’s Gate handles simple hooks
Detection Trade-offs
| Goal | Best Method | Trade-off |
|---|---|---|
| Maximum hook resistance | --resolve from_disk or recycled | Slower initialization |
| Cleanest RIP at syscall | --method randomized | Slightly more complex stubs |
| No syscall on disk | --method egg | Runtime patching required |
| Smallest binary | --method embedded --resolve static | More detectable |
| Fastest execution | --method embedded | No RIP obfuscation |
Known Limitations
Can bypass:- All user-mode inline hooks
- IAT/EAT hooks
- User-mode ETW event delivery (
--etw-bypass) - AMSI scanning (
--amsi-bypass) - Memory scanners during sleep (
--sleep-encrypt) - User-mode debuggers (
--anti-debug)
Testing Your Evasion
Verify RIP Location
- Set kernel debugger breakpoint on
nt!NtAllocateVirtualMemory - Check return address (RIP) when syscall enters kernel:
