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.
ID | Name | Description |
---|---|---|
S0469 | ABK |
ABK has the ability to inject shellcode into svchost.exe.[1] |
S0331 | Agent Tesla |
Agent Tesla can inject into known, vulnerable binaries on targeted hosts.[2] |
G0050 | APT32 |
APT32 malware has injected a Cobalt Strike beacon into Rundll32.exe.[3] |
G0067 | APT37 |
APT37 injects its malware variant, ROKRAT, into the cmd.exe process.[4] |
G0096 | APT41 |
APT41 malware TIDYELF loaded the main WINTERLOVE component by injecting it into the iexplore.exe process.[5] |
S0438 | Attor |
Attor's dispatcher can inject itself into running processes to gain higher privileges and to evade detection.[6] |
S0347 | AuditCred |
AuditCred can inject code from files to other running processes.[7] |
S0473 | Avenger |
Avenger has the ability to inject shellcode into svchost.exe.[1] |
S0093 | Backdoor.Oldrea |
Backdoor.Oldrea injects itself into explorer.exe.[8][9] |
S0534 | Bazar |
Bazar can inject code through calling |
S0470 | BBK |
BBK has the ability to inject shellcode into svchost.exe.[1] |
S0348 | Cardinal RAT |
Cardinal RAT injects into a newly spawned process created from a native Windows executable.[11] |
S0660 | Clambling |
Clambling can inject into the |
G0080 | Cobalt Group |
Cobalt Group has injected code into trusted processes.[13] |
S0154 | Cobalt Strike |
Cobalt Strike can inject a variety of payloads into processes dynamically chosen by the adversary.[14][15] |
S0695 | Donut |
Donut includes a subproject |
S0024 | Dyre |
Dyre has the ability to directly inject its code into the web browser process.[17] |
S0554 | Egregor |
Egregor can inject its payload into iexplore.exe process.[18] |
S0363 | Empire |
Empire contains multiple modules for injecting into processes, such as |
S0168 | Gazer |
Gazer injects its communication module into an Internet accessible process through which it performs C2.[20][21] |
S0032 | gh0st RAT |
gh0st RAT can inject malicious code into process created by the "Command_Create&Inject" function.[22] |
S0561 | GuLoader |
GuLoader has the ability to inject shellcode into a donor processes that is started in a suspended state. GuLoader has previously used RegAsm as a donor process.[23] |
G0072 | Honeybee |
Honeybee uses a batch file to load a DLL into the svchost.exe process.[24] |
S0376 | HOPLIGHT | |
S0040 | HTRAN | |
S0398 | HyperBro |
HyperBro can run shellcode it injects into a newly created process.[27] |
S0260 | InvisiMole |
InvisiMole can inject itself into another process to avoid detection including use of a technique called ListPlanting that customizes the sorting algorithm in a ListView structure.[28] |
S0581 | IronNetInjector |
IronNetInjector can use an IronPython scripts to load a .NET injector to inject a payload into its own or a remote process.[29] |
S0044 | JHUHUGIT |
JHUHUGIT performs code injection injecting its own functions to browser processes.[30][31] |
S0201 | JPIN |
JPIN can inject content into lsass.exe to load a module.[32] |
G0094 | Kimsuky |
Kimsuky has used Win7Elevate to inject malicious code into explorer.exe.[33] |
S0681 | Lizar | |
S0247 | NavRAT |
NavRAT copies itself into a running Internet Explorer process to evade detection.[35] |
S0198 | NETWIRE |
NETWIRE can inject code into system processes including notepad.exe, svchost.exe, and vbc.exe.[36] |
G0116 | Operation Wocao |
Operation Wocao has injected code into a selected process, which in turn launches a command as a child process of the original.[37] |
S0664 | Pandora |
Pandora can start and inject code into a new |
G0068 | PLATINUM |
PLATINUM has used various methods of process injection including hot patching.[32] |
S0378 | PoshC2 |
PoshC2 contains multiple modules for injecting into processes, such as |
S0650 | QakBot |
QakBot can inject itself into processes including explore.exe, Iexplore.exe, and Mobsync.exe.[40][41][42][43] |
S0332 | Remcos |
Remcos has a command to hide itself through injecting into another process.[44] |
S0496 | REvil |
REvil can inject itself into running processes on a compromised host.[45] |
S0240 | ROKRAT |
ROKRAT can use |
S0446 | Ryuk |
Ryuk has injected itself into remote processes to encrypt files using a combination of |
S0596 | ShadowPad |
ShadowPad has injected an install module into a newly created process.[48] |
G0104 | Sharpshooter |
Sharpshooter has leveraged embedded shellcode to inject a downloader into the memory of Word.[49] |
G0091 | Silence |
Silence has injected a DLL library containing a Trojan into the fwmain32.exe process.[50] |
S0692 | SILENTTRINITY |
SILENTTRINITY can inject shellcode directly into Excel.exe or a specific process.[51] |
S0633 | Sliver |
Sliver can inject code into local and remote processes.[52][53] |
S0533 | SLOTHFULMEDIA |
SLOTHFULMEDIA can inject into running processes on a compromised host.[54] |
S0226 | Smoke Loader |
Smoke Loader injects into the Internet Explorer process.[55] |
S0380 | StoneDrill |
StoneDrill has relied on injecting its payload directly into the process memory of the victim's preferred browser.[56] |
S0266 | TrickBot |
TrickBot has used |
S0436 | TSCookie |
TSCookie has the ability to inject code into the svchost.exe, iexplorer.exe, explorer.exe, and default browser processes.[58] |
G0010 | Turla |
Turla has also used PowerSploit's |
S0670 | WarzoneRAT |
WarzoneRAT has the ability to inject malicious DLLs into a specific process for privilege escalation.[60] |
S0579 | Waterbear |
Waterbear can inject decrypted shellcode into the LanmanServer service.[61] |
S0689 | WhisperGate |
WhisperGate has the ability to inject its fourth stage into a suspended process created by the legitimate Windows utility |
S0206 | Wiarp |
Wiarp creates a backdoor through which remote attackers can inject files into running processes.[63] |
S0176 | Wingbird |
Wingbird performs multiple process injections to hijack system processes and execute malicious code.[64] |
ID | Mitigation | Description |
---|---|---|
M1040 | Behavior Prevention on Endpoint |
Some endpoint security solutions can be configured to block some types of process injection based on common sequences of behavior that occur during the injection process. For example, on Windows 10, Attack Surface Reduction (ASR) rules may prevent Office applications from code injection. [65] |
M1026 | Privileged Account Management |
Utilize Yama (ex: /proc/sys/kernel/yama/ptrace_scope) to mitigate ptrace based process injection by restricting the use of ptrace to privileged users only. Other mitigation controls involve the deployment of security kernel modules that provide advanced access control and process restrictions such as SELinux, grsecurity, and AppArmor. |
ID | Data Source | Data Component |
---|---|---|
DS0022 | File | File Metadata |
File Modification | ||
DS0011 | Module | Module Load |
DS0009 | Process | OS API Execution |
Process Access | ||
Process Modification |
Monitoring Windows API calls indicative of the various types of code injection may generate a significant amount of data and may not be directly useful for defense unless collected under specific circumstances for known bad sequences of calls, since benign use of API functions may be common and difficult to distinguish from malicious behavior. Windows API calls such as CreateRemoteThread
, SuspendThread
/SetThreadContext
/ResumeThread
, QueueUserAPC
/NtQueueApcThread
, and those that can be used to modify memory within another process, such as VirtualAllocEx
/WriteProcessMemory
, may be used for this technique.[66]
Monitor DLL/PE file events, specifically creation of these binary files as well as the loading of DLLs into processes. Look for DLLs that are not recognized or not normally loaded into a process.
Monitoring for Linux specific calls such as the ptrace system call should not generate large amounts of data due to their specialized nature, and can be a very effective method to detect some of the common process injection methods.[67] [68] [69] [70]
Monitor for named pipe creation and connection events (Event IDs 17 and 18) for possible indicators of infected processes with external modules.[71]
Analyze process behavior to determine if a process is performing actions it usually does not, such as opening network connections, reading files, or other suspicious actions that could relate to post-compromise behavior.