Process Injection Explained: Techniques, MITRE T1055 and How to Detect It

Digital Forensics5 min read
Process Injection Explained: Techniques, MITRE T1055 and How to Detect It
On this page

Process injection is when one program places code inside another running process and makes it run there. Malware does this to hide (its code runs inside a trusted process such as explorer.exe or svchost.exe), to evade security tools that trust that process, and to inherit its privileges and network access. MITRE ATT&CK tracks it as technique T1055, with sub-techniques such as DLL injection, PE injection, thread execution hijacking, APC injection and process hollowing. Defenders detect it through the steps every technique needs: opening another process with write access, changing its memory and starting or redirecting a thread, which show up in Sysmon events, EDR telemetry and memory forensics.

This article is written for analysts and defenders: what each technique does, what traces it leaves, and how to hunt for it.

Why attackers inject

  • Stealth. Task Manager shows only a normal system process; the malicious code has no process of its own.
  • Trust. Firewalls and some security products allow a browser or system process to do things they would block for an unknown program.
  • Access. Code inside a process can read that process’s memory, which is why credential theft often targets LSASS.
  • Persistence of execution. If the original malware file is deleted, the injected code keeps running in memory.

The common pattern

Almost every injection technique follows the same three steps on Windows, and each step is a detection opportunity:

StepWhat happensTypical evidence
1. Get accessThe injector opens a handle to the target process with rights to write memory and create threadsSysmon Event ID 10 (ProcessAccess) with high GrantedAccess values
2. Place codeMemory is allocated or remapped in the target and code is written into itNew private, executable memory regions; often read-write-execute
3. Run itA new thread is started, an existing thread is redirected, or a callback is queuedSysmon Event ID 8 (CreateRemoteThread); threads starting in memory that belongs to no loaded module

The main techniques (MITRE T1055)

Sub-techniqueNameIdea in one sentence
T1055.001DLL injectionForces the target to load a malicious DLL from disk.
T1055.002Portable executable injectionCopies a whole program into the target’s memory and runs it there, with no file loaded.
T1055.003Thread execution hijackingSuspends an existing thread, points it at the injected code and resumes it.
T1055.004Asynchronous procedure call (APC)Queues the code to run when a thread of the target next enters an alertable wait.
T1055.012Process hollowingStarts a legitimate program suspended, replaces its code in memory and resumes it.
T1055.013Process doppelgรคngingUses file system transactions to start a process from content that never exists as a normal file.

On Linux the same idea appears as ptrace-based injection (T1055.008), writing to /proc/PID/mem (T1055.009) and abusing LD_PRELOAD for library loading.

Detecting it with Sysmon

Sysmon records the events that matter if its configuration includes them:

  • Event ID 8, CreateRemoteThread: a process created a thread in another process. Legitimate cases exist (debuggers, some security tools), so baseline your environment and alert on unusual source and target pairs, such as a Word or PowerShell process creating a thread in explorer.exe.
  • Event ID 10, ProcessAccess: a process opened another one. Watch for access to lsass.exe and for broad access masks from unexpected programs.
  • Event ID 7, ImageLoaded: a DLL was loaded. Unsigned DLLs loaded from user-writable folders into system processes are suspicious.
  • Event ID 25, ProcessTampering: Sysmon noticed that a process image in memory no longer matches the file on disk, typical of hollowing and similar techniques.

Combine them: a process access event followed within seconds by a remote thread creation into the same target is far stronger evidence than either alone.

Detecting it in memory

Injected code lives in memory, so a memory image catches what disk forensics misses. With Volatility 3:

vol -f memory.raw windows.pslist          # processes and their parents
vol -f memory.raw windows.malfind         # executable private memory, often with an MZ header
vol -f memory.raw windows.ldrmodules      # DLLs hidden from the loader lists
vol -f memory.raw windows.vadinfo --pid 1234   # memory regions of one process

malfind flags memory regions that are executable but not backed by a file on disk, the typical home of injected code. Look for read-write-execute protection, a PE header (MZ) at the start of the region, and code in processes that have no reason to contain it. For hollowing, compare the image path in the process environment block with the file mapped in memory. How to capture memory is explained in Digital Evidence Acquisition.

Reducing the risk

  • Run an EDR that monitors cross-process memory and thread operations; most current products detect the classic patterns.
  • Protect LSASS with RunAsPPL (LSA protection) and Credential Guard, so ordinary processes cannot open it with read access.
  • Use application control (WDAC or AppLocker) so unknown programs cannot run in the first place.
  • Deploy Sysmon with a maintained configuration and forward its events to your SIEM.
  • Keep users out of local administrator groups: many injection targets need elevated rights.

Frequently asked questions

What is process injection in simple terms?

It is running code inside another program’s memory. Malware uses it so its code runs under the name of a trusted process such as explorer.exe, which makes it harder to spot and lets it use that process’s permissions.

What is the difference between DLL injection and process hollowing?

DLL injection makes an already running process load an extra DLL. Process hollowing starts a new, legitimate-looking process in a suspended state, replaces its code with malicious code, and then lets it run, so the process looks normal from the outside.

Which Sysmon events detect process injection?

Event ID 8 (CreateRemoteThread), Event ID 10 (ProcessAccess), Event ID 7 (ImageLoaded) and Event ID 25 (ProcessTampering) are the most useful. They work best together and with a baseline of normal behaviour.

How does Volatility find injected code?

The malfind plugin looks for memory regions that are executable and private (not backed by a file on disk), which is where injected code usually sits, and shows their first bytes so you can spot PE headers or shellcode.

Is process injection always malicious?

No. Debuggers, accessibility tools, some games’ overlays and security products also inject code into other processes. That is why detections need context: which process did it, to which target, and whether that pairing is normal in your environment.

Where to go next

Reading shellcode, analysing what injected code does and working in a debugger are taught in Shellcode Hacking. The memory side, from capture to Volatility analysis, is part of Digital Forensics Training.

Written by

Taifun Mamedov

Founder and instructor at Ocsaly Academy.

Courses by Taifun Mamedov

Share this article