How to Detect and Prevent Privilege Escalation on Windows
Security
5 min readNovember 20, 2026

How to Detect and Prevent Privilege Escalation on Windows

Privilege escalation attacks let hackers gain admin-level control over your PC without your knowledge. Learn how to detect the warning signs and lock down your Windows system before attackers exploit it.

Share

What Is Privilege Escalation and Why Should You Care?

Privilege escalation is one of the most dangerous techniques attackers use after gaining an initial foothold on a Windows PC. Instead of breaking in as an administrator, a threat actor starts with a low-privilege account — perhaps through a phishing email or a compromised app — and then quietly elevates their permissions to gain full control of your system.

Once an attacker has admin or SYSTEM-level privileges, they can install malware, disable security tools, steal credentials, and exfiltrate data — all while appearing to be a legitimate user. Understanding how this works, and how to stop it, is essential for anyone serious about Windows security.

Free AI Diagnosis

Having this problem on your own PC?

Describe what's happening and get a real AI diagnosis in seconds — no account needed.

How Privilege Escalation Happens on Windows

Attackers use several well-known techniques to escalate privileges on Windows systems:

Unquoted service paths — Windows services with spaces in their executable path and no quotes can be hijacked by placing a malicious binary in an earlier directory.

Weak folder permissions — If a standard user can write to a folder that a privileged service reads from, they can replace a legitimate file with a malicious one.

Token impersonation — Tools like Juicy Potato or PrintSpoofer abuse Windows token privileges to impersonate SYSTEM-level accounts.

DLL hijacking — Applications that load DLLs from writable directories can be tricked into loading attacker-controlled code.

Scheduled tasks with weak permissions — A task running as SYSTEM but editable by a standard user is a direct escalation path.

UAC bypass techniques — Certain Windows components can be abused to silently bypass User Account Control without triggering a prompt.

Warning Signs Your PC May Be Under Attack

Privilege escalation attacks are designed to be stealthy, but there are red flags you can watch for:

Unexpected admin account creation — Run net localgroup administrators in Command Prompt to list all admin accounts. Any unfamiliar name is a serious warning sign.

New or modified scheduled tasks — Open Task Scheduler (taskschd.msc) and look for tasks you didn't create, especially those running as SYSTEM.

Unusual service installations — Run sc query type= all state= all to list all services. New services with generic names like svc_update or helper32 deserve scrutiny.

Event ID 4672 spikes — This Windows Security event logs "Special privileges assigned to new logon." A sudden spike in Event Viewer can indicate privilege abuse.

Disabled security tools — If Windows Defender or your firewall is suddenly off, an attacker may have escalated and disabled them.

Step-by-Step: Harden Windows Against Privilege Escalation

1. Fix Unquoted Service Paths

Open PowerShell as administrator and run:

Get-WmiObject Win32_Service | Where-Object { $_.PathName -notmatch '"' -and $_.PathName -match ' ' } | Select-Object Name, PathName

Any service listed here has an unquoted path. Contact the software vendor for a fix, or manually add quotes to the path in the registry under HKLM\SYSTEM\CurrentControlSet\Services\<ServiceName>\ImagePath.

2. Audit Folder and File Permissions

Use icacls to check permissions on sensitive directories:

icacls "C:\Program Files\SomeApp"

Standard users (non-admins) should have Read & Execute only — never Write or Full Control on program directories.

3. Review Scheduled Tasks

In PowerShell, list all tasks running as SYSTEM:

Get-ScheduledTask | Where-Object { $_.Principal.UserId -eq 'SYSTEM' } | Select-Object TaskName, TaskPath

Cross-reference each task against what you know is installed. Delete any you cannot identify with:

Unregister-ScheduledTask -TaskName "SuspiciousTask" -Confirm:$false

4. Enable and Review UAC

Make sure UAC is set to Always Notify — the highest setting. Open secpol.msc → Local Policies → Security Options → search for "User Account Control" and review each setting. Never run your daily account as a local administrator.

5. Restrict Token Privileges

For advanced users, use whoami /priv to see your current token privileges. Dangerous privileges like SeImpersonatePrivilege or SeDebugPrivilege should not be assigned to standard service accounts. Review service account privileges in secpol.msc → User Rights Assignment.

6. Monitor Security Event Logs

Enable auditing for privilege use in secpol.msc → Advanced Audit Policy Configuration → Privilege Use. Then monitor Event Viewer for:

Event ID 4672 — Special privileges assigned

Event ID 4673 — Privileged service called

Event ID 4688 — New process created (watch for cmd.exe or powershell.exe spawned by unexpected parents)

Use DiagnoseMyPc to Spot Security Weaknesses Fast

Manually auditing every service, scheduled task, and permission on your PC is time-consuming. DiagnoseMyPc streamlines this process by scanning your Windows system and surfacing configuration issues, suspicious services, and security misconfigurations in a clear, prioritized report.

You can use DiagnoseMyPc in several ways: describe the symptoms you're seeing, paste the output of a PowerShell command, upload a screenshot of an error, or run the optional Windows scan tool for a deeper automated check. The free plan gives you up to 5 analyses per month — more than enough to audit your system regularly.

Keep Privilege Escalation Paths Closed

Privilege escalation is a quiet threat that can turn a minor security lapse into a full system compromise. The good news is that most escalation paths rely on misconfigurations that are entirely preventable:

Run as a standard user for daily tasks — reserve admin accounts for maintenance only

Keep Windows and all software updated — many escalation exploits target known, patched vulnerabilities

Audit permissions regularly — especially after installing new software

Monitor your event logs — automated alerts on Event ID 4672 can catch attacks early

Use DiagnoseMyPc to get a guided security check whenever something feels off

Privilege escalation attacks succeed because most users never look for them. By building these habits into your routine, you make your PC a much harder target — and you'll catch problems before they become disasters.

Found this helpful?

Share it with someone who could use it.

Share

DiagnoseMyPC Team

Expert PC diagnostics and troubleshooting guides to help you keep your Windows system running smoothly.

Get the free Windows Troubleshooting Checklist

Subscribe and instantly download our 50-point Windows troubleshooting checklist — plus practical fixes, performance tips, and security alerts from the DiagnoseMyPC team.

No spam. Unsubscribe anytime.

Frequently Asked Questions

How do I know if my PC has malware?

Common signs include sudden slowdowns, pop-ups, unfamiliar programs, high network or CPU usage when idle, and browser changes you didn't make. An AI diagnosis can flag suspicious activity in your system data — run a free scan at diagnosemypc.com to check.

Is Windows Defender enough to protect my PC?

For most home users, Windows Defender plus safe browsing habits and regular updates is solid protection. The bigger risks are outdated software, weak passwords, and clicking malicious links — good habits matter more than any single tool.

What should I do first if I think I've been hacked?

Disconnect from the internet, change important passwords from a different device, run a full security scan, and check for unfamiliar programs or startup entries. A diagnosis helps confirm what changed on your system so you know exactly what to clean up.

Does this tool make changes to my PC without asking?

No. The analyzer only reads the diagnostic data you choose to share and shows you any recommended fixes first. You stay in complete control of what actually runs on your computer.

Free Diagnostic Tool

Having PC Issues? Let AI Diagnose Them

Get an AI-powered analysis of your Windows PC in under 5 minutes — no technical knowledge required, no account to get started.