Technical Research · Windows Internals
Kernel-mode EDR gives defenders the deepest vantage point available on Windows - a callback-driven view from inside the executive itself. We build the blueprint for a modern kernel sensor, then show exactly where that vantage point runs out against reflective loading, process hollowing, and raw shellcode staging.
01
Overview
Kernel-mode Endpoint Detection and Response (EDR) provides deep visibility into Windows process activity, image loading and thread creation. However, visibility into these events does not guarantee complete detection of malicious activity occurring inside process memory.
This research explores the capabilities and constraints of kernel-resident sensors, particularly when faced with reflective DLL injection, process hollowing, manual mapping and shellcode execution.
Windows Kernel-Mode EDR
In-Memory / Fileless Execution
Process, Image Load, Thread Creation
PatchGuard & HVCI
Structurally Incomplete
3
In-memory evasion techniques covered by the threat model
Kernel callbacks forming the spine of the sensor
Structural ceilings no purely kernel-resident sensor can close
Undocumented hooking techniques used - all patterns PatchGuard/HVCI safe
02
Background & Challenge
Traditional endpoint security relies heavily on identifying suspicious files and executable activity. Modern adversaries increasingly bypass this approach through techniques that execute code directly within memory.
Reflective DLL injection, process hollowing, manual mapping, module stomping and raw shellcode execution can operate without producing a conventional file for a scanner to inspect.
Kernel-mode EDR drivers improve visibility by monitoring process creation, image loads and thread starts from within the Windows operating system.
However, an important question remains:
The real question: Can callback-driven kernel sensors reliably observe code that exists only inside the memory of an already-running process?
The research demonstrates that the answer is only partial. The gap is architectural, rather than simply an implementation defect.
03
Scope & Environment
The research examines the components and operating constraints that shape kernel-level EDR visibility.
o4
Approach & Methodology
The research examines the components and operating constraints that shape kernel-level EDR visibility.
Phase 01
Examine driver initialization, callback registration, synchronization, device objects and safe driver unloading.
Phase 02
Evaluate process creation telemetry, command-line context, parent process information and PE-header inspection.
Phase 03
Examine executable section characteristics, entry-point locality, import tables and static indicators associated with packers and loaders.
Phase 04
Review concurrent callback execution, FAST_MUTEX usage, target-mode filtering and the performance implications of telemetry collection.
Phase 05
Analyse thread-creation-triggered scanning and writable-to-executable memory transitions as indicators of possible in-memory execution.
Phase 06
Identify the visibility limitations of kernel callbacks and evaluate complementary telemetry sources beyond the conventional callback model.
05
Technical Analysis
A kernel-mode driver must manage callback registration, synchronization primitives, device objects and safe unloading. Improper cleanup can leave callbacks referencing unloaded code and cause system crashes.
Process creation notifications provide valuable context, including command-line arguments, parent process identifiers and image information. Static PE inspection adds further signals through header validation and executable-section analysis.
Writable-and-executable sections, unusual entry-point locations and suspicious section names can indicate packing or loader activity. Import analysis must account for the difference between relative virtual addresses and file offsets.
Kernel callbacks can execute concurrently across processor cores. Efficient synchronization and selective telemetry filtering help prevent unnecessary processing overhead while retaining useful detection context.
Thread creation can provide an opportunity to inspect process memory for suspicious private regions transitioning from writable to executable permissions. Deferred scanning helps avoid performing expensive operations directly inside callback routines.
06
Key Findings
Ceiling 01
PE parsing can inspect executable files, but it cannot independently identify shellcode delivered directly into private memory without a corresponding file.
Ceiling 02
Process, image-load and thread-creation callbacks provide event-based visibility. They do not continuously observe every memory allocation, modification or protection transition between those events.
Ceiling 03
Comprehensive scanning consumes system resources. Excessive monitoring can introduce latency and operational overhead, while reduced scanning leaves opportunities for adversaries to evade observation.
07
Impact & Implications
Fileless execution may remain outside the reach of static file inspection.
Memory changes can occur between callback events and scanning operations.
Broader inspection must be balanced against endpoint responsiveness.
Multiple telemetry sources are needed to improve visibility across execution stages.
Detection effectiveness must be tested against realistic adversarial techniques.
08
Recommendations
A more complete detection architecture combines kernel callbacks with complementary telemetry sources.
A more complete detection architecture combines kernel callbacks with complementary telemetry sources.
Spine of the sensor. Structurally incomplete alone.
Streams VirtualAlloc, VirtualProtect, WriteProcessMemory events.
Catches script-based execution before interpretation.
Operation-level granularity on high-value APIs.
Constrains what any of the above may do at runtime.
Together, these layers provide a more comprehensive view of endpoint activity without relying on one detection mechanism to identify every threat.
09
Key Takeaway
Code that never touches disk, memory transitions that occur between scans, and activity that falls between callback events expose fundamental limitations in kernel-resident sensing.
The practical way forward is a layered detection architecture that combines kernel callbacks with ETW Threat Intelligence, AMSI and carefully selected user-mode telemetry.
10
Frequently Asked Questions
Questions security architects and detection engineers ask when designing or evaluating kernel-resident EDR sensors.
Kernel callbacks are episodic - they fire once per process, once per image load, once per thread. Between those events an adversary can freely allocate, write, decrypt, and re-protect memory without triggering any callback. Static PE parsing is also inherently blind to payloads that are never written to disk. This is a structural property of the callback model, not an implementation defect. Closing the gap requires telemetry sources - ETW Threat-Intelligence, AMSI, user-mode stubs - that sit outside the conventional kernel callback set.
Protection laundering refers to a memory region transitioning from writable to executable and back again in the window between two scans. Because event-driven scanning is triggered by thread creation rather than continuous monitoring, a transition that occurs and reverts between scan events leaves no trace for the scanner to observe. Closing this window generally requires streaming telemetry - such as the ETW Threat-Intelligence provider - rather than point-in-time scans.
PE import tables use relative virtual addresses (RVAs), which are only valid once the loader has mapped the image into memory. On disk, section data sits at file offsets that don't correspond to those RVAs. Dereferencing a disk-buffer offset as though it were an in-memory offset reads from the wrong location entirely - which, in kernel mode, risks touching pool guard pages and triggering a Bug Check rather than a recoverable fault. The standard fix is to inspect imports from the mapped image via PsSetLoadImageNotifyRoutine instead of parsing them from a disk read.
PatchGuard (Kernel Patch Protection) periodically verifies that core kernel structures and read-only pages haven't been modified, and Bug Checks the system if it detects unauthorized modification - killing any EDR that relies on inline-hooking syscall handlers or SSDT patching within minutes. HVCI (Hypervisor-Protected Code Integrity) goes further: pages can't be both writable and executable, dynamic code generation is prohibited, and unsigned drivers are refused. Modern kernel EDR drivers must rely exclusively on documented callback registration, be compiled with /INTEGRITYCHECK, and be signed with an EV certificate cross-signed by Microsoft.
Three sources complement the kernel callback spine: ETW Threat-Intelligence provider: streams memory-operation events (VirtualAlloc, VirtualProtect, WriteProcessMemory) that no kernel callback surfaces. AMSI: inspects script content (PowerShell, JScript, macros) just before interpretation - covering in-memory execution staged as text rather than bytes. Minimal user-mode telemetry stubs: hook a small set of high-value APIs and forward parameters to the kernel via a shared section, adding operation-level granularity. Together with the kernel callback spine, these form a layered sensor where no single component needs to catch everything on its own.
Vendor claims and product datasheets aren't evidence - the only reliable way to know is to test the deployed configuration against the same techniques described in this post: reflective loading, process hollowing, manual mapping, and RW→RX protection transitions in private memory, executed the way a real adversary would chain them. This is precisely what a Red Team Assessment is designed to answer. Rather than a checklist review, ISECURION's red team operators emulate real adversary TTPs mapped to MITRE ATT&CK, run them against your live EDR and SOC, and report exactly which techniques were detected, which were missed, and why - so you know your actual detection coverage, not your assumed coverage.
Penetration testing typically answers "can this system be compromised?" within a defined, often noisy, scope - it's optimized for finding as many vulnerabilities as possible in a fixed window. It doesn't tell you whether your detection stack would have noticed. Red Teaming answers a different question: "would my people, process, and technology detect and respond to a real, stealthy adversary?" It's goal-oriented, avoids unnecessary noise, and specifically exercises the detection and response chain - EDR alerting, SOC triage, escalation - rather than just the initial exploit. For organisations that already have a kernel EDR deployed, Red Teaming is the more relevant exercise. Learn about ISECURION's Red Team Assessment methodology
Because fileless techniques avoid disk artifacts, the signals are behavioral rather than file-based. Common indicators include: unexplained child processes spawned from powershell.exe, rundll32.exe, or mshta.exe; processes with network connections but no corresponding image on disk; EDR alerts referencing RWX or RW→RX memory regions that were dismissed as noise; unexpected LSASS access; and endpoints that are unusually slow or show high, sustained CPU from a process with no clear business purpose. If you're seeing any of these and aren't fully confident in what happened, don't wait for confirmation - early containment matters more than certainty. ISECURION's Incident Response (DFIR) team can rapidly triage, determine scope, and contain active threats, including memory-resident and fileless intrusions. Reach out immediately if you suspect a live incident
Yes, though it requires different techniques than traditional disk forensics. Memory forensics captures and analyzes RAM to recover injected code, decrypted payloads, network artifacts, and process/thread relationships that never existed as files. Combined with ETW traces, Windows Event Logs, and EDR telemetry captured at the time of the incident, investigators can frequently reconstruct the full attack chain - initial access, injection technique, and lateral movement - even when nothing was ever written to disk. The catch is timing: volatile memory evidence degrades quickly, and once a compromised host is rebooted or the process exits, much of it is gone. This is why engaging DFIR specialists as early as possible in a suspected incident materially improves the odds of a conclusive investigation and a regulatory-ready report.
At minimum, annually - and additionally after any material change: a new EDR vendor or version, a SOC/MDR provider change, significant infrastructure changes, or following any real security incident. Detection coverage isn't static; EDR vendors patch gaps, adversaries develop new evasion techniques, and your own environment changes constantly, so a red team result from eighteen months ago tells you very little about today's actual exposure. Organisations with a mature security programme often move to a continuous or twice-yearly cadence. ISECURION scopes Red Team engagements from a single detection-validation exercise up to a comprehensive 3-6 week full-scope adversary simulation - get a customised assessment plan and timeline
Don't reboot or reimage the affected host if you can avoid it - that's frequently the single biggest mistake made in the first hour, and it destroys the volatile memory evidence needed to determine what actually happened. Instead: isolate the host at the network level (not by powering it off), preserve logs and EDR telemetry, and avoid taking remediation actions until scope is understood, since premature cleanup can tip off an attacker who still has access elsewhere in the environment. ISECURION's Incident Response team provides rapid breach assessment, forensic investigation, and regulatory-ready reporting for ransomware, business email compromise, and intrusions involving memory-resident malware. Contact our IR team now → - early engagement materially reduces both dwell time and total incident cost.
Have a question about kernel EDR architecture, Red Teaming, or Incident Response not answered here? Contact ISECURION at info@isecurion.com or submit an enquiry - we respond to all pre-engagement queries within one business day.
Our research and technical services practice covers Windows internals, kernel driver security review, detection-engineering assessments, and adversarial evaluation of EDR and endpoint security products. CERT-In empanelled.