Labs / Linux Exploitation

Linux ExploitationThe medal for finishing it

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.

2 groups · 7 labs · builds on Network Attacks

Start this road

Frameworks & memory corruption

Manage a foothold, then corrupt memory for code and secrets.

  1. 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.
  2. 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.
  3. 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

What its labs use

Concepts

Commands

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab