/linux-discovery
Linux local privilege escalation enumeration and attack surface mapping.
$ npx -y skills add blacklanternsecurity/red-run --skill linux-discovery --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/linux-discovery
Context preview
The summary Claude sees to decide when to auto-load this skill.
Linux local privilege escalation enumeration and attack surface mapping.
SKILL.md
linux-discovery.SKILL.mdname: linux-discovery
description: >
Linux local privilege escalation enumeration and attack surface mapping.
keywords:
- enumerate linux privesc
- check for privilege escalation
- run linpeas
- linux privesc
- local privesc linux
- check my privileges on linux
- escalate on linux
- what can I escalate
- post-exploitation linux
- enumerate this linux box
tools:
- LinPEAS
- LinEnum
- linux-smart-enumeration
- pspy
- linux-exploit-suggester
- SUDO_KILLER
- unix-privesc-check
opsec: low
Linux Local Privilege Escalation Discovery
You are helping a penetration tester enumerate a Linux system for local privilege escalation vectors. All testing is under explicit written authorization.
Engagement Logging
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
- Print `[linux-discovery] Activated → <target>` to the screen on activation.
- **Evidence** → save significant output to `engagement/evidence/` with
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Scope Boundary
This skill covers Linux host discovery — enumerating system configuration, identifying privilege escalation vectors, and reporting findings to the orchestrator. When you confirm an exploitable vector — **STOP**.
Do not load or execute another skill. Do not continue past your scope boundary. Instead, return to the orchestrator with:
- What was found (vulns, credentials, access gained)
- Detection details (finding type, affected binary/service, evidence)
- Context for technique execution (hostname, kernel version, current user, etc.)
The orchestrator decides what runs next. Your job is to execute this skill thoroughly and return clean findings.
**Stay in methodology.** Only use techniques documented in this skill. If you encounter a scenario not covered here, note it and return — do not improvise attacks, write custom exploit code, or apply techniques from other domains. The orchestrator will provide specific guidance or route to a different skill.
State Management
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
- Skip re-testing targets, parameters, or vulns already confirmed
- Leverage existing credentials or access for this technique
- Understand what's been tried and failed (check Blocked section)
State Writes
Write actionable findings **immediately** via state so the orchestrator can react in real time (via event watcher) instead of waiting for your full return summary. Use these tools as you discover findings:
- `add_credential()` — cleartext creds found in config files, .bash_history, env vars, or databases
- `add_vuln()` — confirmed vulnerabilities a technique agent should exploit (SUID binaries, sudo misconfigs, kernel CVEs)
- `add_pivot()` — additional NICs/subnets discovered via `ip addr`/`ip route`, new hosts from ARP table
- `add_blocked()` — techniques attempted and failed (so orchestrator doesn't re-route)
Your return summary must include:
- New targets/hosts discovered (with ports and services)
- New credentials or tokens found
- Access gained or changed (user, privilege level, method)
- Vulnerabilities confirmed (with status and severity)
- Pivot paths identified (what leads where)
- Blocked items (what failed and why, whether retryable)
Prerequisites
- Shell access on a Linux system (SSH, reverse shell, webshell)
- Know current user context (`id`)
- Enumeration tools available on target or transferable
Step 1: System Information
Gather baseline system information for exploit matching and context.
# Kernel and OS
uname -a
cat /etc/os-release 2>/dev/null || cat /etc/*-release 2>/dev/null
cat /proc/version
uname -r
uname -m # Architecture (x86_64, aarch64, etc.)
# Hostname and domain
hostname
hostname -f 2>/dev/null
dnsdomainname 2>/dev/null
# Hardware and disk
lscpu
df -h
lsblk 2>/dev/null
# Environment
echo $PATH
echo $LD_LIBRARY_PATH
echo $SHELL
env | grep -iE "pass|key|secret|token|proxy" 2>/dev/null
**Key outputs to note:**
- Kernel version (determines kernel exploit eligibility)
- Distribution and version (affects available tools and default configs)
- Architecture (affects binary compatibility for exploits)
- PATH directories (writable ones = hijacking opportunity)
- Environment variables (leaked credentials, writable library paths)
If `env | grep` reveals cleartext credentials (passwords, tokens, API keys), write them immediately: `add_credential(username=..., secret=..., source="env vars on <host>")`.
Step 2: User Context and Privileges
id
groups
cat /etc/passwd | grep -v nologin | grep -v false | grep sh$
awk -F: '($3 == 0) {print $0}' /etc/passwd # UID 0 accounts**Currently logged-in users:**
w
who
last -20 2>/dev/null
**Group membership (privesc-relevant groups):**
| Group | Escalation Vector | |-------|-------------------| | `docker` | Mount host filesystem via container | | `lxd` / `lxc` | Privileged container escape | | `disk` | Raw disk read (debugfs) → read /etc/shadow | | `adm` | Read /var/log/* (credential hunting) | | `sudo` / `wheel` | Sudo configuration | | `video` | Framebuffer access (keylogger) | | `input` | Input device access (keylogger) | | `staff` | Write to /usr/local (PATH hijack) |
Step 3: Sudo Configuration
This is the highest-priority check — sudo misconfigurations are the most common Linux privilege escalation vector.
sudo -n -l 2>/dev/null # -n prevents password prompt from hanging the shell
sudo -V 2>/dev/null | head -1 # Sudo version for CVE matching
**Sudo version CVEs:**
| Version Range | CVE | Impact | |---------------|-----|--------| | < 1.9.5p2 (1.8.2 - 1.9.5p1) | CVE-2021-3156 (Baron Samedit) | Heap overflow → root without sudo access | | All current | CVE-2019-14287 | `sudo -u#-1` bypasses user restriction | | 1.9.14 - 1.9.17 < 1.9.17p1 | CVE-2025-32463 | chroot → root
Read more
name: linux-discovery description: > Linux local privilege escalation enumeration and attack surface mapping. keywords: - enumerate linux privesc - check for privilege escalation - run linpeas - linux privesc - local privesc linux - check my privileges on linux - escalate on linux - what can I escalate - post-exploitation linux - enumerate this linux box tools: - LinPEAS - LinEnum - linux-smart-enumeration - pspy - linux-exploit-suggester - SUDO_KILLER - unix-privesc-check opsec: low
Linux Local Privilege Escalation Discovery
You are helping a penetration tester enumerate a Linux system for local privilege escalation vectors. All testing is under explicit written authorization.
Engagement Logging
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
- Print `[linux-discovery] Activated → <target>` to the screen on activation.
- **Evidence** → save significant output to `engagement/evidence/` with
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Scope Boundary
This skill covers Linux host discovery — enumerating system configuration, identifying privilege escalation vectors, and reporting findings to the orchestrator. When you confirm an exploitable vector — **STOP**.
Do not load or execute another skill. Do not continue past your scope boundary. Instead, return to the orchestrator with:
- What was found (vulns, credentials, access gained)
- Detection details (finding type, affected binary/service, evidence)
- Context for technique execution (hostname, kernel version, current user, etc.)
The orchestrator decides what runs next. Your job is to execute this skill thoroughly and return clean findings.
**Stay in methodology.** Only use techniques documented in this skill. If you encounter a scenario not covered here, note it and return — do not improvise attacks, write custom exploit code, or apply techniques from other domains. The orchestrator will provide specific guidance or route to a different skill.
State Management
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
- Skip re-testing targets, parameters, or vulns already confirmed
- Leverage existing credentials or access for this technique
- Understand what's been tried and failed (check Blocked section)
State Writes
Write actionable findings **immediately** via state so the orchestrator can react in real time (via event watcher) instead of waiting for your full return summary. Use these tools as you discover findings:
- `add_credential()` — cleartext creds found in config files, .bash_history, env vars, or databases
- `add_vuln()` — confirmed vulnerabilities a technique agent should exploit (SUID binaries, sudo misconfigs, kernel CVEs)
- `add_pivot()` — additional NICs/subnets discovered via `ip addr`/`ip route`, new hosts from ARP table
- `add_blocked()` — techniques attempted and failed (so orchestrator doesn't re-route)
Your return summary must include:
- New targets/hosts discovered (with ports and services)
- New credentials or tokens found
- Access gained or changed (user, privilege level, method)
- Vulnerabilities confirmed (with status and severity)
- Pivot paths identified (what leads where)
- Blocked items (what failed and why, whether retryable)
Prerequisites
- Shell access on a Linux system (SSH, reverse shell, webshell)
- Know current user context (`id`)
- Enumeration tools available on target or transferable
Step 1: System Information
Gather baseline system information for exploit matching and context.
# Kernel and OS uname -a cat /etc/os-release 2>/dev/null || cat /etc/*-release 2>/dev/null cat /proc/version uname -r uname -m # Architecture (x86_64, aarch64, etc.) # Hostname and domain hostname hostname -f 2>/dev/null dnsdomainname 2>/dev/null
# Hardware and disk lscpu df -h lsblk 2>/dev/null # Environment echo $PATH echo $LD_LIBRARY_PATH echo $SHELL env | grep -iE "pass|key|secret|token|proxy" 2>/dev/null
**Key outputs to note:**
- Kernel version (determines kernel exploit eligibility)
- Distribution and version (affects available tools and default configs)
- Architecture (affects binary compatibility for exploits)
- PATH directories (writable ones = hijacking opportunity)
- Environment variables (leaked credentials, writable library paths)
If `env | grep` reveals cleartext credentials (passwords, tokens, API keys), write them immediately: `add_credential(username=..., secret=..., source="env vars on <host>")`.
Step 2: User Context and Privileges
id
groups
cat /etc/passwd | grep -v nologin | grep -v false | grep sh$
awk -F: '($3 == 0) {print $0}' /etc/passwd # UID 0 accounts**Currently logged-in users:**
w who last -20 2>/dev/null
**Group membership (privesc-relevant groups):**
| Group | Escalation Vector | |-------|-------------------| | `docker` | Mount host filesystem via container | | `lxd` / `lxc` | Privileged container escape | | `disk` | Raw disk read (debugfs) → read /etc/shadow | | `adm` | Read /var/log/* (credential hunting) | | `sudo` / `wheel` | Sudo configuration | | `video` | Framebuffer access (keylogger) | | `input` | Input device access (keylogger) | | `staff` | Write to /usr/local (PATH hijack) |
Step 3: Sudo Configuration
This is the highest-priority check — sudo misconfigurations are the most common Linux privilege escalation vector.
sudo -n -l 2>/dev/null # -n prevents password prompt from hanging the shell sudo -V 2>/dev/null | head -1 # Sudo version for CVE matching
**Sudo version CVEs:**
| Version Range | CVE | Impact | |---------------|-----|--------| | < 1.9.5p2 (1.8.2 - 1.9.5p1) | CVE-2021-3156 (Baron Samedit) | Heap overflow → root without sudo access | | All current | CVE-2019-14287 | `sudo -u#-1` bypasses user restriction | | 1.9.14 - 1.9.17 < 1.9.17p1 | CVE-2025-32463 | chroot → root
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,
Other skills on red-run.
- /acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted Kerberoasting via SPN manipulation, shadow credentials (msDS-KeyCredentialLink → PKINIT), and AdminSDHolder persistence.
Open skill - /ad-discovery
Enumerates Active Directory domains and maps attack surface for penetration testing.
Open skill - /ad-persistence
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS master password), custom SSP injection (credential logging via mimilib/memssp), security descriptor backdoors
Open skill - /adcs-access-and-relay
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 ACLs), ESC7 (ManageCA/ManageCertificates abuse), ESC8 (NTLM relay to HTTP enrollment), ESC11 (NTLM relay to ICPR RPC).
Open skill - /adcs-persistence
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15 (YubiHSM, issuance policy, altSecIdentities, application policies), Golden Certificate (forge with stolen CA key), certificate
Open skill - /adcs-template-abuse
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee supplies subject), ESC2 (any-purpose/no EKU), ESC3 (enrollment agent), ESC6 (EDITF_ATTRIBUTESUBJECTALTNAME2 CA flag).
Open skill

