Skip to main content

Linux Privilege Escalation: Enumeration and Exploitation

This guide explains the process of Linux privilege escalation, covering enumeration techniques to gather system information and exploitation methods to gain higher privileges, including SUID binaries, weak permissions, and kernel exploits.

Save this reading to your study set

Sign up free

In the lifecycle of a penetration test, gaining initial access is often just the beginning. Frequently, the account you compromise is a low-privileged user with limited visibility and restricted permissions. To truly control a system—to dump memory, sniff network traffic, or access sensitive user directories—you must escalate your privileges to the highest level, typically the root user.

This process is divided into two distinct phases: Enumeration, where you gather intelligence about the environment, and Exploitation, where you leverage that intelligence to bypass security controls.

The Foundation: Linux Privilege Escalation Enumeration

Enumeration is the most critical step in the escalation process. As the saying goes, "Finding a vulnerability takes the most time and effort; exploitation is easy!". Before running any exploits that might crash the system, you must understand exactly what you are looking at.

The first step is to establish your identity and the system's context. Use commands like whoami and id to see your current user and group memberships, and uname -a to identify the operating system and kernel version.

System Environment and Configuration

Beyond identity, you must examine the environment variables and system configurations. Environment variables (viewable via env) can sometimes contain sensitive paths or configuration data. Furthermore, checking network configuration settings is vital for understanding how the machine communicates with the rest of the network.

You should also investigate:

  • Scheduled Jobs: Check crontab files to see if any tasks are running as root that you can manipulate.
  • Network Interfaces: Use ifconfig -a or cat /etc/network/interfaces to map the local network landscape.
  • User Activity: Examine ~/.bash_history to see what previous users were doing; they may have left credentials or interesting directory paths in their command history.

Keep reading for free.

Create an account to finish this reading and make it part of your study routine.

Continue reading free

Already have an account? Log in

Updated

Study it your way.

Import this reading into your study set to get started with another study mode.

Make it your own.

Keep this reading in a new study set, or add it to one you already use.