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.
On this page 11 sections
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 -tulnpStep 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_historySign in to continue
9 more sections are for signed-in members. It is free: sign in with Google.