Privesc linux gtfobins

From NoorQureshi/security-skills · View interactive version

Privesc linux gtfobins is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Linux privilege escalation via sudo rules, SUID/SGID binaries, and capabilities using GTFOBins techniques. Load with a Linux shell needing root, on `sudo -l` output, SUID/`getcap` findings, or "escalate on Linux". Signals: allowed sudo commands, SUID binaries, file capabilities, cron/PATH abuse.

How to use this skill

Skill file

Linux privesc via sudo / SUID / capabilities (GTFOBins)

When it applies

You have a low-priv Linux shell. The fastest root is almost always a misconfig — a sudo rule, a

SUID binary, or a file capability that a known GTFOBins technique turns into a root shell or file

read/write. Do this before kernel exploits.

Why it works

Many normal binaries can spawn shells, read/write files, or run commands. When such a binary runs

with elevated rights — via sudo, the SUID bit, or a capability like cap_setuid — that power

becomes yours. GTFOBins catalogs the exact escape for each binary.

Method

  1. Enumerate the three vectors:
  1. Look up the binary on GTFOBins for the matching function (sudo / suid / capabilities) and

run the exact escape (e.g. sudo vim -c ':!/bin/sh', find . -exec /bin/sh \; if SUID, a

capability-based python -c 'import os;os.setuid(0);...').

  1. Also check: writable cron jobs / scripts run as root (pspy to watch), writable PATH

entries a root process calls, LD_PRELOAD/env_keep in sudo, wildcard injection in root scripts.

  1. Stabilize the root shell and grab proof.

Gotchas

Verify success

A shell/command running as root (id shows uid=0), or root-only file read/write, via the misconfig.

References

GTFOBins; linpeas; "Linux privilege escalation" (HackTricks); pspy.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.