Skip to main content

Unquoted Service Paths

If a service binary path contains spaces and is not quoted, Windows tries each partial path as an executable.

Find Vulnerable Services

Example

Service path: C:\Program Files\My App\service.exe Windows tries in order:

Exploit

Check write permissions on intermediate folders:
If writable, drop payload:

Weak Service Permissions

Find Modifiable Services

Look for SERVICE_CHANGE_CONFIG or SERVICE_ALL_ACCESS.

Modify Service Binary Path

Modify to Add Admin User

Modifiable Service Binary

If the .exe itself is writable:
Replace with payload:

DLL Hijacking

Service loads a DLL that doesn’t exist or is loaded from a writable directory.

Find Missing DLLs

Use Process Monitor (procmon) with filters:

Check DLL Search Order

Windows searches in order:

Check PATH for Writable Directories

Create Malicious DLL

Minimal C DLL:
Compile on Kali:
Drop DLL in writable path and restart service.