Course contentsShow
← Security
Lesson 2131 of 3,05242. Penetration Testing and Red TeamingFree lesson

Service Exploitation for Privilege Escalation

Exploiting misconfigured services through unquoted service paths, weak permissions, and insecure service configurations to gain SYSTEM privileges.

Service Exploitation for Privilege Escalation

What you'll learn: How to exploit poorly configured Windows services to escalate from a low-privileged user to SYSTEM-level access.

The Core Idea

Windows services often run with elevated privileges (like SYSTEM), and misconfigurations in how they're set up can allow attackers to replace or manipulate the service executable. When the service restarts, your malicious code runs with those elevated privileges instead.

Think of it like finding a valet parking service that runs with master keys to every car. If you can swap out the valet's car (the service executable) with your own, you inherit those master keys when the service "starts work."

Common Exploitation Vectors

Unquoted Service Paths

When a service path contains spaces but lacks quotes (e.g., C:\Program Files\My App\service.exe), Windows searches for executables in ambiguous locations first. An attacker can place a malicious executable at C:\Program.exe or C:\Program Files\My.exe, which Windows will run as SYSTEM when the service starts.

Weak File Permissions

If the service executable or its directory has weak permissions (writable by regular users), you can replace the legitimate executable with your own. Check permissions with icacls or similar tools from your earlier reconnaissance.

Insecure Service Configuration

Services configured with weak SERVICE_CHANGE_CONFIG permissions allow users to modify the service's binary path. An attacker can reconfigure the service to point to their malicious executable using sc config.

Key Takeaway: Service misconfigurations—unquoted paths, weak file permissions, and modifiable service settings—are powerful privilege escalation vectors because services frequently run as SYSTEM, turning minor oversights into complete system compromise.