Skip to content
Misconfiguration Write-up Beginner

**Walking Along the PATHS of the Administrator**

A Windows service was installed with an unquoted executable path containing spaces, so Windows would try to run executables from parent directories first. An attacker with local user access could place a malicious executable in a writable parent directory and gain SYSTEM privileges when the service starts.

Shahrukh Iqbal Mirza Follow

Published on systemweakness.com

In this blog, we’ll discuss how service paths can be abused to escalate privileges in Windows systems. As usual, we’ll look at the theoretical aspects of this abuse, and then we’ll have a practical walkthrough of the abuse.

Shahrukh Iqbal Mirza, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the service executable path was not enclosed in quotes, so the Windows CreateProcess function interpreted the space-separated path ambiguously and searched parent directories first.

Impact

An attacker with local user access could escalate to SYSTEM privileges if a writable parent directory exists and the service restarts.

What the attacker needed

Local user access on Windows; unquoted service path with spaces; writable parent directory; service runs as SYSTEM or Administrator

The fix

The service executable path should be enclosed in quotes, and write access to system directories should be restricted.

How it was found

  1. Create a service with an unquoted executable path containing spaces.
  2. Create the directories referenced in the path and grant write access to a low-privileged user.
  3. Enumerate running services and identify one with an unquoted path.
  4. Check the service account and verify write access to a parent directory.
  5. Generate a malicious executable and place it in the writable directory.
  6. Restart the service or reboot the system to trigger execution and obtain elevated privileges.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When Windows starts a service, it reads the path to the program. If that path has spaces and is not wrapped in quotes, Windows may try to run a program from a folder higher up first. If a normal user can write to that folder, they can put their own program there and it will run with the service's high privileges.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.