Path Interception by Search Order Hijacking
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.
let SystemBinaryNames = dynamic([
"net.exe", "cmd.exe", "powershell.exe", "ping.exe",
"ipconfig.exe", "whoami.exe", "hostname.exe", "nltest.exe",
"tasklist.exe", "sc.exe", "reg.exe", "certutil.exe"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (SystemBinaryNames)
| where not(FolderPath startswith "C:\\Windows\\system32")
| where not(FolderPath startswith "C:\\Windows\\SysWOW64")
| where not(FolderPath startswith "C:\\Windows\\WinSxS")
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessFolderPath
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Portable versions of system utilities carried by administrators for incident response (e.g., SysInternals tools that include cmd.exe wrappers)
- Some virtualization or containerization tools that include renamed system binaries
- Development environments that wrap system utilities (e.g., WSL has its own copies of some utilities)
- Security testing tools that deliberately rename system binaries for testing purposes
References (4)
- https://attack.mitre.org/techniques/T1574/008/
- https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa
- https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1574.008/T1574.008.md
Unlock Pro Content
Get the full detection package for T1574.008 including response playbook, investigation guide, and atomic red team tests.