T1574.009

Path Interception by Unquoted Path

Adversaries exploit unquoted service executable paths that contain spaces. When a service path like C:\Program Files\My Service\service.exe is not quoted, Windows parses it by trying C:\Program.exe, then C:\Program Files\My.exe, then C:\Program Files\My Service\service.exe. An adversary with write access to C:\ or C:\Program Files\ can plant Program.exe or Program Files\My.exe to intercept service startup. This technique achieves privilege escalation because services typically run as SYSTEM. PowerSploit (Get-ServiceUnquoted), Empire, and winPEAS all include unquoted path discovery. It is particularly prevalent in third-party software installations that fail to properly quote service paths.

Microsoft Sentinel / Defender
kusto
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"
| where RegistryValueName in~ ("ImagePath", "BinPath")
| where RegistryValueData has " "
| where not(RegistryValueData startswith '"')
| where not(RegistryValueData startswith "C:\\Windows")
| where RegistryValueData matches regex @'^[A-Z]:\\(?!")'  
| extend ServicePath = RegistryValueData
| extend HasSpace = ServicePath has " "
| extend IsQuoted = ServicePath startswith '"'
| where HasSpace and not(IsQuoted)
| project Timestamp, DeviceName, AccountName, RegistryKey,
         ServicePath, InitiatingProcessFileName
| sort by Timestamp desc
medium severity low confidence

Data Sources

Windows Registry: Registry Key Modification Process: Process Creation Microsoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

False Positives

  • Many third-party software installations legitimately create services with unquoted paths containing spaces — this is a widespread misconfiguration rather than always malicious
  • Some legacy applications installed before secure coding practices were common have unquoted paths
  • Enterprise software that has not been updated to fix this misconfiguration
  • Software deployers that don't validate path quoting during installation

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections