T1574.013 Splunk · SPL

Detect KernelCallbackTable in Splunk

Adversaries abuse the KernelCallbackTable in the Process Environment Block (PEB) to hijack execution flow and execute shellcode within a target process. The KernelCallbackTable is initialized when user32.dll is loaded into a GUI process, containing function pointers for handling Win32 messages. An adversary uses NtQueryInformationProcess() to locate the PEB, reads the KernelCallbackTable pointer, duplicates the table in new process memory via WriteProcessMemory(), replaces a function pointer (e.g., fnCOPYDATA) with shellcode address, then updates the PEB to point to the modified table. Sending a Windows message (e.g., WM_COPYDATA) to the target triggers the shellcode. Used by Lazarus Group (DPRK) and FinFisher/FinSpy. Execution is masked under a legitimate GUI process.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation Defense Evasion
Technique
T1574 Hijack Execution Flow
Sub-technique
T1574.013 KernelCallbackTable
Canonical reference
https://attack.mitre.org/techniques/T1574/013/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=10
| eval TargetProcess=lower(TargetImage)
| eval IsGUITarget=if(match(TargetProcess, "(explorer|notepad|mspaint|wordpad|iexplore|chrome|firefox|edge)"), 1, 0)
| eval IsUnexpectedSource=if(NOT match(lower(SourceImage), "(windows|program files|microsoft)"), 1, 0)
| where IsGUITarget=1 AND IsUnexpectedSource=1
| eval HighRiskGrants=if(match(GrantedAccess, "0x1F[0-9A-Fa-f]{3}|0x001F"), 1, 0)
| table _time, host, User, SourceImage, TargetImage, GrantedAccess, CallTrace, HighRiskGrants
| sort - _time
critical severity low confidence

Detects cross-process memory access targeting GUI processes using Sysmon EventCode 10 (ProcessAccess). KernelCallbackTable hijacking requires opening the target GUI process with write permissions (GrantedAccess values containing write flags like 0x1F0FFF, PROCESS_ALL_ACCESS). Focus on suspicious source processes (not from Windows/Program Files) accessing common GUI targets. The CallTrace field reveals what API calls are being made.

Data Sources

Process: Process AccessSysmon Event ID 10

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Security software performing process inspection (EDR agents, antivirus)
  • Debuggers and development tools accessing process memory
  • Remote administration tools that inspect running processes
  • System utilities that legitimately open GUI processes for IPC
Download portable Sigma rule (.yml)

Other platforms for T1574.013


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Enumerate PEB and KernelCallbackTable Location

    Expected signal: PowerShell process creation with inline C# code using P/Invoke. The NtQueryInformationProcess call may be logged by EDR. Sysmon Event ID 1 captures the PowerShell execution. This is the API call chain that precedes KernelCallbackTable modification.

  2. Test 2Detect Processes with Write Access to GUI Process

    Expected signal: PowerShell process creation with module enumeration. Get-Process calls generate multiple process handle opens. EDR may detect enumeration of module lists across processes. Sysmon may log multiple process access events.

  3. Test 3Send WM_COPYDATA to Trigger KernelCallbackTable Execution

    Expected signal: PowerShell process creation with P/Invoke calls to user32.dll (GetForegroundWindow, GetWindowThreadProcessId). These API calls precede the SendMessage/PostMessage calls used to trigger KernelCallbackTable callbacks in the target process.

Unlock Pro Content

Get the full detection package for T1574.013 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections