Adversaries may inject dynamic-link libraries (DLLs) into processes in order to evade process-based defenses as well as possibly elevate privileges. DLL injection is a method of executing arbitrary code in the address space of a separate live process.
DLL injection is commonly performed by writing the path to a DLL in the virtual address space of the target process before loading the DLL by invoking a new thread. The write can be performed with native Windows API calls such as VirtualAllocEx
and WriteProcessMemory
, then invoked with CreateRemoteThread
(which calls the LoadLibrary
API responsible for loading the DLL). [1]
Variations of this method such as reflective DLL injection (writing a self-mapping DLL into a process) and memory module (map DLL when writing into process) overcome the address relocation issue as well as the additional APIs to invoke execution (since these methods load and execute the files in memory by manually preforming the function of LoadLibrary
).[2][1]
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 DLL injection may also evade detection from security products since the execution is masked under a legitimate process.
ID | Name | Description |
---|---|---|
S0456 | Aria-body |
Aria-body has the ability to inject itself into another process such as rundll32.exe and dllhost.exe.[3] |
G0135 | BackdoorDiplomacy |
BackdoorDiplomacy has dropped legitimate software onto a compromised host and used it to execute malicious DLLs.[4] |
S0089 | BlackEnergy |
BlackEnergy injects its DLL component into svchost.exe.[5] |
S0484 | Carberp |
Carberp's bootkit can inject a malicious DLL into the address space of running processes.[6] |
S0335 | Carbon | |
S0154 | Cobalt Strike |
Cobalt Strike has the ability to load DLLs via reflective injection.[8][9] |
S0126 | ComRAT |
ComRAT has injected its orchestrator DLL into explorer.exe. ComRAT has also injected its communications module into the victim's default browser to make C2 connections appear less suspicious as all network connections will be initiated by the browser process.[10][11] |
S0575 | Conti |
Conti has loaded an encrypted DLL into memory and then executes it.[12][13] |
S0021 | Derusbi |
Derusbi injects itself into the secure shell (SSH) process.[14] |
S0038 | Duqu |
Duqu will inject itself into different processes to evade detection. The selection of the target process is influenced by the security software that is installed on the system (Duqu will inject into different processes depending on which security suite is installed on the infected host).[15] |
S0024 | Dyre | |
S0081 | Elise | |
S0082 | Emissary |
Emissary injects its DLL file into a newly spawned Internet Explorer process.[19] |
S0367 | Emotet |
Emotet has been observed injecting in to Explorer.exe and other processes. [20][21][22] |
S0182 | FinFisher |
FinFisher injects itself into various processes depending on whether it is low integrity or high integrity.[23][24] |
S0666 | Gelsemium |
Gelsemium has the ability to inject DLLs into specific processes.[25] |
S0460 | Get2 | |
S0135 | HIDEDRV |
HIDEDRV injects a DLL for Downdelph into the explorer.exe process.[27] |
S0581 | IronNetInjector |
IronNetInjector has the ability to inject a DLL into running processes, including the IronNetInjector DLL into explorer.exe.[28] |
S0265 | Kazuar |
If running in a Windows environment, Kazuar saves a DLL to disk that is injected into the explorer.exe process to execute the payload. Kazuar can also be configured to inject and execute within specific processes.[29] |
S0250 | Koadic |
Koadic can perform process injection by using a reflective DLL.[30] |
G0032 | Lazarus Group |
A Lazarus Group malware sample performs reflective DLL injection.[31][32] |
G0065 | Leviathan |
Leviathan has utilized techniques like reflective DLL loading to write a DLL into memory and load a shell that provides backdoor access to the victim.[33] |
S0681 | Lizar |
Lizar has used the PowerKatz plugin that can be loaded into the address space of a PowerShell process through reflective DLL loading.[34] |
S0167 | Matryoshka |
Matryoshka uses reflective DLL injection to inject the malicious library and execute the RAT.[35] |
S0449 | Maze |
Maze has injected the malware DLL into a target process.[36][37] |
S0576 | MegaCortex |
MegaCortex loads |
S0455 | Metamorfo |
Metamorfo has injected a malicious DLL into the Windows Media Player process (wmplayer.exe).[39] |
S0457 | Netwalker |
The Netwalker DLL has been injected reflectively into the memory of a legitimate running process.[40] |
S0501 | PipeMon |
PipeMon can inject its modules into various processes using reflective DLL loading.[41] |
S0012 | PoisonIvy |
PoisonIvy can inject a malicious DLL into a process.[42][43] |
S0194 | PowerSploit |
PowerSploit contains a collection of CodeExecution modules that inject code (DLL, shellcode) into a process.[44][45] |
S0613 | PS1 | |
S0192 | Pupy |
Pupy can migrate into another process using reflective DLL injection.[47] |
G0024 | Putter Panda |
An executable dropped onto victims by Putter Panda aims to inject the specified DLL into a process that would normally be accessing the network, including Outlook Express (msinm.exe), Outlook (outlook.exe), Internet Explorer (iexplore.exe), and Firefox (firefox.exe).[48] |
S0458 | Ramsay |
Ramsay can use |
S0055 | RARSTONE |
After decrypting itself in memory, RARSTONE downloads a DLL file from its C2 server and loads it in the memory space of a hidden Internet Explorer process. This "downloaded" file is actually not dropped onto the system.[50] |
S0241 | RATANKBA |
RATANKBA performs a reflective DLL injection using a given pid.[51][52] |
S0125 | Remsec | |
S0461 | SDBbot |
SDBbot has the ability to inject a downloaded DLL into a newly created rundll32.exe process.[26] |
S0596 | ShadowPad | |
S0273 | Socksbot |
Socksbot creates a suspended svchost process and injects its DLL into it.[55] |
S0615 | SombRAT |
SombRAT can execute |
S0603 | Stuxnet |
Stuxnet injects an entire DLL into an existing, newly created, or preselected trusted process.[56] |
S0018 | Sykipot |
Sykipot injects itself into running instances of outlook.exe, iexplore.exe, or firefox.exe.[57] |
G0092 | TA505 | |
S0011 | Taidoor | |
S0467 | TajMahal |
TajMahal has the ability to inject DLLs for malicious plugins into running processes.[61] |
G0081 | Tropic Trooper |
Tropic Trooper has injected a DLL backdoor into dllhost.exe and svchost.exe.[62][63] |
G0010 | Turla |
Turla has used Metasploit to perform reflective DLL injection in order to escalate privileges.[64][65] |
G0102 | Wizard Spider |
Wizard Spider has injected malicious DLLs into memory with read, write, and execute permissions.[66][67] |
S0412 | ZxShell |
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. |
ID | Data Source | Data Component |
---|---|---|
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
and those that can be used to modify memory within another process, such as VirtualAllocEx
/WriteProcessMemory
, may be used for this technique.[1]
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.
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.