Labs / Linux Exploitation
Road 29 of 33
Linux Exploitation
From a foothold to full control of a Linux box: manage a shell with an exploit framework, corrupt memory to reach code and read secrets, then enumerate and abuse sudo, setuid and PATH to become root.
Start this roadFrameworks & memory corruption
Manage a foothold, then corrupt memory for code and secrets.
- 01 From a raw foothold to a managed C2 session Stand up a listener, deliver an implant over your foothold, catch its callback as a session, and see the beaconing a defender would catch too.
- 02 A stack overflow that returns into win() Overrun a stack buffer onto the saved return address, and send a setuid-root binary into a win() it never calls — landing as root.
- 03 A format string that reads a process's memory Feed format specifiers to a greeting program instead of a name, walk the stack with %p, and read a root-only secret with %s.
Escalate to root
Enumerate a box, then abuse sudo, setuid or PATH to root.
- 01 Enumerate a foothold up to root Read a foothold for the way up — by hand and with linpeas — find a password in a deploy file, and sudo to root.
- 02 Sudo misconfiguration: a backup tool to root Turn one NOPASSWD sudo rule for tar into a root shell with the GTFObins tar escape, then read the box's hashes.
- 03 A setuid binary that runs anything as root Spot the one setuid binary that should not be one — env — and use it to read the hashes as root.
- 04 A locked-down sudo rule undone by its PATH One NOPASSWD wrapper, no arguments, no obvious hole — and a world-writable directory at the front of secure_path turns it into a root shell.