Skip to content

Lesson 11 of 19 · 25m

Fileless Intrusion: Hunting Injected and Hollowed Processes

Process hollowing and reflective DLL injection at the syscall level, why malfind's RWX-private-memory hit is the signature, and the Sysmon 8/10/25 events that catch it live.

malfind flagged notepad.exe holding 200 KB of private memory with PAGE_EXECUTE_READWRITE protection and an MZ header inside it. There is no notepad.exe malware on the disk. There never was — the payload lived only in RAM, mapped by hand, and the clean PE on disk was a costume. This is the fileless-intrusion failure mode: every file-hash IOC you sweep for returns zero, because nothing ever touched the filesystem.

The two call chains

Process hollowing builds a trojan inside a legitimate process:

CreateProcess("svchost.exe", CREATE_SUSPENDED)
NtUnmapViewOfSection()            // evict the real image
VirtualAllocEx()                  // allocate for the payload
WriteProcessMemory()              // write the PE, section by section
SetThreadContext()                // point RIP at the new entry point
ResumeThread()

The parent process name, the signed image on disk, the expected parent — all clean. What changed is what the suspended process's memory actually contains. Cobalt Strike's spawn/execute-assembly defaults run this shape against sacrificial rundll32/svchost/dllhost hosts.

Classic injection writes into an existing process:

OpenProcess(target)
VirtualAllocEx(PAGE_EXECUTE_READWRITE)
WriteProcessMemory(shellcode)
CreateRemoteThread()              // or QueueUserAPC, or thread-context hijack

And reflective DLL injection — Stephen Fewer's loader design, still how beacon.dll loads — maps a DLL image manually, section by section, without calling LoadLibrary. No LoadLibrary means no entry in the PEB's module list, which is why dlllist will never show it to you.

Why malfind's signature works

Injected code must live in private memory — regions allocated by VirtualAllocEx are anonymous, not backed by a mapped file — and it must be executable. Legitimate applications almost never hold private pages that are simultaneously writable and executable and start with MZ or disassemble as position-independent code. That conjunction is malfind's detection. hollowfind goes further for hollowed hosts: it diffs the VAD map against the PEB — a hollowed process's image region no longer maps to its on-disk file — and checks protection flags and entry-point sanity. ldrmodules compares the PEB's three module lists (InLoadOrder, InInitOrder, InMemoryOrder); a reflectively-mapped DLL appears in none of them, and a hidden one shows InLoad=False.

psxview cross-references every enumeration method Volatility has — pslist, psscan, thread objects, handle tables, desktop objects — so a process that exists in psscan but not pslist is an EPROCESS someone deliberately unlinked. Dump what you find: windows.malfind --dump and windows.pslist --dump hand the carved regions to static triage and YARA.

The .NET wrinkle

[System.Reflection.Assembly]::Load($bytes) + invoke is how PowerShell-based C2 runs assemblies entirely in memory — no file, no Prefetch entry, no ShimCache record. The breadcrumbs live elsewhere: ETW's CLR provider events, AMSI inspection calls, and AppDomain/module enumeration inside the memory image.

Catching it live: the Sysmon trio

On a monitored endpoint you don't need the memory image to see injection happen:

  • Event 8 — CreateRemoteThread: a thread created in a foreign process. Legitimate uses exist (some AV, debuggers), which is why you filter on source process, not the event itself.
  • Event 10 — ProcessAccess: the tell is TargetImage=lsass.exe from a non-SYSTEM source with a GrantedAccess mask carrying PROCESS_VM_READ — 0x1010, 0x1410, 0x1438-0x143a are the classic credential-read masks. That's the dump attempt, logged whether or not it succeeded.
  • Event 25 — ProcessTampering: Sysmon added it specifically for hollowing and herpaderping — a process whose in-memory image no longer matches its file.

The scoping consequence

Fileless changes what "scope" means. A file-hash sweep finds nothing because there is no file; scope instead by the in-memory YARA signature across captured images, by the Sysmon 8/10/25 pattern across endpoints, and by the C2 socket from netscan. The evidence you need is the memory capture taken before reboot — which is why the order of volatility lesson put RAM first.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.