Technotron
Elite member
Elite member
Leave a rep and a like
Hidden Content
There's a lot of mythology around EDR evasion so let me lay out what the actual architecture fight looks like, based on the public research from the last few years.
The first thing to understand is that userland API hooking is mostly a dead layer. The old EDR model was injecting a DLL into every process and inline-hooking ntdll functions. The offensive community killed that with direct syscalls — techniques with dumb names like Hell's Gate and Halos Gate, where the implant reads the syscall stubs from a clean copy of ntdll, finds the syscall numbers, and invokes them directly without ever touching the hooked function. But this whole fight is moot now because EDRs moved their sensors into the kernel. Direct syscalls evade nothing that matters anymore. The kernel callbacks see everything regardless of how you made the call.
The part that IS still a real fight is the call stack. Modern EDRs inspect the thread's call stack when a suspicious API is called, and legit code always has a full stack — anchored in real modules, following real call chains. Shellcode doesn't. If your implant's stack looks like "ntdll → some unbacked memory region → nothing," you're flagged instantly. So the current art is stack spoofing — building fake frame chains that look like the call came from a legitimate module. The SilentMoonwalk research paper is the deepest public treatment of this. It's genuinely elegant work, ROP gadget chains that forge a legitimate-looking return path before making the actual call.
ETW is the sensor that keeps winning. Specifically ETW-TI, the Threat Intelligence flavor, which is kernel-delivered telemetry for process, thread, image load and network events. The classic evasion of patching EtwEventWrite in userland does absolutely nothing against ETW-TI because it never goes through that function. Trying to mess with ETW providers at kernel level triggers protections and is itself a detection. If you run an EDR and it has an ETW-TI mode, turn it on, it's a completely different visibility tier.
Memory scanning is where the creative stuff happens. Beacons sitting in RX memory get found by signature scans, so the current generation encrypts itself while sleeping and decrypts only during execution. The Foliage technique does this with timer callbacks — ROP chains into timer functions so the decrypt/encrypt cycle happens through legitimate Windows machinery. Module stomping is the other classic: load a real DLL you don't need, flip its .text section to RW, write your shellcode over it, flip back to RX. Now your code lives inside a legitimate signed module's address range. Callback-based execution goes further — register your shellcode as the target of a legitimate Windows callback mechanism so the execution context itself looks native.
AMSI is worth a mention because half the public bypasses are broken now. The classic AmsiScanBuffer patch doesn't survive modern .NET runtimes and PowerShell 7 has its own hardening. What still works is operating below the script host entirely — .NET assembly loading through legitimate signed binaries as proxies, so AMSI never sees the payload because the script host never does either.
The callback removal war deserves its own section because it's the loudest thing to happen in this space. In 2023 MDSec published work on removing AV/EDR kernel callbacks from kernel context via BYOVD primitives. Every serious intrusion attempt with kernel access now tries this. The defense is baselining — dump your kernel callback registrations on a healthy machine, alert on any change. Microsoft has been tightening this, and recent builds integrity-check some of the callback registration state.
If you're building a lab to understand any of this, the stack is simple: Sysmon with the SwiftOnSecurity config, Defender with ETW-TI enabled, and Volatility 3 for memory analysis afterward. The Sysmon event that catches most in-memory implants is thread start addresses pointing into unbacked memory — event ID 8. No signature matching, just "this thread's entry point doesn't exist in any file."
The honest conclusion is that this is a budget war, not a technical one. Every published offensive technique gets a sensor within a year or two. That's the entire reason red teams exist as an industry — to find the gaps before the people with worse intentions do.


@Techn0tron
Hidden Content
There's a lot of mythology around EDR evasion so let me lay out what the actual architecture fight looks like, based on the public research from the last few years.
The first thing to understand is that userland API hooking is mostly a dead layer. The old EDR model was injecting a DLL into every process and inline-hooking ntdll functions. The offensive community killed that with direct syscalls — techniques with dumb names like Hell's Gate and Halos Gate, where the implant reads the syscall stubs from a clean copy of ntdll, finds the syscall numbers, and invokes them directly without ever touching the hooked function. But this whole fight is moot now because EDRs moved their sensors into the kernel. Direct syscalls evade nothing that matters anymore. The kernel callbacks see everything regardless of how you made the call.
The part that IS still a real fight is the call stack. Modern EDRs inspect the thread's call stack when a suspicious API is called, and legit code always has a full stack — anchored in real modules, following real call chains. Shellcode doesn't. If your implant's stack looks like "ntdll → some unbacked memory region → nothing," you're flagged instantly. So the current art is stack spoofing — building fake frame chains that look like the call came from a legitimate module. The SilentMoonwalk research paper is the deepest public treatment of this. It's genuinely elegant work, ROP gadget chains that forge a legitimate-looking return path before making the actual call.
ETW is the sensor that keeps winning. Specifically ETW-TI, the Threat Intelligence flavor, which is kernel-delivered telemetry for process, thread, image load and network events. The classic evasion of patching EtwEventWrite in userland does absolutely nothing against ETW-TI because it never goes through that function. Trying to mess with ETW providers at kernel level triggers protections and is itself a detection. If you run an EDR and it has an ETW-TI mode, turn it on, it's a completely different visibility tier.
Memory scanning is where the creative stuff happens. Beacons sitting in RX memory get found by signature scans, so the current generation encrypts itself while sleeping and decrypts only during execution. The Foliage technique does this with timer callbacks — ROP chains into timer functions so the decrypt/encrypt cycle happens through legitimate Windows machinery. Module stomping is the other classic: load a real DLL you don't need, flip its .text section to RW, write your shellcode over it, flip back to RX. Now your code lives inside a legitimate signed module's address range. Callback-based execution goes further — register your shellcode as the target of a legitimate Windows callback mechanism so the execution context itself looks native.
AMSI is worth a mention because half the public bypasses are broken now. The classic AmsiScanBuffer patch doesn't survive modern .NET runtimes and PowerShell 7 has its own hardening. What still works is operating below the script host entirely — .NET assembly loading through legitimate signed binaries as proxies, so AMSI never sees the payload because the script host never does either.
The callback removal war deserves its own section because it's the loudest thing to happen in this space. In 2023 MDSec published work on removing AV/EDR kernel callbacks from kernel context via BYOVD primitives. Every serious intrusion attempt with kernel access now tries this. The defense is baselining — dump your kernel callback registrations on a healthy machine, alert on any change. Microsoft has been tightening this, and recent builds integrity-check some of the callback registration state.
If you're building a lab to understand any of this, the stack is simple: Sysmon with the SwiftOnSecurity config, Defender with ETW-TI enabled, and Volatility 3 for memory analysis afterward. The Sysmon event that catches most in-memory implants is thread start addresses pointing into unbacked memory — event ID 8. No signature matching, just "this thread's entry point doesn't exist in any file."
The honest conclusion is that this is a budget war, not a technical one. Every published offensive technique gets a sensor within a year or two. That's the entire reason red teams exist as an industry — to find the gaps before the people with worse intentions do.


@Techn0tron
Attachments
Technotron's signature