Process Injection
Adversaries may inject code into processes in order to evade process-based defenses as well as possibly elevate privileges. Process injection is a method of executing arbitrary code in the address space of a separate live process. Running code in the context of another process may allow access to the process's memory, system/network resources, and possibly elevated privileges. Execution via process injection may also evade detection from security products since the execution is masked under a legitimate process. There are many different ways to inject code into a process, many of which abuse legitimate functionalities. These implementations exist for every major OS but are typically platform specific. More sophisticated samples may perform multiple process injections to segment modules and further evade detection, utilizing named pipes or other inter-process communication (IPC) mechanisms as a communication channel.
// Broad process injection detection via Sysmon CreateRemoteThread and ProcessAccess
let HighRiskTargets = dynamic(["lsass.exe", "csrss.exe", "winlogon.exe", "services.exe", "svchost.exe", "explorer.exe", "spoolsv.exe"]);
let TrustedSources = dynamic(["MsMpEng.exe", "csrss.exe", "services.exe", "svchost.exe", "lsass.exe", "wmiprvse.exe", "System"]);
// Detection 1: CreateRemoteThread into another process (Sysmon EID 8)
DeviceEvents
| where Timestamp > ago(24h)
| where ActionType == "CreateRemoteThreadApiCall"
| where InitiatingProcessFileName !in~ (TrustedSources)
| extend TargetIsHighRisk = FileName in~ (HighRiskTargets)
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, TargetIsHighRisk
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Endpoint protection products (CrowdStrike, SentinelOne, Carbon Black) injecting DLLs for hooking and monitoring
- Application compatibility shims (apphelp.dll) that inject into processes for compatibility fixes
- Accessibility tools (screen readers, magnifiers) that inject into processes to read UI state
- Development tools and debuggers (Visual Studio, x64dbg, WinDbg) attaching to processes during debugging sessions
References (6)
- https://attack.mitre.org/techniques/T1055/
- https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1055/T1055.md
- https://www.elastic.co/blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
- https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/create_remote_thread
Unlock Pro Content
Get the full detection package for T1055 including response playbook, investigation guide, and atomic red team tests.
Related Detections
Sub-techniques (12)
- T1055.001Dynamic-link Library Injection
- T1055.002Portable Executable Injection
- T1055.003Thread Execution Hijacking
- T1055.004Asynchronous Procedure Call
- T1055.005Thread Local Storage
- T1055.008Ptrace System Calls
- T1055.009Proc Memory
- T1055.011Extra Window Memory Injection
- T1055.012Process Hollowing
- T1055.013Process Doppelganging
- T1055.014VDSO Hijacking
- T1055.015ListPlanting