Security operations

Privilege Escalation Prevention: Stop Attackers Climbing Higher

A small foothold becomes full control when an attacker escalates privileges. Here are the techniques they use and the controls that close each path.

Cysoro Security TeamPublished · 9 min read
Standard userLocal adminSYSTEM / root SECURITY OPERATIONS Privilegeescalation Stop the climb before it starts.
Quick answer

Prevent privilege escalation by enforcing least privilege, removing standing local administrator rights, patching escalation flaws quickly, hardening sudo and User Account Control, protecting privileged credentials with MFA and just-in-time access, and reviewing who can change roles and policies. No single control stops every technique, so the controls must work as layers.

Key takeaways

  • Least privilege is the strongest control: an attacker who lands on a low-rights account has far less to escalate to.
  • Many escalations need no vulnerability at all — a stolen admin credential, an over-broad cloud role or a writable service is enough.
  • Patch escalation flaws fast, audit service and sudo permissions, and treat the right to change roles as an administrator right.

Most attackers do not start with full control. They start with a low-privilege foothold — a phished user, a vulnerable web app, a stolen password — and then climb. Privilege escalation is that climb, and stopping it is what keeps a small incident from becoming a takeover.

What is privilege escalation?

Privilege escalation is the act of gaining higher permissions than you were given, moving from a limited user toward administrator, root, SYSTEM or domain-wide control. It is the step that turns a foothold into the ability to disable security tools, clear logs, install persistence and reach data across the host.

MITRE ATT&CK, the framework security teams use to classify attacker behavior, catalogs it as its own tactic, Privilege Escalation (TA0004), defined as the techniques adversaries use to gain higher-level permissions. MITRE notes that attackers may enter with basic user privileges, but they usually need administrator or system-level access to accomplish their objectives.

There are two directions. Vertical escalation raises an account to higher rights on the same system, such as a standard user becoming a local administrator. Horizontal escalation keeps the same privilege level but reaches another user's resources; on its own that is really an access-control failure, and it overlaps with broken access control in web applications.

CyberDefenders explains vertical and horizontal escalation with the MITRE ATT&CK techniques behind each route.

Why does privilege escalation matter so much?

Low-privilege footholds are easy to obtain but limited. A standard user can usually read their own files and run their own programs, but cannot install a driver, change a service, read another user's data or turn off the endpoint agent.

Higher rights remove those limits. With administrator or root access, an attacker can disable defenses, create a new privileged account for persistence, dump credentials from memory, move to other hosts, and reach the data that makes a breach costly. That is why escalation sits early in most intrusions, just after initial access.

It also matters because the fix is structural. Patching one flaw helps, but if accounts hold excess rights and services run as SYSTEM, the next flaw or stolen credential will do the same job. Prevention means shrinking both the starting point and the paths upward.

What are the most common privilege escalation techniques?

Attackers escalate through three broad routes: exploiting vulnerabilities, abusing legitimate features and misconfigurations, and using stolen credentials. Each maps to a MITRE ATT&CK technique.

TechniqueATT&CKWhat the attacker does
Exploitation for privilege escalationT1068Exploits an OS or software flaw to run code at a higher level
Abuse elevation controlT1548Bypasses UAC or abuses sudo and setuid programs
Valid accountsT1078Logs in with stolen or default credentials for a higher account
Access token manipulationT1134Steals or impersonates another process's access token
Account manipulationT1098Changes accounts or permission groups to keep or raise access
Domain policy modificationT1484Changes domain or tenant policy to escalate centrally
Escape to hostT1611Breaks out of a container to the host

Exploiting a vulnerability is the classic route: an unpatched kernel or driver flaw, or a vulnerable application running with high privilege, lets the attacker execute code as SYSTEM or root. Using stolen credentials sidesteps the technical problem entirely — if the attacker can steal or guess the credentials of a privileged account, through credential dumping, password reuse or kerberoasting, they simply log in with rights they should not have.

Misconfiguration is often the largest class: over-permissive file and service permissions, writable directories in the executable search path, unquoted service paths, and scheduled tasks that run as a privileged account but can be modified by others. Each one is a legitimate feature used in a way its owner did not intend.

Three routes to higher privilegesExploit a flawKernel, driver or appvulnerability — T1068Fix: patch fastAbuse a featuresudo, setuid, UAC,services — T1548Fix: harden configUse a credentialStolen admin login— T1078Fix: MFA, JIT access
Privilege escalation has three main routes — and each needs a different fix. Illustration by Cysoro.

