Detect Process Hollowing in Splunk
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/
SPL Detection Query
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\svchost.exe" OR Image="*\\explorer.exe" OR Image="*\\rundll32.exe" OR Image="*\\notepad.exe" OR Image="*\\cmd.exe" OR Image="*\\MSBuild.exe" OR Image="*\\RegAsm.exe" OR Image="*\\InstallUtil.exe" OR Image="*\\vbc.exe" OR Image="*\\certutil.exe" OR Image="*\\iexplore.exe" OR Image="*\\werfault.exe" OR Image="*\\dllhost.exe")
NOT (ParentImage="*\\services.exe" OR ParentImage="*\\svchost.exe" OR ParentImage="*\\explorer.exe" OR ParentImage="*\\winlogon.exe" OR ParentImage="System" OR ParentImage="*\\smss.exe" OR ParentImage="*\\csrss.exe")
| eval CmdLen=len(CommandLine)
| eval ImageName=mvindex(split(Image, "\\"), -1)
| eval HollowIndicator=case(
ImageName="svchost.exe" AND NOT ParentImage="*\\services.exe", "CRITICAL - svchost hollowing",
match(ImageName, "(MSBuild|RegAsm|InstallUtil)\.exe") AND CmdLen < 10, "CRITICAL - .NET LOLBin hollowing",
CmdLen < 5 OR isnull(CommandLine), "HIGH - Empty command line",
1=1, "MEDIUM - Unusual parent-child"
)
| table _time, host, User, ParentImage, ParentCommandLine, Image, CommandLine, CmdLen, HollowIndicator
| sort - _time Detects Process Hollowing via Sysmon Event ID 1 (Process Create) by identifying hollowing target processes with empty/short command lines spawned by unusual parents. Process hollowing uses CREATE_SUSPENDED which often results in empty command lines. Categorizes severity based on target process and command line characteristics. Critical alerts for svchost.exe not spawned by services.exe and .NET LOLBins (MSBuild, RegAsm, InstallUtil) with no arguments.
Data Sources
Required Sourcetypes
False Positives & Tuning
- COM activation creating dllhost.exe with minimal arguments
- Windows Error Reporting creating WerFault.exe
- Application installers using helper processes
- Debugging tools creating suspended processes
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.