Linux Privilege Escalation

Overview

This room focuses on the first phase of Linux privilege escalation: enumeration. It explains why privilege escalation matters after initial access, what information to gather from a Linux target, which commands are most useful, and how kernel exploits fit into the escalation decision process.

Core idea: most Linux privilege escalation wins come from disciplined enumeration, not magic. You need to understand the host, the users, the services, the permissions, and only then choose the right escalation path.

1) What Privilege Escalation Means

Privilege escalation is the process of moving from a lower-privileged account to a higher-privileged one by abusing a vulnerability, design flaw, or configuration weakness.

In practice, this is important because it enables actions such as:

2) Enumeration First

The room emphasizes that enumeration is just as important after compromise as it is before initial access.

3) Core Host Information Commands

Several commands give you immediate context about the Linux target:

Practical use: kernel version and distro details are especially important when assessing whether local kernel exploits are even worth considering.

4) Process, Environment, and Identity

The room calls out several commands that help you understand your current position on the host:

These are often enough to expose sudo abuse, PATH abuse, interesting services, or extra group privileges.

5) Users, Files, and Command History

User and filesystem enumeration is a major part of Linux privilege escalation.

The room also highlights that filtering /etc/passwd output for home directories can help separate real users from service accounts.

6) Network Enumeration After Compromise

A compromised Linux host may also be a pivot point, so local network visibility matters.

Why this matters: a low-priv shell on one host may be your route into internal services you could not previously reach.

7) Using Find for Priv-Esc Discovery

find is one of the most useful Linux privilege escalation commands because it helps surface writable paths, unusual permissions, and development tooling.

Using 2>/dev/null keeps the output readable by suppressing permission errors.

8) Automated Enumeration Tools

The room mentions several popular automation helpers:

Important limit: these tools save time, but they can miss paths. They should support manual enumeration, not replace it.

9) Kernel Exploits

Kernel exploits are one possible privilege escalation path, but they come with real risk.

  1. Identify the kernel version.
  2. Research whether a relevant exploit exists.
  3. Assess the reliability and risk.
  4. Only run it if it is acceptable within the engagement scope.

A failed kernel exploit can crash the target, so this should never be the first escalation technique you jump to without justification.

Exam Notes (PT1)