Cross-source coverage
T1574.001 / ATT&CK
Hijack Execution Flow: DLL
167 rules · 165 families across 6 sources.
3 deprecated hidden · include
From MITRE ATT&CK 19.2
Adversaries may abuse dynamic-link library files (DLLs) in order to achieve persistence, escalate privileges, and evade defenses. DLLs are libraries that contain code and data that can be simultaneously utilized by multiple programs. While DLLs are not malicious by nature, they can be abused through mechanisms such as side-loading, hijacking search order, and phantom DLL hijacking.
Specific ways DLLs are abused by adversaries include:
DLL Sideloading
Adversaries may execute their own malicious payloads by side-loading DLLs. Side-loading involves hijacking which DLL a program loads by planting and then invoking a legitimate application that executes their payload(s).
Side-loading positions both the victim application and malicious payload(s) alongside each other. Adversaries likely use side-loading as a means of masking actions they perform under a legitimate, trusted, and potentially elevated system or software process. Benign executables used to side-load payloads may not be flagged during delivery and/or execution. Adversary payloads may also be encrypted/packed or otherwise obfuscated until loaded into the memory of the trusted process.
Adversaries may also side-load other packages, such as BPLs (Borland Package Library).
Adversaries may chain DLL sideloading multiple times to fragment functionality hindering analysis. Adversaries using multiple DLL files can split the loader functions across different DLLs, with a main DLL loading the separated export functions. Spreading loader functions across multiple DLLs makes analysis harder, since all files must be collected to fully understand the malware’s behavior. Another method implements a “loader-for-a-loader”, where a malicious DLL’s sole role is to load a second DLL (or a chain of DLLs) that contain the real payload.
DLL Search Order Hijacking
Adversaries may execute their own malicious payloads by hijacking the search order that Windows uses to load DLLs. This search order is a sequence of special and standard search locations that a program checks when loading a DLL. An adversary can plant a trojan DLL in a directory that will be prioritized by the DLL search order over the location of a legitimate library. This will cause Windows to load the malicious DLL when it is called for by the victim program.
DLL Redirection
Adversaries may directly modify the search order via DLL redirection, which after being enabled (in the Registry or via the creation of a redirection file) may cause a program to load a DLL from a different location.
Phantom DLL Hijacking
Adversaries may leverage phantom DLL hijacking by targeting references to non-existent DLL files. They may be able to load their own malicious DLL by planting it with the correct name in the location of the missing module.
DLL Substitution
Adversaries may target existing, valid DLL files and substitute them with their own malicious DLLs, planting them with the same name and in the same location as the valid DLL file.
Programs that fall victim to DLL hijacking may appear to behave normally because malicious DLLs may be configured to also load the legitimate DLLs they were meant to replace, evading defenses.
Remote DLL hijacking can occur when a program sets its current directory to a remote location, such as a Web share, before loading a DLL.
If a valid DLL is configured to run at a higher privilege level, then the adversary-controlled DLL that is loaded will also be executed at the higher level. In this case, the technique could be used for privilege escalation.
- Platforms
- Windows
- Telemetry
-
WinEventLog:SysmonWinEventLog:Security
How MITRE says to detect it DET0201
Detection Strategy for Hijack Execution Flow for DLLs
Windows Analytic 0577
DLL hijacking behaviors including unexpected DLL loads from non-standard directories, replacement of DLLs, phantom DLL insertion, redirection file creation, and substitution of legitimate DLLs. Defender correlates file system modifications, registry changes, and module load telemetry to detect abnormal DLL behavior in trusted processes.
WinEventLog:SysmonEventCode=11WinEventLog:SysmonEventCode=15WinEventLog:SysmonEventCode=7WinEventLog:SecurityEventCode=4657WinEventLog:SysmonEventCode=1
SigmaHQ/sigma
93 rules| Detection | Severity | Format |
|---|---|---|
| APT27 - Emissary Panda Activity | Critical | Sigma |
| Winnti Malware HK University Campaign | Critical | Sigma |
| Winnti Pipemon Characteristics | Critical | Sigma |
| Aruba Network Service Potential DLL Sideloading | High | Sigma |
| DHCP Callout DLL Installation | High | Sigma |
| DHCP Server Error Failed Loading the CallOut DLL | High | Sigma |
| DHCP Server Loaded the CallOut DLL | High | Sigma |
| Diamond Sleet APT DLL Sideloading Indicators | High | Sigma |
| DLL Search Order Hijackig Via Additional Space in Path | High | Sigma |
| DLL Sideloading by VMware Xfer Utility | High | Sigma |
+ 83 more from SigmaHQ/sigma → showing the 10 highest-severity
elastic/protections-artifacts
39 rules| Detection | Severity | Format |
|---|---|---|
| DLL Dropped by MSIEXEC followed by SideLoad | Undefined | Elastic TOML |
| DLL Side Loading of a file dropped by Microsoft Office | Undefined | Elastic TOML |
| DLL Side Loading via a Copied Microsoft Executable | Undefined | Elastic TOML |
| Evasion via LdrpKernel32 Overwrite | Undefined | Elastic TOML |
| Hollow Image Behavior via Native API | Undefined | Elastic TOML |
| Ingress DLL Transfer followed by DLL SideLoading | Undefined | Elastic TOML |
| Known Desktop Application DLL Search Order Hijack | Undefined | Elastic TOML |
| Memory Allocation from a High Entropy Module | Undefined | Elastic TOML |
| Oversized DLL Creation followed by SideLoad | Undefined | Elastic TOML |
| Potential DLL Hijacking via Environment Paths | Undefined | Elastic TOML |
+ 29 more from elastic/protections-artifacts → showing the 10 highest-severity
splunk/security_content
17 rules| Detection | Severity | Format |
|---|---|---|
| MSI Module Loaded by Non-System Binary | Undefined | SPL |
| Msmpeng Application DLL Side Loading | Undefined | SPL |
| Windows DLL Search Order Hijacking Hunt with Sysmon | Undefined | SPL |
| Windows DLL Search Order Hijacking with iscsicpl | Undefined | SPL |
| Windows DLL Side-Loading In Calc | Undefined | SPL |
| Windows DLL Side-Loading Process Child Of Calc | Undefined | SPL |
| Windows Hijack Execution Flow Version Dll Side Load | Undefined | SPL |
| Windows Known Abused DLL Created | Undefined | SPL |
| Windows Known Abused DLL Loaded Suspiciously | Undefined | SPL |
| Windows Known GraphicalProton Loaded Modules | Undefined | SPL |
+ 7 more from splunk/security_content → showing the 10 highest-severity
elastic/detection-rules
11 rules| Detection | Severity | Format |
|---|---|---|
| Potential Masquerading as System32 DLL | High | Elastic TOML |
| Suspicious Antimalware Scan Interface DLL | High | Elastic TOML |
| Suspicious DLL Loaded for Persistence or Privilege Escalation | High | Elastic TOML |
| Suspicious Microsoft Antimalware Service Execution | High | Elastic TOML |
| UAC Bypass Attempt via Privileged IFileOperation COM Interface | High | Elastic TOML |
| Untrusted DLL Loaded by Azure AD Connect Authentication Agent | High | Elastic TOML |
| WPS Office Exploitation via DLL Hijack | High | Elastic TOML |
| Execution via local SxS Shared Module | Medium | Elastic TOML |
| Potential DLL Side-Loading via Trusted Microsoft Programs | Medium | Elastic TOML |
| Potential Windows Session Hijacking via CcmExec | Medium | Elastic TOML |
+ 1 more from elastic/detection-rules → showing the 10 highest-severity