UNQUOTED PATH
SERVICES.EXE
PATH PLANTING
T1574.009
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting Unquoted Service Path Abuse: Inventory, Planting and Execution

Windows resolves an unquoted path with spaces one segment at a time. Plant a file at the right segment and the service control manager runs it as SYSTEM.

Scroll

When a service ImagePath contains spaces and is not wrapped in quotes, the service control manager tries each space-delimited prefix as an executable, so C:\Program Files\Vendor App\svc.exe is tried as C:\Program.exe first. If an attacker can write to an intermediate directory, the planted file runs with the service’s privileges on the next start (T1574.009). The weakness is common, cheap to find and cheap to detect.

Signals at a Glance

SignalWhereATT&CK
Service ImagePath with spaces, no quotes and a non-Windows pathosquery, registry inventoryT1574.009
Executable created at C:\Program.exe or directly under Program FilesSysmon 11, EDR file eventsT1574.009
services.exe starting an image at an intermediate path segmentSysmon 1, 4688T1574.009
Non-admin write access to an intermediate service directoryFile ACL auditT1574.010
Service restart shortly after a file drop at the same pathEvent 7036, Sysmon 11T1574.009

Finding Exposed Services

Start by measuring the exposure. An inventory of services with unquoted, space-containing paths gives you both a remediation list and an allowlist for the runtime detections. The query below overcounts because arguments also contain spaces, so refine the output before raising findings:

-- osquery: services with unquoted paths containing spaces
SELECT name, display_name, path, user_account, start_type
FROM services
WHERE path LIKE '% %'
  AND path NOT LIKE '"%'
  AND path NOT LIKE 'C:\Windows\%'
  AND start_type != 'DISABLED';
-- tune/validate: arguments after the executable produce false positives.

Catching the Planted Binary

Exploitation requires dropping an executable at a very specific path. File creation at the root of Program Files, or at C:\Program.exe, is almost never legitimate, and the later launch by services.exe confirms the abuse:

title: Executable Planted at Unquoted Service Path Segment
logsource:
  product: windows
  category: file_event
detection:
  program_root:
    TargetFilename: 'C:\Program.exe'
  programfiles_root:
    TargetFilename|re: '^C:\\Program Files( \(x86\))?\\[^\\]+\.exe$'
  condition: program_root or programfiles_root
level: high
# tune/validate: installers occasionally drop launchers here; allowlist by signer.
// Microsoft Defender (KQL) - services.exe launching a root-level executable
DeviceProcessEvents
| where InitiatingProcessFileName =~ "services.exe"
| where FolderPath =~ @"C:\Program.exe"
     or FolderPath matches regex @"^C:\\Program Files( \(x86\))?\\[^\\]+\.exe$"
| project Timestamp, DeviceName, FolderPath, SHA256, AccountName
Vetted sources

Use the SigmaHQ file-event and service rules, Elastic’s prebuilt rules for execution from unusual service paths, PowerUp’s service enumeration for the red-team view, and Atomic Red Team T1574.009 for validation. Baseline your own environment — the inventory is the allowlist.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026