Concepts / Exploitation and privilege escalation

Exploitation and privilege escalation

GTFObins

Also called gtfobins, living off the land binaries, lolbins, sudo escape, shell escape

A catalogue of ordinary Unix binaries that can be bent into reading files, writing files or spawning a shell — the key to abusing a sudo rule or a setuid bit.

An ordinary binary plus root rights is a root shell
An ordinary binary plus root rights is a root shell

A binary that can start other commands is harmless on its own. Run through a sudo rule or the setuid bit, it starts a shell that is root's.

GTFObins (gtfobins.github.io) catalogues ordinary Unix binaries that can read a file, write a file or start a shell. find runs commands with -exec, env runs any program, vim has a shell escape. Run as root, the shell is root's: through a sudo rule (sudo env /bin/sh) or the [[setuid]] bit (find . -exec /bin/sh -p \;). That is a [[privilege-escalation|privilege escalation]], so never grant such a binary elevated rights.

See it on real machines

Read next

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