Skip to content
Back to skills

Linux Sudo Suid Capabilities

BSecurity

Linux escalation via sudo rights, SUID/SGID binaries, and file capabilities — GTFOBins-driven abuse of allowed/owned binaries to gain a higher-privilege shell or file read/write, plus known sudo CVEs. Identification, safe PoC, remediation. Use when linux-discovery flags sudo entries, SUID/SGID binaries, or capabilities.

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 17, 2026
securitypythonshellbackend

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill linux-sudo-suid-capabilities --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Linux Sudo Suid Capabilities?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Linux Sudo Suid Capabilities
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-linux-sudo-suid-capabilities/badge)](https://www.skillsdirectory.com/skills/anandjogawade-linux-sudo-suid-capabilities)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: linux-sudo-suid-capabilities
description: Linux escalation via sudo rights, SUID/SGID binaries, and file capabilities — GTFOBins-driven abuse of allowed/owned binaries to gain a higher-privilege shell or file read/write, plus known sudo CVEs. Identification, safe PoC, remediation. Use when linux-discovery flags sudo entries, SUID/SGID binaries, or capabilities.
---

# sudo / SUID / Capabilities Abuse

The most common Linux root path: a binary you can run as root (via sudo, SUID bit, or a capability) that can be coerced into running arbitrary commands or reading/writing arbitrary files.

## Trigger phrases
`gtfobins, sudo -l, suid privesc, sgid, getcap, cap_setuid, baron samedit, sudo cve`

## Identify
```
sudo -l                                   # what you may run as root (and NOPASSWD)
find / -perm -4000 -type f 2>/dev/null    # SUID
find / -perm -2000 -type f 2>/dev/null    # SGID
getcap -r / 2>/dev/null                   # capabilities (cap_setuid, cap_dac_read_search...)
```

## Exploit (GTFOBins-driven, safe PoC)
For each allowed/SUID/capable binary, check **GTFOBins** for the matching primitive (shell / file-read / file-write / sudo). Example safe proofs:
- sudo-allowed `find`: `sudo find . -exec id \;` → shows `uid=0` (stop at proof).
- SUID `env`/`vim`/`python`/`perl`: use the GTFOBins SUID one-liner to run `id`, confirm root, exit.
- `cap_setuid` on python: `python3 -c 'import os;os.setuid(0);os.system("id")'`.
- sudo-allowed editor/pager: read a root-only file (`/etc/shadow`) to prove file access.
- **Known CVEs:** Baron Samedit (CVE-2021-3156), Pwnkit (polkit, CVE-2021-4034), `sudo` version-specific — confirm version first (`sudo --version`), validate cautiously.

## Safe-PoC discipline
Use the primitive to prove root (`id`) or read one sensitive file; don't drop a persistent SUID backdoor or modify system binaries. Revert any test file.

## Remediation to report
Remove unneeded sudo/NOPASSWD entries, strip SUID/SGID from non-essential binaries, drop unnecessary capabilities, patch sudo/polkit.

## Backend / Verification
Run on the target shell. **Background-verify**: reproduce the root proof via a second binary/primitive where possible before reporting CONFIRMED.

## Evidence
`sudo -l`/`find`/`getcap` output, the GTFOBins primitive used, the `uid=0` proof, remediation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.