Detect Process Hollowing in Elastic Security
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.
MITRE ATT&CK
- Technique
- T1055 Process Injection
- Sub-technique
- T1055.012 Process Hollowing
- Canonical reference
- https://attack.mitre.org/techniques/T1055/012/
Elastic Detection Query
process where event.action == "start" and
process.name in~ ("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") and
not process.parent.name in~ ("services.exe", "svchost.exe", "explorer.exe", "winlogon.exe",
"smss.exe", "csrss.exe", "wininit.exe") and
(
process.command_line == null or
process.command_line == "" or
length(process.command_line) < 5 or
(process.name like~ "svchost.exe" and not process.command_line like "* -k *")
) Detects process hollowing (T1055.012) by identifying hollow-candidate Windows processes spawned from anomalous parent processes with null, empty, or near-empty command lines — a hallmark of CreateProcess with CREATE_SUSPENDED followed by ZwUnmapViewOfSection memory unmapping. Critical cases include svchost.exe not spawned from services.exe and .NET LOLBins (MSBuild, RegAsm, InstallUtil) with no arguments. Uses Elastic EQL case-insensitive in~ operator for resilient process name matching.
Data Sources
Required Tables
False Positives & Tuning
- Build automation invoking MSBuild.exe, vbc.exe, or InstallUtil.exe without arguments during CI/CD pipeline initialization steps before arguments are passed programmatically via stdin or temp files
- Application virtualization platforms such as App-V or Citrix Virtual Apps that suspend and patch process memory as part of their application streaming layer, creating hollow-like process states
- Security tools or EDR agents that deliberately spawn known processes in suspended state for controlled behavioral analysis, memory forensics, or canary-based injection detection
Other platforms for T1055.012
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.
- Test 1Process Hollowing Detection - Anomalous svchost.exe Parent
Expected signal: Sysmon Event ID 1: svchost.exe with ParentImage=powershell.exe and empty/minimal CommandLine. This is a CRITICAL indicator — svchost.exe should only be spawned by services.exe with -k arguments.
- Test 2MSBuild.exe Hollowing Target Simulation
Expected signal: Sysmon Event ID 1: MSBuild.exe spawned by PowerShell with empty CommandLine. MSBuild.exe normally requires a project file as argument — empty execution is anomalous.
- Test 3Hollowed notepad.exe with Network Connection Check
Expected signal: Sysmon Event ID 1: notepad.exe spawned by cmd.exe. Sysmon Event ID 3: If notepad.exe makes network connections (it shouldn't normally). Security Event ID 4688 with command line auditing.
References (6)
- https://attack.mitre.org/techniques/T1055/012/
- https://new.dc414.org/wp-content/uploads/2011/01/Process-Hollowing.pdf
- https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
- https://blog.nviso.eu/2020/02/04/the-return-of-the-spoof-part-2-command-line-spoofing/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1055.012/T1055.012.md
- https://www.mandiant.com/resources/staying-hidden-on-the-endpoint-evading-detection-with-shellcode
Unlock Pro Content
Get the full detection package for T1055.012 including response playbook, investigation guide, and atomic red team tests.