Lesson 2 of 9 · 27m
Service Permissions, Weak DACLs, and Binary Hijacking
Distinguish service control rights from filesystem rights, validate exploitable combinations, and preserve original configuration during proof.
Service misconfiguration is the bread-and-butter Windows escalation because it sits at a busy intersection: operations teams need services to restart, vendors need updaters to manage them, and nobody wants to read an SDDL string after lunch. The result is a control plane accidentally handed to broad groups. The important mental model is simple: controlling a service and controlling its binary are separate paths to the same execution context.
The service object has its own ACL
Inspect both the functional configuration and the security descriptor:
sc.exe qc VendorAgent
sc.exe sdshow VendorAgentsc qc reveals BINARY_PATH_NAME, SERVICE_START_NAME, start type, and dependencies. sc sdshow returns an SDDL discretionary ACL. You do not need to memorize every SDDL abbreviation, but you do need to recognize dangerous access rights granted to BU (BUILTIN\Users), AU (Authenticated Users), WD (Everyone), or a non-administrative group.
Sysinternals AccessChk makes this easier to scan:
accesschk64.exe -accepteula -uwcqv "Authenticated Users" *The dangerous rights are usually SERVICE_CHANGE_CONFIG, WRITE_DAC, WRITE_OWNER, and broad GENERIC_ALL/GENERIC_WRITE equivalents. SERVICE_START by itself is often useful operationally but not sufficient for escalation.
Filesystem rights are a parallel control plane
Even when the service DACL is perfect, a writable binary or writable parent directory can hand you the same outcome:
icacls "C:\Program Files\Vendor\agent.exe"
icacls "C:\Program Files\Vendor"If the service runs as LocalSystem and a standard user can replace agent.exe, the ACL on the executable is the real authorization failure. Parent directory write access matters because rename-and-replace attacks do not always require writing the original file in place.
Proof is configuration surgery — treat it that way
In an authorized lab, capture original state before modification:
sc.exe qc VendorAgent > VendorAgent-qc-before.txt
sc.exe sdshow VendorAgent > VendorAgent-sddl-before.txt
Copy-Item "C:\Program Files\Vendor\agent.exe" "$env:TEMP\agent.exe.original"A proof should be minimal: replace the target only in a lab, execute a benign marker such as writing a timestamped file, restore the original, and document the exact authority gained. Never leave a persistence-looking payload behind as proof of a point.
Changing configuration requires care
If SERVICE_CHANGE_CONFIG is legitimately in scope, sc.exe uses a famously picky syntax:
sc.exe config VendorAgent binPath= "C:\Windows\Temp\proof.exe"The space after binPath= is required. This detail matters because malformed commands can leave the service unchanged or partially misconfigured. Any sc.exe sdset operation is even riskier: one bad SDDL string can lock administrators out of the service. Backup first, restore after, and prefer filesystem proof when it demonstrates equivalent impact with less operational risk.
Field notes
- A domain service account can be more valuable than
LocalSystemif it has reusable rights elsewhere; inspect group membership before ranking impact. - Restart permission is not guaranteed just because execution would be useful. If you cannot restart the service, exploitation may wait for maintenance or reboot.
- Windows defender, EDR, application control, and protected service security can alter exploitability. Validate the actual execution, not just the ACL.
- Do not report broad group names alone. Report the exact granted rights, the object they apply to, and the resulting execution context.
Was this lesson helpful?