Skip to main content

Overview

Each Windows service has a registry key under HKLM\SYSTEM\CurrentControlSet\Services\. If you have write access to a service’s registry key, you can change its binary path, add parameters, or modify its configuration to execute arbitrary code as SYSTEM.

Find Writable Service Registry Keys

accesschk

Look for KEY_ALL_ACCESS or KEY_SET_VALUE.

PowerShell


Modify ImagePath

If writable, change the service binary:
Restart service:

Add Admin User via ImagePath


Service DLL

Some services load a DLL specified in the registry:
If ServiceDll key is writable:

AppendData Permission

If you have AppendData but not SetValue:
Limited, but can sometimes be chained with other techniques.

Startup Type

Change service to auto-start:

Other Interesting Registry Locations

Run Keys (Persistence)

If writable:

Winlogon

AutoLogon


Quick Reference