How does least privilege prevent privilege escalation?

Least privilege means giving each user, service and program only the rights its job needs, and no more. The NIST glossary defines it as restricting access privileges to the minimum necessary to accomplish assigned tasks, and NIST SP 800-53 control AC-6 makes it a formal control.

It works in two ways. First, it lowers the starting point: an attacker who lands on a user account that is not a local administrator has a much harder climb. Second, it removes the paths: without rights to edit policies, create privileged pods or change service permissions, many known escalation techniques simply do not exist for that account.

Apply it everywhere, not just to people. Run services as dedicated low-privilege accounts, give cloud roles only the permissions they need, scope Kubernetes roles to a namespace, and raise privileges as late as possible and drop them afterwards. Software that runs with unnecessary privileges is itself a weakness, described in CWE-250.

Obseria's guide to preventing privilege escalation lists the same least-privilege, patching and just-in-time controls.

Least privilege also limits what a phished account can do. Our guide to what spear phishing is shows how attackers win that first foothold.

How do I prevent privilege escalation on Windows?

Start by removing users from the local Administrators group. Most office work does not need local admin rights, and removing them is the single most effective Windows control. Use a privilege management tool for the few tasks that do need elevation, so users can run an approved installer without holding admin rights all day.

Enforce User Account Control and do not let users disable it. Audit service permissions, unquoted service paths and scheduled tasks that run as SYSTEM or as a service account. A scheduled task that a standard user can modify, but that runs as a privileged account, is a direct escalation path.

Protect privileged accounts with phishing-resistant MFA, separate admin accounts from daily-use accounts, and use just-in-time access so admin rights exist only for the task and the time window that needs them. Patch promptly, and check CISA's Known Exploited Vulnerabilities list for escalation flaws that are already being used.

How do I prevent privilege escalation on Linux?

Keep sudo rules minimal and explicit. Give each person or service only the commands they need, require a password for sudo, and keep tty_tickets enabled so a sudo grant does not carry across terminals. Setting the sudo timestamp timeout to zero, so the password is requested each time, is the strictest option for sensitive hosts.

Audit setuid and setgid programs and keep the list short. Avoid the setuid bit on programs with shell-escape features, because an attacker who can run a shell from such a program inherits its privileges. Run services as dedicated low-privilege users, and use capabilities, SELinux or AppArmor to limit what a compromised service can do.

Patch kernel, sudo and system-service flaws quickly. Local privilege escalation flaws in the kernel and in sudo are valuable to attackers once they have a foothold, and they are often fixed by a patch that is already available. Harden containers too: run them as non-root, set allowPrivilegeEscalation: false, drop unneeded Linux capabilities, and enforce Pod Security Standards.

How do I prevent privilege escalation in the cloud?

In the cloud, escalation is usually an identity problem. The permission to attach a policy, edit a role or change a binding is itself a privileged permission, so treat it as an administrator right and restrict it to a small group with MFA and approval.

Scope every role to the resources and actions it needs, and review effective permissions regularly — not just the roles you assigned, but what those roles can actually do through inherited policies and group membership. Remove unused roles and standing administrator access, and replace them with just-in-time elevation that expires.

Enforce authorization on the server for every request, and check object ownership each time. Never rely on IDs being hard to guess to stop horizontal escalation in a web application. Log role and policy changes, and alert on them the same day, because a quiet policy change is often the first step in a cloud escalation.

AreaWhat to doWhy it stops escalation
AccountsLeast privilege, no standing adminLess to steal, less to climb to
PatchingPatch kernel, sudo and drivers fastCloses the exploit route (T1068)
Elevation toolsHarden sudo, UAC and setuidCloses the abuse route (T1548)
CredentialsMFA, JIT access, separate admin accountsCloses the valid-account route (T1078)
Cloud rolesScope roles, guard policy-change rightsStops role and policy escalation

How do I detect privilege escalation attempts?

Detection starts with the events that should be rare. A new local administrator, a change to a privileged group, a sudo command that runs with an effective user ID of 0, a process that suddenly runs as SYSTEM or root, and a cloud role or policy change are all worth an alert, not just a log line.

