| name | T1574.004_dylib-hijacking |
| description | Adversaries may execute their own payloads by placing a malicious dynamic library (dylib) with an expected name in a path a victim application searches at runtime. |
| category | configuration |
| version | 18.1 |
| author | cyberstrike-official |
| tags | ["mitre-attack","enterprise","t1574.004","persistence","privilege-escalation","defense-evasion","macos","sub-technique"] |
| technique_id | T1574.004 |
| tactic | persistence |
| all_tactics | ["persistence","privilege-escalation","defense-evasion"] |
| platforms | ["macOS"] |
| mitre_url | https://attack.mitre.org/techniques/T1574/004 |
| tech_stack | ["macos"] |
| cwe_ids | ["CWE-276"] |
| chains_with | ["T1574","T1574.001","T1574.005","T1574.006","T1574.007","T1574.008","T1574.009","T1574.010","T1574.011","T1574.012","T1574.013","T1574.014"] |
| prerequisites | ["T1574"] |
| severity_boost | {"T1574":"Chain with T1574 for deeper attack path","T1574.001":"Chain with T1574.001 for deeper attack path","T1574.005":"Chain with T1574.005 for deeper attack path"} |
T1574.004 Dylib Hijacking
Sub-technique of: T1574
High-Level Description
Adversaries may execute their own payloads by placing a malicious dynamic library (dylib) with an expected name in a path a victim application searches at runtime. The dynamic loader will try to find the dylibs based on the sequential order of the search paths. Paths to dylibs may be prefixed with @rpath, which allows developers to use relative paths to specify an array of search paths used at runtime based on the location of the executable. Additionally, if weak linking is used, such as the LC_LOAD_WEAK_DYLIB function, an application will still execute even if an expected dylib is not present. Weak linking enables developers to run an application on multiple macOS versions as new APIs are added.
Adversaries may gain execution by inserting malicious dylibs with the name of the missing dylib in the identified path. Dylibs are loaded into an application's address space allowing the malicious dylib to inherit the application's privilege level and resources. Based on the application, this could result in privilege escalation and uninhibited network access. This method may also evade detection from security products since the execution is masked under a legitimate process.
Kill Chain Phase
- Persistence (TA0003)
- Privilege Escalation (TA0004)
- Defense Evasion (TA0005)
Platforms: macOS
What to Check
How to Test
Manual Testing
-
Identify Attack Surface: Determine if the target environment is susceptible to Dylib Hijacking by examining the target platforms (macOS).
-
Assess Existing Defenses: Review whether mitigations for T1574.004 are in place. If defenses are absent or misconfigured, this technique may be exploitable.
-
Execute Test: Use tools and methods described in the MITRE ATT&CK page and external references below.
Note: No Atomic Red Team tests available for this technique. See for updates.