Windows Privilege Escalation: The Misconfigurations That Get Exploited

An attacker who lands on a Windows host almost never arrives as an administrator. Privilege escalation is how they get there, and the overwhelming majority of real escalations exploit configuration rather than a kernel vulnerability. That is good news for defenders, because configuration is auditable.

Service misconfigurations

Unquoted service paths. A service whose executable path contains spaces and is not enclosed in quotes causes Windows to try each space-delimited prefix in turn, appending .exe. A path such as C:\Program Files\My App\service.exe makes Windows try C:\Program.exe first. If a low-privileged user can write to one of those locations, they place a file there and it runs with the service's privileges at next start.

Weak service permissions. If a standard user can modify a service's configuration, they can point its binary path at anything and restart it. The service runs as SYSTEM, so the escalation is immediate and requires no exploit at all.

Weak file and folder permissions. Same idea one level down: if the service executable or its directory is writable by a standard user, replacing the binary works. Applications installed outside Program Files with permissive ACLs are the usual offenders, and they are common in line-of-business software.

DLL hijacking. A program loading a library by name searches a defined order of locations. A writable directory earlier in that order lets an attacker supply their own library, which loads into the privileged process.

Credentials left lying around

Frequently the fastest route, and it involves no exploitation whatsoever.

Unattended installation files, scripts and configuration files containing passwords in plain text. Credentials stored in the registry, notably the AlwaysInstallElevated pair of keys which, when both are set, allow any user to install a package as SYSTEM. Saved credentials in the credential manager. Passwords in scheduled task definitions and in the command lines of running processes, which any user can read. History files in shells and connection managers.

Once obtained, a credential may work far beyond that host — and on older configurations the password hash alone is sufficient without cracking, as described under NTLM pass-the-hash.

Tokens and privileges

Windows attaches privileges to accounts, and several of them are equivalent to administrator even on an otherwise unprivileged account. Privileges permitting a process to impersonate a client, act as part of the operating system, load drivers, back up or restore arbitrary files, or debug other processes all provide a route to SYSTEM.

Service accounts frequently hold impersonation privileges legitimately, which is why a compromised web application running as a service account is often one step from SYSTEM. Auditing which accounts hold which privileges is a worthwhile exercise and rarely done — and it belongs with the wider service account hygiene covered under service account security.

Patching still matters

Kernel and driver vulnerabilities provide escalation, and vulnerable signed drivers are a recurring problem because a legitimately signed driver with a flaw can be loaded deliberately by an attacker to reach kernel memory. Driver blocklisting exists for this.

Missing patches are the easiest thing for an attacker to enumerate and the easiest for a defender to fix, so they should not be the finding — and yet they are, routinely.

Finding and fixing it

Audit rather than wait. Enumerate services for unquoted paths and for weak configuration and file permissions. Check for the AlwaysInstallElevated registry keys. Search shares and local disks for files containing credentials — unattended installation files and scripts are the standard hiding places. Review which accounts hold sensitive privileges.

Then fix systematically: quote service paths, correct permissions so only administrators can modify service binaries and configuration, install applications in protected locations, remove stored credentials in favour of managed accounts, and patch.

Two structural controls matter more than any individual fix. Unique local administrator passwords per machine mean escalation on one host yields nothing elsewhere. Administrative tiering means privileged credentials are never present on a workstation to be stolen — the model under privileged access management. Application allowlisting also removes most of the tooling used to enumerate and exploit in the first place.

Detection is realistic here too. Service configuration changes, new service creation, unusual parent-child process relationships and access to credential stores are all logged if auditing is enabled, and alerting on them in your SIEM catches the enumeration as well as the exploitation.

Exam angles

Know unquoted service paths, weak service and file permissions, DLL hijacking, AlwaysInstallElevated and stored credentials as the standard Windows privilege escalation routes, and that most are configuration rather than software flaws. Recognize sensitive privileges such as impersonation as administrator-equivalent. Name unique local administrator passwords, least privilege on service configuration, and administrative tiering as the structural controls.

Comments