Windows services are background programs that run with specific privileges. Many run as SYSTEM - the highest Windows privilege level. If a service is misconfigured, we can hijack it to run our code as SYSTEM. Service exploitation is one of the most reliable Windows privilege escalation methods.
Think of services like robots in a factory. They do specific jobs, often with master keys (SYSTEM access). If we can reprogram a robot, it will use its master key to do our bidding. The key is finding robots we can modify.
High Success Rate
Service-based attacks are common in both CTFs and real environments. Always enumerate services thoroughly - you'll often find an easy path to SYSTEM.
Listing Services
WMIC for Service Enumeration
Look for LocalSystem
Services running as LocalSystem, NT AUTHORITY\SYSTEM, or LocalService are your targets. Exploiting these = SYSTEM shell.
Service Vulnerability Types
Finding Unquoted Paths
Common Unquoted Paths
Third-party software in C:\Program Files is the most common source of unquoted paths. Default Windows services are typically quoted.
Checking Permissions
Permission Meanings
Service Configuration Permissions
Restart Permissions
Even if you can modify a service, you need restart permissions or must wait for system reboot. Check: accesschk.exe -ucqv ServiceName for SERVICE_START and SERVICE_STOP.
Registry Service Checks
Service Enumeration Methodology
Service Enumeration Flow
1
List Serviceswmic service get name,pathname,startmode
2
Find SYSTEMFilter for services running as LocalSystem
3
Unquoted PathsCheck for spaces without quotes
4
Binary Permsicacls on each service binary
5
Config Permsaccesschk for SERVICE_CHANGE_CONFIG
6
Restart CheckVerify we can restart the service
Knowledge Check
Challenges
Key Takeaways
- Focus on services running as LocalSystem (SYSTEM account)
- Unquoted paths with spaces = potential hijacking
- Check binary permissions with icacls
- SERVICE_CHANGE_CONFIG lets you modify the binary path
- You need restart permission or wait for reboot to trigger exploit
- accesschk.exe is essential for permission enumeration