T1055.012

Process Hollowing

Adversaries may inject malicious code into suspended and hollowed processes in order to evade process-based defenses. Process hollowing is commonly performed by creating a process in a suspended state then unmapping/hollowing its memory, which can then be replaced with malicious code. A victim process can be created with native Windows API calls such as CreateProcess (which includes a flag to suspend the processes primary thread). At this point the process can be unmapped using APIs calls such as ZwUnmapViewOfSection or NtUnmapViewOfSection before being written to, realigned to the injected code, and resumed via VirtualAllocEx, WriteProcessMemory, SetThreadContext, then ResumeThread respectively. This is a widely-used technique employed by Cobalt Strike, Emotet, QakBot, and many other threat actors.

Microsoft Sentinel / Defender
kusto
// Detect Process Hollowing via suspended process creation + memory unmapping
// Key indicator: legitimate process spawned by unusual parent with empty/mismatched command line
let HollowingTargets = dynamic(["svchost.exe", "explorer.exe", "rundll32.exe", "notepad.exe", "cmd.exe", "mspaint.exe", "calc.exe", "dllhost.exe", "werfault.exe", "iexplore.exe", "MSBuild.exe", "RegAsm.exe", "InstallUtil.exe", "vbc.exe", "certutil.exe"]);
let LegitParents = dynamic(["services.exe", "svchost.exe", "explorer.exe", "winlogon.exe", "System", "smss.exe", "csrss.exe", "wininit.exe"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (HollowingTargets)
| where InitiatingProcessFileName !in~ (LegitParents)
| where ProcessCommandLine == "" or ProcessCommandLine == FileName or strlen(ProcessCommandLine) < 5
  or (FileName =~ "svchost.exe" and ProcessCommandLine !has "-k")
| extend HollowingIndicator = case(
    FileName =~ "svchost.exe" and InitiatingProcessFileName !=~ "services.exe", "Critical - svchost.exe not from services.exe",
    FileName in~ ("MSBuild.exe", "RegAsm.exe", "InstallUtil.exe") and strlen(ProcessCommandLine) < 5, "Critical - .NET LOLBin with empty cmdline",
    strlen(ProcessCommandLine) < 5, "High - Empty command line (CREATE_SUSPENDED indicator)",
    true, "Medium - Unusual parent-child relationship"
)
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine,
         FileName, ProcessCommandLine, ProcessId, HollowingIndicator
| sort by Timestamp desc
critical severity high confidence

Data Sources

Process: Process Creation Process: Process Access Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Legitimate COM activation spawning dllhost.exe with minimal arguments
  • Windows Error Reporting spawning WerFault.exe
  • Application installers creating helper processes that appear with minimal command lines
  • Debugging scenarios where processes are started suspended intentionally

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections