T1574.008 Splunk · SPL

Detect Path Interception by Search Order Hijacking in Splunk

Adversaries may execute their own malicious payloads by hijacking the search order Windows uses to find programs called without a full path. When an executable calls a program by name only (e.g., 'net user' rather than 'C:\Windows\System32\net.exe user'), Windows first searches the current directory of the calling program, then the directories in PATH. An adversary who places a binary named 'net.exe' or 'net.com' (PATHEXT ordering: .COM before .EXE) in the same directory as the calling application will have their binary executed. Empire and PowerSploit both include modules to discover and exploit search order hijacking vulnerabilities across the system.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation Defense Evasion
Technique
T1574 Hijack Execution Flow
Sub-technique
T1574.008 Path Interception by Search Order Hijacking
Canonical reference
https://attack.mitre.org/techniques/T1574/008/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval BinaryName=lower(mvindex(split(Image, "\\"), -1))
| eval IsSystemBinary=if(
    BinaryName in ("net.exe", "cmd.exe", "powershell.exe", "ping.exe", "ipconfig.exe",
                   "whoami.exe", "hostname.exe", "nltest.exe", "tasklist.exe",
                   "sc.exe", "reg.exe", "certutil.exe", "net1.exe"),
    1, 0)
| eval IsSystemPath=if(
    match(lower(Image), "(c:\\\\windows\\\\system32|c:\\\\windows\\\\syswow64|c:\\\\windows\\\\winsxs)"),
    1, 0)
| where IsSystemBinary=1 AND IsSystemPath=0
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, CurrentDirectory
| sort - _time
high severity high confidence

Detects system utility names executing from non-system directories using Sysmon Event ID 1. The key signals are: binary filename matching a known system utility, but the full path (Image) does not contain System32 or SysWOW64. The CurrentDirectory field can indicate where the search order placed the calling application.

Data Sources

Process: Process CreationSysmon Event ID 1

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Portable tools with system utility names carried on USB drives or network shares
  • WSL (Windows Subsystem for Linux) components with similar names to Windows utilities
  • Development tools that provide their own versions of system utilities (e.g., Git for Windows includes cmd.exe wrappers)
  • Some application installers that temporarily rename binaries during installation
Download portable Sigma rule (.yml)

Other platforms for T1574.008


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Create Fake Net.exe in Application Directory

    Expected signal: Sysmon Event ID 11 (FileCreate): net.exe created in TEMP subdirectory. If subsequently executed: Sysmon Event ID 1 showing net.exe running from %TEMP%\vulnerable-app rather than System32.

  2. Test 2Search Order Hijacking via .COM Extension (PATHEXT)

    Expected signal: Process creation events showing test.com executed instead of test.exe when called by name only. The CurrentDirectory in the process creation event shows the TEMP directory.

  3. Test 3PowerSploit Find-PathDLLHijack Discovery

    Expected signal: Sysmon Event ID 1: powershell.exe with PATH enumeration command. Sysmon Event ID 11: temporary test files created and deleted in writable PATH directories. PowerShell ScriptBlock Log Event ID 4104 with the enumeration script.

Unlock Pro Content

Get the full detection package for T1574.008 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections