VeriKQL by Kaushik Saha

T1574.007 Path Interception by PATH Environment Variable

ExecutionStealthon attack.mitre.org

ATT&CK Enterprise 20.0 · 20.1 released, update in review

How MITRE detects it

DET0004 Detection Strategy for Hijack Execution Flow using Path Interception by PATH Environment Variable.

AN0009 Windows

Abnormal modification of the PATH environment variable or registry keys controlling system paths, combined with execution of binaries named after legitimate system tools from user-writable directories. Defender correlates registry modifications, file creation of suspicious binaries, and process execution paths inconsistent with baseline system directories.

MITRE log sourceIn Microsoft Sentinel
WinEventLog:SecurityEventCode=4657
  • Windows Security Events via AMA → SecurityEvent
    SecurityEvent | where EventID in (4657)
  • Security Events via Legacy Agent → SecurityEvent
    SecurityEvent | where EventID in (4657)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel == "Security" | where EventID in (4657)

The same events land in SecurityEvent (Windows Security Events connectors) or WindowsEvent (Windows Event Forwarding); many built-in rules read SecurityEvent only.

WinEventLog:SysmonEventCode=11
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (11)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (11)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

WinEventLog:SysmonEventCode=1
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (1)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (1)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

AN0010 Linux

User modification of the $PATH environment variable in shell configuration files or direct runtime PATH changes, followed by execution of binaries from user-controlled directories. Defender observes file edits to ~/.bashrc, ~/.profile, or /etc/paths.d and process execution resolving to unexpected binary locations.

MITRE log sourceIn Microsoft Sentinel
auditd:SYSCALLopen/write calls modifying ~/.bashrc, ~/.profile, or /etc/paths.dNot mapped to Sentinel yet.
linux:osqueryExecution of binary resolved from $PATH not located in /usr/bin or /binNot mapped to Sentinel yet.

AN0011 macOS

Modification of PATH or HOME environment variables through shell config files, launchctl, or /etc/paths.d entries, combined with process execution from attacker-controlled directories. Defender correlates file changes in /etc/paths.d with process execution resolving to malicious binaries.

MITRE log sourceIn Microsoft Sentinel
macos:unifiedlogFile modification in /etc/paths.d or user shell rc filesNot mapped to Sentinel yet.
macos:unifiedlogProcess execution path inconsistent with baseline PATH directoriesNot mapped to Sentinel yet.

Content Hub rules tagged with it (1)

Rules tagged with this technique (or a sub-technique) in their metadata. Whether one fits your connectors is the coverage view (M2).

How the Content Hub rules for T1574.007 are built: their tables, filters, joins, schedules and windows.

In Sigma rules

2 SigmaHQ community rules name it in their tags.

Community rules, not Microsoft's, and not checked by VeriKQL (Sigma is not KQL). From SigmaHQ/sigma at f083329, under the Detection Rule License (DRL) 1.1; each rule is credited to its author.

Mitigations

MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.