Skip to content

Intermediate 20 minUpdated 2026-11-06

Linux privilege-escalation checklist

You have a shell as an unprivileged user on an in-scope Linux host and want to escalate to root. Privilege escalation is mostly enumeration: the path is usually already there, waiting to be noticed. Work through these checks in order.

  1. Know who you are

    Establish your user, groups and sudo rights first. Membership of groups like sudo, docker, lxd or disk is often the whole game.

    • id

      Your UID, GID and supplementary groups.

    • sudo -l

      What you may run with sudo — look for NOPASSWD and editable scripts.

    All 13 whoami commands
  2. Understand the system

    Record the distribution and kernel version. An out-of-date kernel may have a public local exploit, and the distro decides which paths apply.

    • cat /etc/os-release

      Distribution and version.

    • uname -a

      Kernel version and architecture.

    All 13 cat commands
  3. Hunt SUID and capabilities

    Files that run as another user are a top escalation route. Compare what you find against GTFOBins.

    • find / -perm -4000 -type f 2>/dev/null

      SUID binaries.

    • getcap -r / 2>/dev/null

      Binaries with Linux capabilities such as cap_setuid.

    All 22 find commands
  4. Look at scheduled jobs

    Cron jobs and systemd timers that run as root and call writable scripts or use wildcards are a classic win.

    • cat /etc/crontab; ls -la /etc/cron.*

      System cron jobs and directories.

    • systemctl list-timers --all

      systemd timers, the modern equivalent.

    All 19 systemctl commands
  5. Check writable and interesting files

    World-writable files owned by root, readable backups, and credentials in config or history files all lead somewhere.

    • find / -writable -type f ! -path "/proc/*" 2>/dev/null

      Files your user can write.

    • grep -rniE "password|api[_-]?key|secret" /var/www /home 2>/dev/null

      Hard-coded secrets to reuse.

    All 21 grep commands
  6. Review network and processes

    Services bound to localhost may be exploitable only from the box, and processes running as root reveal more attack surface.

    • ps aux | grep -v "\]quot;

      Processes, kernel threads hidden.

    • ss -tlnp

      Listening ports, including localhost-only services.

    All 16 ps commands

If manual checks come up short, an automated enumerator such as linpeas can surface what you missed — but understanding each finding by hand is what makes you reliable. Only escalate on systems you are authorised to test.