Correlate those events with context. A sudo execution by an expected administrator during working hours is normal; the same event from a web server account at 3 a.m. is not. ATT&CK's detection guidance for sudo abuse, for example, correlates sudo executions with an elevated effective user ID, which is a practical rule to build.

Keep the logs that make detection possible. If an attacker can clear the local log after escalating, you lose the evidence. Forward security logs to a central store that the escalated account cannot modify, and review the privileged-group and role-change alerts daily.

Privilege escalation prevention checklist☐ Remove standing local admin rights☐ Enforce least privilege for users, services and cloud roles☐ Patch kernel, sudo and driver flaws promptly☐ Harden sudo, UAC and setuid; audit service permissions☐ Use MFA and just-in-time access for admin tasks☐ Alert on group, role and policy changes — and review daily
Six controls that close most privilege escalation paths. Illustration by Cysoro.

What mistakes make privilege escalation easy?

The most common mistake is giving everyone local admin rights because it is easier than managing elevation properly. That one decision hands every phished user, every vulnerable application and every stolen password a direct path to full control.

Another mistake is treating cloud roles as harmless. A role that can attach policies, create users or modify a service is an administrator role, even if its name says otherwise. Review effective permissions, not just role names.

Teams also forget service accounts. A service that runs as SYSTEM or root, with a password that never changes and is shared in a document, is a privileged account with no owner. Give each service its own low-privilege account, a strong credential, and a named owner.

Finally, do not rely on application allow-listing alone. It constrains what a foothold can run, which helps, but it does not fix excess rights or unpatched flaws. Use it as a layer, alongside least privilege, patching and monitoring. For a wider review of access controls, start with our small business cybersecurity checklist.

Check who can change rolesThe right to edit a role or attach a policy is an administrator right. If a low-privilege account holds it, that account is already privileged — review it before an attacker does.

The bottom line

Privilege escalation is not one trick to block, but a set of paths that all lead upward. Close them with least privilege, fast patching, hardened elevation tools, protected credentials and just-in-time access, and watch the events that should be rare.

Start this week: list who holds local admin rights, audit your sudo and service permissions, and remove the standing rights nobody needs. That one review will close more escalation paths than any single product. If you want to automate the detection and response side, read our guide to how to automate security incident response.

Frequently asked questions

What is privilege escalation?

Privilege escalation is when an attacker gains more permissions than they were given, usually moving from a standard user to a local administrator, root, SYSTEM or domain-wide control. It turns a small foothold into full control of a system or network.

What is the difference between vertical and horizontal escalation?

Vertical escalation raises an account to higher rights, such as a standard user becoming a local administrator. Horizontal escalation keeps the same level but reaches another user's resources, which is usually an access-control failure.

What is MITRE ATT&CK TA0004?

TA0004 is the Privilege Escalation tactic in MITRE ATT&CK, the catalogue of attacker behavior. It groups techniques such as exploitation for privilege escalation, abuse of elevation controls, and use of valid accounts.

Does least privilege really prevent privilege escalation?

It is the strongest structural defense. If every account holds only the rights its job needs, a compromised account offers less to abuse, and many known escalation paths simply do not exist.

Can privilege escalation happen without a vulnerability?

Yes. A stolen administrator credential, an over-broad cloud role, a writable service or a misconfigured sudo rule needs no software flaw. That is why escalation is an identity and configuration problem, not only a patching problem.

How do I stop privilege escalation on Windows?

Remove users from the local Administrators group, enforce User Account Control, patch promptly, audit service permissions and scheduled tasks, and protect privileged accounts with MFA and just-in-time access.

How do I stop privilege escalation on Linux?

Keep sudo rules minimal, require a password for sudo, avoid setuid programs with shell escapes, patch kernel and sudo flaws quickly, and run services as dedicated low-privilege accounts.

How do I detect privilege escalation?

Watch for new local administrators, changes to privileged groups, sudo use with an effective user ID of 0, unexpected processes running as SYSTEM or root, and cloud role or policy changes. Alert on those events and review them daily.

Sources

  1. CyberDefenders — What Is Privilege Escalation?
  2. Obseria — Privilege Escalation: Types, Examples and Detection
  3. Atlas — Privilege escalation
  4. Sazabi — What Is Privilege Escalation?
  5. 00->1 — Privilege Escalation, Explained
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against MITRE ATT&CK tactic TA0004 and its techniques, NIST SP 800-53 control AC-6 on least privilege, and the sources listed.

How we write and fact-check →

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free