Back to Attack Techniques

Privilege Escalation

Explore the dangers, methods, and defenses against privilege escalation attacks.

What is Privilege Escalation?

Privilege escalation is the act of exploiting a bug, design flaw, or configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user.

Types of Privilege Escalation

  • Vertical privilege escalation: Gaining higher privileges or access rights
  • Horizontal privilege escalation: Accessing resources of another user with similar access level

Impact of Privilege Escalation Attacks

  • Unauthorized access to sensitive data
  • System compromise
  • Installation of malware or backdoors
  • Data theft or manipulation
  • Complete takeover of the system or network

Common Privilege Escalation Attack Methods

  • Exploiting misconfigurations in user permissions
  • Leveraging vulnerable services or applications
  • Using stolen credentials
  • Exploiting kernel vulnerabilities
  • Abusing sudo rights
  • Time-of-check to time-of-use (TOCTOU) attacks
  • Buffer overflow exploits

Preventing Privilege Escalation Attacks

  • Implement the principle of least privilege
  • Regularly update and patch systems
  • Use strong authentication mechanisms
  • Implement proper access controls
  • Monitor and audit user activities
  • Secure configuration of systems and applications
  • Use privilege access management (PAM) solutions
  • Conduct regular security assessments and penetration testing
  • Implement application whitelisting
  • Use security-enhanced operating systems

Real-World Privilege Escalation Incidents

SolarWinds Supply Chain Attack (2020)

Attackers used a supply chain attack to insert malicious code into SolarWinds' Orion software, which then allowed them to perform privilege escalation and move laterally within compromised networks.

Microsoft Exchange Server ProxyLogon Vulnerabilities (2021)

A set of vulnerabilities in Microsoft Exchange Server allowed attackers to perform privilege escalation and take control of affected systems, leading to widespread compromises.

Sudo Baron Samedit Vulnerability (2021)

A vulnerability in the sudo utility (CVE-2021-3156) allowed any local user to gain root privileges on Unix-like operating systems, highlighting the importance of promptly applying security updates.

Privilege Escalation Example (Linux)

Here's an example of how an attacker might attempt to escalate privileges on a Linux system:

# Check for SUID binaries
find / -perm -u=s -type f 2>/dev/null

# Exploit a vulnerable SUID binary (example: pkexec)
pkexec /bin/bash
This example demonstrates:
  • Searching for SUID binaries that might be exploitable
  • Exploiting a vulnerable SUID binary (pkexec) to gain root access

Test Your Knowledge

What is the main goal of privilege escalation?