Skip to main content

Overview

Linux is the dominant operating system in server environments, cloud infrastructure, and embedded systems. Understanding its internals is essential for both offensive security and hardening. This page covers the foundational concepts needed before diving into privilege escalation techniques.
This content is intended for authorized penetration testing, CTF competitions, and security research only. Always obtain proper written authorization before testing any system.

Privilege Escalation Checklist

The best automated tool for Linux local privilege escalation enumeration is LinPEAS.

System Information

1

Gather OS Information

Identify the operating system, kernel version, and architecture.
2

Check PATH and Environment

Look for writable folders in PATH and sensitive data in environment variables.
3

Search for Kernel Exploits

Check kernel version against known vulnerabilities like DirtyCow.
4

Check Sudo Version

Determine if the sudo version is vulnerable to known CVEs.
5

Enumerate Defenses

Identify security mechanisms in place: AppArmor, SELinux, ASLR, etc.

Key Checklist Areas

  • List mounted and unmounted drives
  • Check /etc/fstab for credentials
  • Look for writable mount points
  • Check for useful and vulnerable software
  • Monitor running processes for privilege misconfigurations
  • Look for writable cron scripts or PATH abuse
  • Check for wildcard injection opportunities
  • Check for writable .service files
  • Look for writable binaries executed by services
  • Enumerate systemd timers
  • Identify writable Unix domain sockets
  • Check for exploitable D-Bus services
  • Map the network position and open ports
  • Check for sniffable traffic
  • Enumerate all users, groups, and superusers
  • Check clipboard and password policy
  • Review sudo permissions with GTFOBins
  • Find exploitable SUID binaries
  • Check for unexpected Linux capabilities
  • Look for unusual ACLs on files
  • Review SSH configuration and keys
  • Search profile files, shadow, and backup files

Linux Security Mechanisms

AppArmor

Mandatory access control system that restricts program capabilities using per-program profiles.

SELinux

Security-Enhanced Linux provides fine-grained mandatory access control policies for processes and files.

ASLR

Address Space Layout Randomization randomizes memory addresses to mitigate memory exploitation.

Capabilities

Linux capabilities split root privileges into distinct units that can be independently granted.

CVE-2016-5195 (DirtyCow)

A classic kernel privilege escalation vulnerability affecting Linux kernels up to 3.19.0-73.8.

References