T1574.013 Sumo Logic CSE · Sumo

Detect KernelCallbackTable in Sumo Logic CSE

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/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
_sourceCategory=*sysmon*
| json auto
| where EventCode in ("1","11")
| eval FilePath = if(EventCode = "1", Image, TargetFilename)
| where matches(lower(FilePath), "\\temp\\")
| where matches(lower(FilePath), "(\.exe|\.dll)$")
| eval IsInstaller = if(EventCode = "1" and matches(lower(Image), "(setup|install|msiexec|update)"), "true", "false")
| eval IsBinaryCreate = if(EventCode = "11", "true", "false")
| where User != "NT AUTHORITY\SYSTEM" and !isNull(User)
| eval RiskScore = if(IsInstaller = "true" or IsBinaryCreate = "true", 75, 40)
| stats values(EventCode) AS EventTypes, values(FilePath) AS Files, count AS EventCount by _sourceHost, User, _timeslice 10m
| where EventCount > 1
| sort by EventCount desc
critical severity low confidence

Sumo Logic detection for KernelCallbackTable. Detects KernelCallbackTable-style injection by monitoring for remote process memory operations targeting GUI processes. Since KernelCallbackTable hijacking requires WriteProcessMemory into a GUI proce

Data Sources

Sysmon Event ID 1Sysmon Event ID 11

Required Tables

_sourceCategory=*sysmon*

False Positives & Tuning

  • Multi-stage installers that legitimately modify components in TEMP during installation
  • Enterprise deployment solutions staging installer binaries in temporary locations
  • Self-updating applications that patch their own binaries before running them
  • Software that extracts and immediately executes components from archives
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