
For example shell.aspx will become SHELL~1.ASP
PHP REVERSE SHELL CHEATSHEET WINDOWS
The Windows 8.3 short name version can be used in the file name. Try using Windows 8.3 notation for the file name php can help bypass file extension whitelistsĪn executable script can be inserted into an image in the form of a metadata comment, which will then be executed when the web server uses the image in a page In order webservers, adding special characters such as %$& just after the file name, for example shell.

For example: php-reverse-shell.php%00.gifĪdd special characters before file extension If the site is using file extension whitelists, this can often be bypassed by adding %00 (HTML encoding) or \x00 (hex encoding) to the end of the file name.
PHP REVERSE SHELL CHEATSHEET CODE
If a file size restriction is being used, a smaller script can be uploaded to gain remote code execution, such asĬertain executable extensions may still be allowed, for example. For example, when adding “GIF87a” to the beginning of the script, the server will think of it as a GIF file. Magic bytes function as signatures used by the web server to identify the type of file that is being uploaded. When intercepting the request using Burp Suite, the content type can be changed, for example from “Content-type: application/x-php” to “Content-type: image/gif” Try different combinations of lower and upper case, for example pHp, PhP, phP, Php etc If the application is not properly validating for the file extension, this can be exploited by appending another extension, for example from script.php to or php5, phtml for PHP scripts, asp,aspx and ashx for IIS Try different versions of the file extensions, for example php3.

Through this checklist, I hope to cover most of the possible bypass methods that can be used to get past this restriction. When enumerating web applications, we often find ourselves in front of a file upload file that allows us to potentially upload malicious files onto the application, such as a PHP or ASP shell, although these will often have certain restrictions that will only allow certain file types, extensions, file names or contents.
