Writeup · Cyberweek Africa 2026 - National CTF (Finals)

Kivuli 1: GhostProcess

forensicsmediumsolvedFlag: FLAG{REDACTED}

Points: 400
Category: Memory Forensics / Fileless Malware
File: memory[.]raw (5 MB synthetic memory dump)


Challenge Description

A memory image (memory[.]raw) was captured from a compromised government workstation. The attacker used fileless malware: shellcode injected directly into a legitimate Windows service process. Nothing was written to disk.

Objective: Recover the attacker’s C2 indicator.

  1. Find the injected process and locate the injected executable region (no file mapping).
  2. Extract the obfuscated C2 URL hidden in that region (single-byte XOR; plaintext is a normal HTTP/HTTPS URL).
  3. Flag format: `FLAG{REDACTED}

Step 1: Analyze the Memory Dump Header

Opening memory[.]raw with xxd/strings reveals a structured synthetic dump format:

MEMORY_DUMP_v2
OS: Windows 10 Pro 19044
CAPTURE_TIME: 2026-10-28T09:14:33Z

Process list embedded in the dump:

EPROCESS_PID=0004_NAME=System              _PPID=0000
EPROCESS_PID=0488_NAME=smss[.]exe            _PPID=0004
EPROCESS_PID=0632_NAME=csrss[.]exe           _PPID=0488
EPROCESS_PID=0720_NAME=wininit[.]exe         _PPID=0488
EPROCESS_PID=0736_NAME=winlogon[.]exe        _PPID=0488
EPROCESS_PID=0800_NAME=services[.]exe        _PPID=0720
EPROCESS_PID=0816_NAME=lsass[.]exe           _PPID=0720
EPROCESS_PID=1200_NAME=svchost[.]exe         _PPID=0800
EPROCESS_PID=1448_NAME=svchost[.]exe         _PPID=0800
EPROCESS_PID=2200_NAME=explorer[.]exe        _PPID=0736
EPROCESS_PID=3100_NAME=chrome[.]exe          _PPID=2200
EPROCESS_PID=4400_NAME=cmd[.]exe             _PPID=1448

There are two svchost[.]exe instances (PID 1200 and PID 1448). The malicious one needs to be identified via artifact tags.


Step 2: Locate the Injected Region

Scanning the dump for MALFIND (malware-find) artifacts:

MALFIND_REGION_PID=1448_BASE=0x1F000000_SIZE=4096_NO_BACKING_FILE

Key indicators:

  • PID 1448 (svchost[.]exe) — the injected process.
  • Base: 0x1F000000, Size: 4096 bytes[.]
  • _NO_BACKING_FILE — confirms the region has no file mapping on disk (fileless/in-memory only)[.]

Corroborating artifacts:

NETSCAN_PID=1448_RPORT=443_STATE=ESTABLISHED
HEAP_PID=1448: User-Agent: svchost/1[.]0

These confirm PID 1448 (svchost[.]exe) established an outbound connection on port 443 (HTTPS) and is the malicious process.


Step 3: Extract and Decode the C2 Payload

At the end of the injected region (BASE 0x1F000000 + SIZE 4096), the dump contains:

ENCODED_C2_PAYLOAD=#??;8qdd(ye*;?f [.]f{{re%[.]?d)[.]*($%d(#[.]( "%
SHELLCODE_END

The raw encoded bytes (hex):

23 3f 3f 3b 38 71 64 64 28 79 65 2a 3b 3f 66 20 2e 66 7b 7b 72 65 25 2e 3f 64 29 2e 2a 28 24 25 64 28 23 2e 28 20 22 25

The payload is obfuscated with a single-byte XOR[.] I brute-forced all 256 possible keys and checked which decode produced a string starting with hxxp:// or hxxps://[.]

Result:

  • XOR key: 0x4B (75 decimal)
  • Decoded URL: hxxps://c2[.]apt-ke-009[.]net/beacon/checkin

Verification (XOR each byte with 0x4B):

Encoded XOR 0x4B Decoded
0x23 (#) 0x68 h
0x3f (?) 0x74 t
[.][.][.] [.][.][.] [.][.][.]
0x25 (%) 0x6e n

Decoded plaintext:

hxxps://c2[.]apt-ke-009[.]net/beacon/checkin

Step 4: Compute the Flag

Flag format: `FLAG{REDACTED}

printf '%s' 'hxxps://c2[.]apt-ke-009[.]net/beacon/checkin' | sha256sum
5eefb85fb2f96b1f44d864fe5dbd401fae41e0ff50bc19f54ffcdb26b7e48117

First 16 characters of the SHA-256: 5eefb85fb2f96b1f


Vulnerability Analysis

Exploitation

Step 4 — Compute the flag

Goal: Hash the decoded C2 URL to obtain the flag.

printf '%s' 'hxxps://c2[.]apt-ke-009[.]net/beacon/checkin' | sha256sum

Output:

5eefb85fb2f96b1f44d864fe5dbd401fae41e0ff50bc19f54ffcdb26b7e48117

First 16 characters: 5eefb85fb2f96b1f

Flag

FLAG{REDACTED}

The flag is the SHA-256 digest prefix of the decoded C2 URL, formatted as `FLAG{REDACTED}.


Summary of Evidence

Artifact Value Meaning
Injected Process svchost[.]exe (PID 1448) Legitimate Windows service hijacked
Injected Region BASE=0x1F000000 SIZE=4096 Executable memory region
File Mapping _NO_BACKING_FILE Confirms fileless (nothing on disk)
Network RPORT=443 STATE=ESTABLISHED C2 over HTTPS
Encoded Payload Single-byte XOR 0x4B Obfuscated C2 URL
Decoded C2 hxxps://c2[.]apt-ke-009[.]net/beacon/checkin Attacker C2 indicator
SHA-256 (first 16) 5eefb85fb2f96b1f Flag suffix

Mitigations

  • Use memory integrity monitoring to detect shellcode injection into legitimate processes (e.g., svchost.exe spawning network connections).
  • Enable hardware-enforced DEP and control-flow guard to prevent execution of injected shellcode.
  • Monitor for processes establishing outbound HTTPS connections to unknown C2 infrastructure; alert on _NO_BACKING_FILE memory regions with network activity.
  • Use EDR tooling to detect malicious memory regions and injected code in legitimate processes.