Hijack Execution Flow: Path Interception by PATH Environment Variable T1574.007

Tactics: Stealth, Execution

Adversaries may execute their own malicious payloads by hijacking environment variables used to load libraries. The PATH environment variable contains a list of directories (User and System) that the OS searches sequentially through in search of the binary that was called from a script or the command line.

Events covered

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

Authoring guide

Patterns shared across the 9 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 (26 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
event.type4eq 3, in 1start, change, process_started
host.os.type4eq 4
CommandLine3contains 3-encodedcommand, /cfg, /configure, /db, path=
EventType2eq 1, in 1exec, ProcessRollup2, exec_event
process.args2eq 2-c, setenv
process_name2eq 1, in 1bash, csh, dash, launchctl
DLLDirectory1in 1c:\\windows\\, c:\\windows\\system32\\, c:\\windows\\syswow64\\
Details1is_not_null 1
DeviceId1eq 1WinDevices
EfectiveCommand1regex_match 1regexEmpire
EventData1contains 1-encodedcommand, powershell.exe, powershell_ise.exe
EventID1eq 14688
GlobalPrevalence1is_null 1, lt 1200
Image1ends_with 1\secedit.exe
ImageLoaded1contains 1:\windows \system32\, :\windows \syswow64\

Top indicator values (70 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
2606
CommandLinecontains
-encodedcommand
13
CommandLinecontains
/cfg
12
CommandLinecontains
/configure
12
CommandLinecontains
/db
12
CommandLinecontains
/export
12
CommandLinecontains
path=
1
DLLDirectoryin
c:\\windows\\
1
DLLDirectoryin
c:\\windows\\system32\\
1
DLLDirectoryin
c:\\windows\\syswow64\\
1
DLLDirectoryin
c:\\windows\\winsxs\\
1
DeviceIdeq
WinDevices
1
EfectiveCommandregex_match
regexEmpire
1
EventDatacontains
-encodedcommand
1
EventDatacontains
powershell.exe
1
EventDatacontains
powershell_ise.exe
1
EventDatacontains
pwsh.exe
1
EventIDeq
4688
1313
EventTypeeq
exec
1171
EventTypein
ProcessRollup2
1117
EventTypein
exec
1171
EventTypein
exec_event
1139
EventTypein
executed
188
EventTypein
process_started
174
EventTypein
start
1134
GlobalPrevalencelt
200
14
Imageends_with
\secedit.exe
1
ImageLoadedcontains
:\windows \system32\
1
ImageLoadedcontains
:\windows \syswow64\
1
OriginalFileNameeq
secedit
1

Exclusions (48 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
CommandLinecontains
/bin/touch
1
CommandLinecontains
/tmp/vmware-root_
1
CommandLinecontains
/usr/bin/lsb_release
1
CommandLinecontains
_path=
1
CommandLinecontains
pythonpath=
1
CommandLinewildcard
sh*/run/motd.dynamic.new
1
CurrentDirectorywildcard
/tmp/vmware-root_*/tmpvmware*
1
CurrentDirectorywildcard
/var/opt/ds_agent
1
Detailseq
%SystemRoot%
1
Detailseq
C:\windows
1
EventDatacontains
gc_service.exe
1
EventDatacontains
gc_worker.exe
1
Imageeq
/usr/sbin/unix_chkpwd
1
ParentCommandLineeq
runc init
1
ParentImagecontains
gc_service.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)

Sigma 2 rules

Elastic 5 rules

Kusto 2 rules