Skip to content
Payload Playground
HomeGuidesFile Upload Vulnerabilities Testing Guide

File Upload Vulnerabilities Testing Guide

Comprehensive guide to testing file upload functionality for web shell uploads, extension bypasses, content-type manipulation, and path traversal.

Intermediate
6 steps18 payload examples~60 min
Authorized testing only. Only use these techniques on systems you have explicit permission to test.
1

Identify upload functionality

Find all file upload endpoints: profile picture uploads, document submission forms, import features, and API endpoints accepting file uploads. Note the allowed file types and size limits shown in the UI.

Example payloads
test.jpg (legitimate upload)
test.txt (test accepted types)
2

Test extension restrictions

Try uploading executable file extensions. If blocked, test bypass techniques: double extensions, null bytes, case variations, and alternative executable extensions.

Example payloads
shell.php
shell.php.jpg
shell.pHp
shell.php%00.jpg
shell.phtml
shell.php5
shell.shtml
3

Manipulate Content-Type

Intercept the upload request and change the Content-Type header. Some applications validate only the MIME type, not the actual file content or extension.

Example payloads
Content-Type: image/jpeg (with PHP content)
Content-Type: image/png (with JSP content)
Content-Type: application/octet-stream
4

Verify server-side file validation

For a PNG upload, use a small valid image and a copy cut short before the first pixel data. Both have the same PNG signature. The valid image should decode and the server should reject the incomplete copy before publication. Record both outcomes. This checks whether the image is readable. File size limits, storage permissions and download authorization need separate checks.

5

Test path traversal in filename

Attempt to control where the file is stored by including directory traversal sequences in the filename. This can overwrite critical files or place the shell in a web-accessible directory.

Example payloads
../../../var/www/html/shell.php
..\..\..\inetpub\wwwroot\shell.aspx
file.php%2f..%2f..%2fshell.php
6

Locate and access the uploaded file

Find the URL where uploaded files are served. Check the response for file paths, try common upload directories, and test if the file executes as code when accessed directly.

Example payloads
/uploads/shell.php?cmd=id
/media/shell.php
/static/uploads/shell.phtml

Level up your security testing

Send feedback

Report an issue or suggest an improvement.

0/2000

Your report includes this page (/guides/how-to-test-for-file-upload-vulnerabilities) and your browser. If you’re signed in, we include your account ID and plan so support can prioritize Pro requests. Please leave out secrets and client data.