Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Penetration testing, first steps

Lab · Medium · 1.5 hoursFree account

Linux Privilege Escalation

Linux privilege escalation: sudo, SUID, cron, PATH hijacking, capabilities, kernel exploits and LinPEAS.

  • privilege-escalation
  • linux
  • suid
  • sudo
  • linpeas
On this page 11 sections
  1. 1System Enumeration
  2. 2Current User Context
  3. Locked: Sudo Rights
  4. Locked: SUID Binaries
  5. Locked: Cron Jobs
  6. Locked: Writable Sensitive Files
  7. Locked: PATH Hijacking
  8. Locked: Linux Capabilities
  9. Locked: Kernel Exploits
  10. Locked: Automate with LinPEAS
  11. Locked: PrivEsc Checklist

Before you start

Privilege escalation turns a shell as a low-privilege user into one as root. Misconfigured sudo entries, unsafe SUID binaries, writable cron scripts, and loose file permissions are the four most common root causes behind Linux server breaches that reach full compromise. The lab walks through each class with GTFOBins and linpeas against a hardened-looking target.

Lab Objectives

  • Enumerate the target system thoroughly before attempting escalation
  • Identify and exploit sudo misconfigurations using GTFOBins
  • Find and abuse SUID/SGID binaries
  • Detect writable cron job scripts and hijack them
  • Exploit weak file permissions on sensitive files
  • Use linpeas to automate privilege escalation enumeration

Step 1: System Enumeration

# OS and kernel version
uname -a
cat /etc/os-release
cat /proc/version

# Hostname and network
hostname
ip a
cat /etc/hosts

# Running processes
ps aux
ps aux | grep root

# Listening services
ss -tulnp
netstat -tulnp

Step 2: Current User Context

# Who are we?
whoami
id
groups

# What can we read?
cat /etc/passwd
cat /etc/shadow   # only if world-readable (misconfiguration!)

# Check home directories
ls -la /home/
ls -la ~/.ssh/

# History files — may contain passwords
cat ~/.bash_history
cat ~/.mysql_history
cat ~/.nano_history

Sign in to continue

9 more sections are for signed-in members. It is free: sign in with Google.

Related