Hijack Execution Flow: Dynamic Linker Hijacking T1574.006

Tactics: Stealth, Execution

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. Libraries specified in environment variables are loaded first, taking precedence over system libraries with the same function name. 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.

Events covered

3 catalog events are tagged with this technique by at least one rule.

ProviderEventTitle
SysmonEvent ID 11FileCreate
ESFexecProcess Execution (Notify)
Linux-AuditdEvent ID 1302PATH

Authoring guide

Patterns shared across the 24 rules 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 (24 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
host.os.type16eq 16
EventType12eq 6, in 6exec, creation, ProcessRollup2, exec_event, file_create_event
TargetFilename11wildcard 7, in 2, eq 1, starts_with 1/etc/ld.so.preload, /etc/ld.so.conf, /etc/ld.so.conf.d/*, */.github/workflows/*.yaml, */.github/workflows/*.yml
event.type11eq 9, in 1, ne 1start, creation, deletion, process_started
process_name8in 5, eq 3, is_not_null 1bash, csh, dash, cp, ctl
process.args6in 4, eq 3, contains 1, wildcard 1/etc/ld.so.preload, /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2, /lib64/ld-linux-x86-64.so.2, * /dev/shm/* , * /home/*
event.category4eq 4file, process
CommandLine3contains 2, wildcard 1* nc *, * nc.traditional *, * ncat *, ld_library_path=, ld_preload
file.extension3eq 3so, swp
container.id2starts_with 1, wildcard 1*, ?
file.name2contains 2.so.
process.env_vars2is_not_null 1, starts_with 1DYLD_INSERT_LIBRARIES=?, LD_PRELOAD=?
process.interactive2eq 2true
sourcetype2eq 2auditd
type2eq 2PATH, CWD

Top indicator values (383 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
event.typeeq
start
7606
event.typeeq
creation
245
EventTypeeq
exec
3171
EventTypeeq
creation
225
EventTypein
ProcessRollup2
3117
EventTypein
exec
3171
EventTypein
creation
223
EventTypein
exec_event
2139
EventTypein
executed
288
EventTypein
file_create_event
29
EventTypein
process_started
274
EventTypein
start
2134
TargetFilenamewildcard
/etc/ld.so.conf
33
TargetFilenamewildcard
/etc/ld.so.conf.d/*
33
TargetFilenamewildcard
/etc/ld.so.preload
33
TargetFilenamewildcard
/lib/ld-linux*.so*
22
TargetFilenamewildcard
/lib64/ld-linux*.so*
22
TargetFilenamewildcard
/usr/lib/ld-linux*.so*
22
TargetFilenamewildcard
/usr/lib64/ld-linux*.so*
22
process_namein
bash
388
process_namein
csh
371
process_namein
dash
378
process_namein
fish
372
process_namein
ksh
373
process_namein
sh
383
process_namein
tcsh
369
process_namein
zsh
382
event.categoryeq
file
231
event.categoryeq
process
2128
file.extensioneq
so
25

Exclusions (225 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
Imagein
./usr/bin/podman
2
Imagein
/bin/autossl_check
2
Imagein
/bin/chef-client
2
Imagein
/bin/dnf
2
Imagein
/bin/dnf-automatic
2
Imagein
/bin/dockerd
2
Imagein
/bin/dpkg
2
Imagein
/bin/dpkg-divert
2
Imagein
/bin/microdnf
2
Imagein
/bin/pacman
2
Imagein
/bin/pamac-daemon
2
Imagein
/bin/podman
2
Imagein
/bin/puppet
2
Imagein
/bin/rpm
2
Imagein
/bin/snapd
2

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)

Sigma 2 rules

Elastic 17 rules

Splunk 5 rules