Modified the ld.so preload file in Linux environments to enable persistence for Winnti malware.1
Dynamic Linker Hijacking T1574.006
- Platforms
- Linux, macOS
- Version
- 3.0
- Created
- 13 March 2020
- Last modified
- 12 May 2026
Adversaries may execute their own malicious payloads by hijacking environment variables the dynamic linker uses to load shared libraries. During the execution preparation phase of a program, the dynamic linker loads specified absolute paths of shared libraries from various environment variables and files, such as LD_PRELOAD on Linux or DYLD_INSERT_LIBRARIES on macOS.[1][2][3] Libraries specified in environment variables are loaded first, taking precedence over system libraries with the same function name.[4][5][6] Each platform's linker uses an extensive list of environment variables at different points in execution. These variables are often used by developers to debug binaries without needing to recompile, deconflict mapped symbols, and implement custom functions in the original library.[7]
Dynamic Linker Hijacking MITRE reference T1574.006
3 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has modified /etc/ld.so.preload to hook libc functions in order to hide the installed dropper and mining software in process lists.1
Has configured payloads to load via LD_PRELOAD.1
All 3 groups for this technique
7 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
Has been compiled as a Position Independent Executable (PIE) to use a third-party library for injection.1
Can execute code through dynamic linker hijacking of the LD_PRELOAD library.1
Copies the malicious file /data2/.bd.key/preload.so to /lib/preload.so, then launches a child process that executes the malicious file /data2/.bd.key/authd as /bin/authd with the arguments /lib/preload.so reboot newreboot 1.1 This injects the malicious preload.so file into the process with PID 1, and replaces its reboot function with the malicious newreboot function for persistence.
Adds malicious file paths to the DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH environment variables to execute malicious code.1
Has modified /etc/ld.so.preload to intercept shared library import functions.1
Adds itself as a shared object to the LD_PRELOAD environment variable.1
All 7 software entries for this technique · 6 newest in this preview
Offense vs defense T1574.006
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
Dynamic Linker Hijacking detection strategy DET0435
MITRE names one behaviour worth catching for this technique and breaks it into 2 analytics, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Detection Strategy for Hijack Execution Flow: Dynamic Linker Hijacking
AN1209 · Linux
Detection focuses on identifying abuse of LD_PRELOAD and related linker variables. Defender perspective: monitor unexpected setting or modification of LD_PRELOAD in shell initialization scripts or environment exports, file creation of suspicious shared libraries, and correlation of these modifications with anomalous process execution. Key signals include execve events with LD_PRELOAD defined, newly created .so files in user directories, and processes hooking libc functions exhibiting abnormal behavior.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | auditd:SYSCALL | execve with LD_PRELOAD or linker-related environment variables set |
| Process MetadataDC0034 | linux:osquery | process environment variables containing LD_PRELOAD |
| File CreationDC0039 | auditd:PATH | creation of .so files in non-standard directories (e.g., /tmp, /home/*) |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| WatchedEnvVars | Environment variables like LD_PRELOAD, LD_LIBRARY_PATH. Defenders can tune based on development vs. production systems. |
| MonitoredDirectories | Non-standard library paths (e.g., /tmp, user home dirs). May be tuned to reduce false positives from benign development activity. |
| CorrelationWindow | Timeframe to correlate suspicious library creation with process execution that loads it. |
AN1210 · macOS
Detection centers on DYLD_INSERT_LIBRARIES and DYLD_LIBRARY_PATH abuse. Defender perspective: monitor for modification of these environment variables in shell or plist files, file creation of dylibs in user-controlled paths, and correlation of environment variable usage with unexpected module loads by user applications. Suspicious indicators include processes with DYLD_INSERT_LIBRARIES set, execution of applications loading untrusted dylibs, and anomalies in module load history.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Module LoadDC0016 | macos:unifiedlog | loading of unexpected dylibs compared to historical baselines |
| Process CreationDC0032 | macos:unifiedlog | execution of process with DYLD_INSERT_LIBRARIES set |
| File ModificationDC0061 | macos:unifiedlog | create/modify dylib in monitored directories |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| WatchedEnvVars | macOS linker variables like DYLD_INSERT_LIBRARIES. Tunable to development environments where use may be expected. |
| BaselineDylibs | Known dylibs typically loaded by apps. Deviations highlight potential hijacking. |
| MonitoredDirectories | Locations where dylibs are monitored for tampering (e.g., /Applications, /System/Library, /tmp). |
Adversaries may use new payloads to execute this technique. Identify and block potentially malicious software executed through hijacking by using application control solutions also capable of blocking libraries loaded by legitimate software.
When System Integrity Protection (SIP) is enabled in macOS, the aforementioned environment variables are ignored when executing protected binaries. Third-party applications can also leverage Apple’s Hardened Runtime, ensuring these environment variables are subject to imposed restrictions. Admins can add restrictions to applications by setting the setuid and/or setgid bits, use entitlements, or have a __RESTRICT segment in the Mach-O binary.
Tests from Atomic Red Team (MIT licence) · technique definition