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

# linPEAS (best all-in-one)
./linpeas.sh

# LinEnum (quick recon)
./LinEnum.sh

# Linux Exploit Suggester
./linux-exploit-suggester.sh

Use these when you're stuck or want to double-check your manual recon.

circle-exclamation

Manual Enumeration

Initial Enumeration


Sudo Privileges (GTFOBins)

Check https://gtfobins.github.io/arrow-up-right for payloads tied to your allowed binaries.


SUID Binaries

If you find something like bash, find, cp, or python, 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 on python, perl, or bash, 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