Hijack Execution Flow: Dylib Hijacking T1574.004

Tactics: Stealth, Execution

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.

Events covered

1 catalog event is tagged with this technique by at least one rule.

Authoring guide

Patterns shared across the 1 rule above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.

Fields filtered most (4 distinct)

The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.

FieldRulesHowSample values
CommandLine1contains 1-encodedcommand
EfectiveCommand1regex_match 1regexEmpire
EventData1contains 1-encodedcommand, powershell.exe, powershell_ise.exe
EventID1eq 14688

Top indicator values (7 distinct)

Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.

FieldKindValueRules (here)Corpus reach
CommandLinecontains
-encodedcommand
13
EfectiveCommandregex_match
regexEmpire
1
EventDatacontains
-encodedcommand
1
EventDatacontains
powershell.exe
1
EventDatacontains
powershell_ise.exe
1
EventDatacontains
pwsh.exe
1
EventIDeq
4688
1313

Exclusions (4 distinct)

Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.

FieldKindValueRules excluding
EventDatacontains
gc_service.exe
1
EventDatacontains
gc_worker.exe
1
ParentImagecontains
gc_service.exe
1
ParentImagecontains
gc_worker.exe
1

Rules under this technique

Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.

Platform (all)
Domain (all)

Kusto 1 rule