MITRE ATT&CKsub-technique
T1574.001 DLL
- Domain
- enterprise
- Tactics
- Stealth, Execution
- Platforms
- Windows
- Version
- 3.0
- Created
- 2020-03-13
Description
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.
Related
Subtechnique of · MITRE ATT&CK (1)
- T1574 Hijack Execution Flow technique
Referenced by MITRE ATT&CK · mitigates (5)
Referenced by MITRE ATT&CK · uses (122)
- G1059 NIMBUS MANTICORE group
- S9065 DCSYNCER.SLICK software (malware)
- S9066 POLLBLEND software (malware)
- S9067 TWOSTROKE software (malware)
- S9061 LIGHTRAIL software (malware)
- S9059 MiniBike software (malware)
- S9060 MiniBus software (malware)
- S9050 Vidar software (malware)
- S9029 IronWind software (malware)
- S9031 AshTag software (malware)
- S9027 ANELLDR software (malware)
- G1054 MirrorFace group
- S9020 LODEINFO software (malware)
- S9025 NOOPLDR software (malware)
- S9026 ROAMINGHOUSE software (malware)
- S1239 TONESHELL software (malware)
- S1232 SplatDropper software (malware)
- S1233 PAKLOG software (malware)
- S1235 CorKLOG software (malware)
- S1236 CLAIMLOADER software (malware)
- S1237 CANONSTAGER software (malware)
- C0057 3CX Supply Chain Attack campaign
- S1230 HIUPAN software (malware)
- S1229 Havoc software (malware)
- S1228 PUBLOAD software (malware)
- S1226 BOOKWORM software (malware)
- S1227 StarProxy software (malware)
- S1213 Lumma Stealer software (malware)
- G1046 Storm-1811 group
- G1047 Velvet Ant group
Referenced by CAPEC · att&ck technique (1)
- CAPEC-471 Search Order Hijacking attack pattern
Referenced by Compliance · mitigates (14)
- CIS-16.10 Apply Secure Design Principles in Application Architectures CIS Safeguard v8.1
- CIS-16.11 Leverage Vetted Modules or Services for Application Security Components CIS Safeguard v8.1
- CIS-16.12 Implement Code-Level Security Checks CIS Safeguard v8.1
- CIS-2.6 Allowlist Authorized Libraries CIS Safeguard v8.1
- CIS-7.4 Perform Automated Application Patch Management CIS Safeguard v8.1
- CIS-7.7 Remediate Detected Vulnerabilities CIS Safeguard v8.1
- NIST-CM-2 Baseline Configuration NIST 800-53 control
- NIST-CM-6 Configuration Settings NIST 800-53 control
- NIST-CM-7 Least Functionality NIST 800-53 control
- NIST-RA-5 Vulnerability Monitoring and Scanning NIST 800-53 control
- NIST-SI-10 Information Input Validation NIST 800-53 control
- NIST-SI-3 Malicious Code Protection NIST 800-53 control
- NIST-SI-4 System Monitoring NIST 800-53 control
- NIST-SI-7 Software, Firmware, and Information Integrity NIST 800-53 control
References
- https://www.crowdstrike.com/en-us/blog/4-ways-adversaries-hijack-dlls/ Hijack DLLs CrowdStrike
- https://www.kroll.com/en/insights/publications/cyber/idatloader-distribution kroll bpl
- https://news.sophos.com/en-us/2023/05/03/doubled-dll-sideloading-dragon-breath/ Sophos
- https://www.hexacorn.com/blog/2013/12/08/beyond-good-ol-run-key-part-5/ Hexacorn DLL Hijacking
- https://learn.microsoft.com/en-us/security-updates/securityadvisories/2010/2269637 microsoft remote preloading
- https://learn.microsoft.com/en-us/windows/win32/sbscs/manifests?redirectedfrom=MSDN Microsoft - manifests/assembly
- https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-redirection?redirectedfrom=MSDN Microsoft redirection
- https://owasp.org/www-community/attacks/Binary_planting dll pre load owasp
- https://www.virusbulletin.com/conference/vb2023/abstracts/unveiling-activities-tropic-trooper-2023-deep-analysis-xiangoop-loader-and-entryshell-payload/ Virus Bulletin
- https://unit42.paloaltonetworks.com/dll-hijacking-techniques/ unit 42
- https://www.wietzebeukema.nl/blog/hijacking-dlls-in-windows Wietze Beukema DLL Hijacking