Linux Privilege Escalation
Linux Privilege Escalation
If you’ve got a foothold on a Linux target during OSCP-style enumeration, here’s a no-nonsense walkthrough of techniques I use to go from low-priv user to root.
Automated Enumeration Tools
Use these when you're stuck or want to double-check your manual recon.
While automated scans are useful, starting with a manual sweep is often quicker and more efficient.
Manual Enumeration
Initial Enumeration
Sudo Privileges (GTFOBins)
SUID Binaries
If you find something like
bash
,find
,cp
, orpython
, check GTFOBins for how to abuse them. Example:
Writable /etc/passwd
Crontab + Writable Scripts
If a script run by cron is writable:
Password Hunting
Kernel Exploits
Try kernel exploits only if everything else fails.
Environment Variables & User Trails
Capabilities and setcap
If
cap_setuid
is set onpython
,perl
, orbash
, you can likely escalate via GTFOBins method.
âš¡ Bonus: TCPDump Credentials via Loopback
This dumps loopback traffic. Sometimes web creds are sent locally.
Check These Too
Last updated
Was this helpful?