Dynamic-link Library Injection

T1055.001

Sub-technique of T1055 Process Injection.View on attack.mitre.org

About this technique

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).

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).

Another variation of this method, often referred to as Module Stomping/Overloading or DLL Hollowing, may be leveraged to conceal injected code within a process. This method involves loading a legitimate DLL into a remote process then manually overwriting the module's AddressOfEntryPoint before starting a new thread in the target process. This variation allows attackers to hide malicious injected code by potentially backing its execution with a legitimate DLL file on disk.

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.

Detection rules11

Rules on DetectionCode tagged with T1055.001.

Sigma6

RuleLevelLog source
HackTool - Potential CobaltStrike Process Injectionhighwindows / create_remote_thread
ManageEngine Endpoint Central Dctask64.EXE Potential Abusehighwindows / process_creation
Mavinject Inject DLL Into Running Processhighwindows / process_creation
Renamed Mavinject.EXE Executionhighwindows / process_creation
Renamed ZOHO Dctask64 Executionhighwindows / process_creation
Potential DLL Injection Or Execution Using Tracker.exemediumwindows / process_creation

Splunk5

RuleTypeRiskData source
Loading Of Dynwrapx ModuleTTPNULLSysmon EventID 7
PowerShell PInvoke Process Injection API ChainTTPNULLPowershell Script Block Logging 4104
Windows Process Injection Of Wermgr to Known BrowserTTPNULLSysmon EventID 8
Windows Rasautou DLL ExecutionTTPNULLSysmon EventID 1, Windows Event Log Security 4688, CrowdStrike ProcessRollup2
Windows Uncommon Remote Thread Creation In Browser ProcessAnomalyNULLSysmon EventID 8

Groups10

Software56

Show 32 more

Campaigns1

Procedure examples67

Groups10

Used byProcedure example
GroupBackdoorDiplomacy

BackdoorDiplomacy has dropped legitimate software onto a compromised host and used it to execute malicious DLLs.

GroupKimsuky

Kimsuky has the ability to load DLLs via reflective injection by allocating memory using `VirtualAllocEx()`, then decrypting a DLL with `WriteProcessMemory()` and invoking execution through `CreateRemoteThread()`.

GroupLazarus Group

A Lazarus Group malware sample performs reflective DLL injection.

GroupLeviathan

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.

GroupMalteiro

Malteiro has injected Mispadu’s DLL into a process.

GroupPutter 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).

GroupTA505

TA505 has been seen injecting a DLL into winword.exe.

GroupTropic Trooper

Tropic Trooper has injected a DLL backdoor into dllhost.exe and svchost.exe.

View all 10 groups examples

Software56

Used byProcedure example
MalwareAria-body

Aria-body has the ability to inject itself into another process such as rundll32.exe and dllhost.exe.

MalwareBADHATCH

BADHATCH has the ability to execute a malicious DLL by injecting into `explorer.exe` on a compromised machine.

MalwareBlackEnergy

BlackEnergy injects its DLL component into svchost.exe.

MalwareBumblebee

The Bumblebee loader can support the `Dij` command which gives it the ability to inject DLLs into the memory of other processes.

MalwareCarberp

Carberp's bootkit can inject a malicious DLL into the address space of running processes.

MalwareCarbon

Carbon has a command to inject code into a process.

MalwareCobalt Strike

Cobalt Strike has the ability to load DLLs via reflective injection.

MalwareComRAT

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.

View all 56 software examples

Campaigns1

Used byProcedure example
CampaignC0015

During C0015, the threat actors used a DLL named `D8B3.dll` that was injected into the Winlogon process.

References4

  1. Elastic HuntingNMemory June 2017 Open source
    Desimone, J. (2017, June 13). Hunting in Memory. Retrieved December 7, 2017.
  2. Elastic Process Injection July 2017 Open source
    Hosseini, A. (2017, July 18). Ten Process Injection Techniques: A Technical Survey Of Common And Trending Process Injection Techniques. Retrieved December 7, 2017.
  3. Hiding Malicious Code with Module Stomping Open source
    Aliz Hammond. (2019, August 15). Hiding Malicious Code with "Module Stomping": Part 1. Retrieved July 14, 2022.
  4. Module Stomping for Shellcode Injection Open source
    Red Teaming Experiments. (n.d.). Module Stomping for Shellcode Injection. Retrieved July 14, 2022.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.