Windows Kernel Telemetry for High-Signal Threat Triage, Forensics & Malware Analysis
- Process injection activity, including remote-thread execution patterns.
- Thread hijack behavior (suspend/set-context/resume style intent chains).
- APC-based injection indicators, including remote APC and hijack-adjacent APC patterns.
- Process hollowing mark-chains (medium/strong) and TxF-suspect hollowing chains.
- Direct-syscall abuse indicators versus normal syscall paths.
- Suspicious process/thread handle operations with exact access rights (for example
PROCESS_VM_WRITE,PROCESS_CREATE_THREAD,THREAD_SET_CONTEXT). - Memory abuse patterns such as alloc/write/protect sequences and writable-to-executable transitions.
- Thread start addresses outside expected image ranges or in non-image executable regions.
- Suspicious
ntdllimage path/mapping anomalies. - High-value registry activity tied to persistence/evasion surfaces.
- Driver dispatch/object tamper drift and tamper-clear transitions.
[HANDLE] DIRECT-SYSCALL-SUSPECT 0000000000002978 -> 0000000000001088 access=0x00001032 (CREATE_THREAD|VM_READ|VM_WRITE|QUERY_LIMITED_INFO)
Meta event=HandleTelemetry pid=4 tid=5192 cpu=5 lvl=4 op=0 ver=0 ts=0x01DCA7C573BE0D3D dt=0x14
Actor callerImage=R:\.NIGHTDAY\TTK\DirectSyscallTest.exe
targetImage=\Device\HarddiskVolume5\.NIGHTDAY\TTK\DirectSyscallTest.exe
Origin addr=0x00007FF6DF2DF1DA (DirectSyscallTest.exe)
path=\Device\HarddiskVolume5\.NIGHTDAY\TTK\DirectSyscallTest.exe
protect=0x00000040 (XRW) exec=1 fromNtdll=0 fromExe=1
Status open=SUCCESS(0x00000000) basic=SUCCESS(0x00000000) section=SUCCESS(0x00000000)
Deep allocBase=0x00007FF6DF2C0000 regionSize=0x1000 protect=0x00000040 (XRW) state=COMMIT type=IMAGE
backing=image committed=1 privateCommit=0 imageCommit=1 mappedCommit=0
sampleSize=64 entropy=0.691 opcodes=04 75 42 63 D7 1D 00 00 00 00 00 00 00 00 00 00 ...
Stack frames=8
#0 0x00007FF6DF2DF1DA (DirectSyscallTest.exe)
#1 0x00007FF6DF2D2C91 (DirectSyscallTest.exe)
#2 0x00007FF6DF2D3A09 (DirectSyscallTest.exe)
#3 0x00007FF6DF2D38B2 (DirectSyscallTest.exe)
#4 0x00007FF6DF2D376E (DirectSyscallTest.exe)
#5 0x00007FF6DF2D3A9E (DirectSyscallTest.exe)
#6 0x00007FFDF6F87374 (KERNEL32!BaseThreadInitThunk+0x14)
#7 0x00007FFDF745CC91 (ntdll!RtlUserThreadStart+0x21)
Alert direct-syscall-suspect classification observed[HANDLE] LEGITIMATE-SYSCALL 0000000000002978 -> 0000000000001088 access=0x00001000 (QUERY_LIMITED_INFO)
Meta event=HandleTelemetry pid=4 tid=5192 cpu=5 lvl=4 op=0 ver=0 ts=0x01DCA7C573BE1898 dt=0xB5B
Actor callerImage=R:\.NIGHTDAY\TTK\DirectSyscallTest.exe
targetImage=\Device\HarddiskVolume5\.NIGHTDAY\TTK\DirectSyscallTest.exe
Origin addr=0x00007FFDF74ADD24 (ntdll!NtDuplicateObject+0x14)
path=\Device\HarddiskVolume3\Windows\System32\ntdll.dll
protect=0x00000020 (XR) exec=1 fromNtdll=1 fromExe=0
Status open=SUCCESS(0x00000000) basic=SUCCESS(0x00000000) section=SUCCESS(0x00000000)
Deep allocBase=0x00007FFDF7410000 regionSize=0x80000 protect=0x00000020 (XR) state=COMMIT type=IMAGE
backing=image committed=1 privateCommit=0 imageCommit=1 mappedCommit=0
sampleSize=0 entropy=0.000 opcodes=<none>
Stack frames=8
#0 0x00007FFDF74ADD24 (ntdll!NtDuplicateObject+0x14)
#1 0x00007FFDF746F4EE (ntdll!RtlReportSilentProcessExit+0xDE)
#2 0x00007FFDF4D2E2AF (KERNELBASE!TerminateProcess+0x1F)
#3 0x00007FF6DF2D2D60 (DirectSyscallTest.exe)
#4 0x00007FF6DF2D3A09 (DirectSyscallTest.exe)
#5 0x00007FF6DF2D38B2 (DirectSyscallTest.exe)
#6 0x00007FF6DF2D376E (DirectSyscallTest.exe)
#7 0x00007FF6DF2D3A9E (DirectSyscallTest.exe)Sleepwalker is a KMDF kernel telemetry driver plus a user-mode service/client stack for process-scoped monitoring and correlated detection.
It captures low-level events (handle, thread, process, image, registry, APC, optional TI API-call surface), then emits detections with severity and reason strings over IOCTL and ETW.
Kernel detections:
REMOTE_THREAD_WITH_RECENT_HANDLE_INTENTREMOTE_THREAD_START_IN_NON_IMAGE_EXECUTABLE_REGIONREMOTE_THREAD_OUTSIDE_MAIN_IMAGETHREAD_ACTIVITY_WITH_THREAD_CONTEXT_INTENTTHREAD_HIJACK_INTENTREMOTE_APC_CREATION_SUSPECTPOSSIBLE_PROCESS_HOLLOWING_OR_INJECTION_INTENT_CHAINPOSSIBLE_MANUAL_MAP_OR_HOLLOWING_EXECUTIONKERNEL_PROCESS_HOLLOWING_MARK_CHAIN_MEDIUMKERNEL_PROCESS_HOLLOWING_MARK_CHAIN_STRONG
Controller synthetic detections (ETW/TI-assisted mark-chain):
PROCESS_HOLLOWING_MARK_CHAIN_MEDIUMPROCESS_HOLLOWING_MARK_CHAIN_STRONGPROCESS_HOLLOWING_TXF_SUSPECT_CHAIN
DIRECT_SYSCALL_SUSPECT_HANDLE_OPERATIONSTACK_INTEGRITY_ANOMALY_ON_HANDLE_OPSUSPICIOUS_NTDLL_IMAGE_PATHMULTIPLE_NTDLL_IMAGE_MAPPINGS
HIGH_VALUE_REGISTRY_ACTIVITYDRIVER_DISPATCH_OR_OBJECT_TAMPERDRIVER_DISPATCH_OR_OBJECT_TAMPER_CLEARED
Raw telemetry families:
HandleTelemetrywith access masks, origin address/module, memory protections, deep sample metadata, and stack framesThreadTelemetrywith creator PID, start address, image-range checks, correlation flags, and stack framesProcessTelemetryImageTelemetryRegistryTelemetryApcTelemetryDetectionTelemetry
Optional TI task categories (when provider access is available through the controller):
ALLOCVMWRITEVMPROTECTVM- syscall usage metadata from TI task records
- Monitors emit intent/signal marks from handle, thread, APC, image, registry, and memory-surface events.
- Correlation layers combine those marks into detections with stronger confidence.
- Output is available through:
- IOCTL queues (
\\.\Global\SleepwalkerCtl) for per-client targeted pull - ETW provider
Sleepwalker.Kernelfor scalable streaming
- IOCTL queues (
Preferred integration surface for user-mode consumers:
user/sensor/sleepwalker_sensor_core.hSleepwalkerSensorCore.dll
Exports:
SLEEPWALKERSCOpenControlDeviceSLEEPWALKERSCSubscribeSLEEPWALKERSCUnsubscribeSLEEPWALKERSCSetPidsSLEEPWALKERSCGetEventSLEEPWALKERSCGetStatsSLEEPWALKERSCQueryProcessImagePathSLEEPWALKERSCSetShutdownModeSLEEPWALKERSCParseStreamMaskASLEEPWALKERSCStopSessionByNameSLEEPWALKERSCStartEtwSessionSLEEPWALKERSCStartSleepwalkerEtwSessionSwkStartDetectionEtwSessionSLEEPWALKERSCRunEtwSessionSLEEPWALKERSCStopEtwSession
Typed detection callback surface:
SwkDetectionEventSwkDetectionCallback
- Preferred:
\\.\Global\SleepwalkerCtl - Legacy:
\\.\SleepwalkerCtl
- Subscribe per client handle (PID + stream mask)
- Poll
GET_EVENTuntil queue is empty (NO_MORE_ENTRIES) - Query health via
GET_STATS
- Provider:
Sleepwalker.Kernel - GUID:
{D6C73F8A-6AD8-4F4B-A363-3D2FA31CD0E2} - Event families:
HandleTelemetry,ThreadTelemetry,ProcessTelemetry,ImageTelemetry,RegistryTelemetry,ApcTelemetry,DetectionTelemetry
(Full contract in API.md and abi/sleepwalker_ioctl.h.)
SleepwalkerTestSuite performs end-to-end verification:
- IOCTL subscription + event delivery
- Handle/thread intent correlation flags
- Multi-client parallel fanout
- ETW ingestion coverage across core event families
- Per-check timing/cycle telemetry for incident-grade run profiling
Default suite mode reflects architecture boundaries:
- Kernel correlation-dependent checks are optional (reported as skip by default)
- APC ETW coverage is optional (reported as skip by default)
- Strict modes are available through
SLEEPWALKER_TEST_REQUIRE_KERNEL_CORRELATION=1andSLEEPWALKER_TEST_REQUIRE_APC=1
Example successful run:
[OK] SleepwalkerTestSuite complete. tests-passed=X/Y tests-failed=0 tests-skipped=S polls=Z
- Control device ACL restricted to SYSTEM and Administrators
- IOCTL control path rejects non-user-mode requestors
- Sleepwalker is telemetry + detection aid, not a prevention platform
- Symbol enrichment depends on symbol availability and environment policy
kernel/core/: driver lifecycle and IOCTL control planemonitors/: handle/thread/process/image/registry monitoring and correlationtelemetry/: ETW provider emission
abi/sleepwalker_ioctl.h: shared IOCTL ABI contractsleepwalker_ipc.h: service/client IPC ABI contract
user/sensor/sleepwalker_sensor_core.c/.h: shared user-mode SDK (IOCTL + ETW session helpers)SleepwalkerClient: manual subscriber (broker-first; optional ETW uplink output)SleepwalkerTestSuite: end-to-end validation
user/controller/sleepwalker_controller.c: Session 0 broker service (single driver handle + ETW TI session + IPC)
vcxproj/SleepwalkerSensorCore.vcxproj: shared user-mode DLL projectSleepwalkerController.vcxproj: controller service executable
- Open
Sleepwalker.slnxin Visual Studio. - Build
vcxproj/Sleepwalker.vcxproj(x64). - Install and start the driver.
- Install/start
SleepwlkrController(recommended) viausage/install-controller-service.ps1. - Run:
SleepwalkerSensorCore.dll(built automatically by dependent projects)SleepwalkerTestSuite.exefor full validationSleepwalkerClient.exe <pid> handle,memory,threadfor targeted IOCTL captureSleepwalkerClient.exe <pid> handle,memory,thread,etwto include broker ETW uplink output
Documentation:
INSTALL.md(install/runtime workflow)API.md(IOCTL + ETW contract)USAGE.md(practical usage guide + examples)user/sensor/README.md(tooling details)
