Process Hollowing
A defense-evasion technique where a benign process is created in a suspended state, its memory is unmapped or overwritten, and malicious code is written into the hollowed space before the thread is resumed.
Detection / Fingerprint
CreateProcessWwithCREATE_SUSPENDEDflagNtUnmapViewOfSectionorVirtualAllocExon a newly created processNtWriteVirtualMemoryorWriteProcessMemorytargeting the suspended processSetThreadContext/ResumeThreadto redirect execution
Implementation Patterns
SilverFox variants use a streamlined hollowing sequence without NtUnmapViewOfSection:
CreateProcessW(target_path, ..., CREATE_SUSPENDED, ...)^[ghidra:FUN_140001030]VirtualAllocEx(hProcess, ..., MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)^[ghidra:FUN_140001030]NtWriteVirtualMemory(hProcess, base, payload, size, ...)^[ghidra:FUN_140001030]- Resume via
ResumeThreador thread-context manipulation
Alternative fallback: ShellExecuteExW if injection fails.^[ghidra:FUN_1400044b0]
Reproduce on Your Own VMs
Build a test injector targeting notepad.exe:
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
CreateProcessW(L"C:\\Windows\\System32\\notepad.exe", NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi);
// Allocate RWX memory in suspended process
LPVOID remote = VirtualAllocEx(pi.hProcess, NULL, payload_size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
WriteProcessMemory(pi.hProcess, remote, payload, payload_size, NULL);
// Hijack entry point via SetThreadContext or overwrite image base
// ResumeThread(pi.hThread);
Verify with capa <reproducer.exe> — should hit inject code into process.
Defensive Countermeasures
- Monitor
CreateProcessW(CREATE_SUSPENDED)followed by memory writes to the child process - ETW:
Microsoft-Windows-Kernel-Processevents for process creation + memory allocation - YARA: flag binaries importing both
CreateProcessWandNtWriteVirtualMemory/WriteProcessMemory