Process Hollowing — Gutting Legitimate Processes
Concept and Motivation
┌──────────────────────────────────────────────────────────────────────┐
│ Process Hollowing Anatomy │
│ │
│ STEP 1: Create process suspended │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ svchost.exe (SUSPENDED) │ │
│ │ ┌──────────────────────────────────────────────────────┐ │ │
│ │ │ .text section: [legitimate svchost code] │ │ │
│ │ │ Entry Point: 0x00401000 → svchost code │ │ │
│ │ └──────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ STEP 2: Unmap + Inject payload │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ svchost.exe (SUSPENDED) — Hollowed │ │
│ │ ┌──────────────────────────────────────────────────────┐ │ │
│ │ │ .text section: [malicious payload] │ │ │
│ │ │ Entry Point: → malicious code │ │ │
│ │ └──────────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ STEP 3: ResumeThread → payload executes as "svchost.exe" │
└──────────────────────────────────────────────────────────────────────┘Prerequisites and Relevant Structures
Full Implementation
Step 1: Create the Target Process in Suspended State
Step 2: Get the Host Process Image Base
Step 3: Unmap the Original Image
Step 4: Map the Payload into the Host Process
Step 5: Apply Relocations (if necessary)
Step 6: Update Entry Point and Resume Thread
Putting It All Together
Detection and Countermeasures
Evasive Variants
References
PreviousAPI Unhooking — Restoring ntdll to a Clean StateNextReflective DLL Injection — DLLs That Load Themselves
Last updated