I managed to upload a PHP shell using an upload form with some tweaking. No such restrictions except it renames the uploaded file to md5. But when I tried to execute the shell, It shows a 500 error. I am able to view or download all other files such as HTML, JS, JPG etc. On digging further, I found that there is a .htaccess file with the content below. Is there a possibility that PHP is not executing because of the permissions? Is there a way to execute PHP or gain shell using any other ways?
Options -Indexes
<files .htaccess>
order allow,deny
deny from all
</files>
#Add all file you want to protect...
<FilesMatch "\.(htaccess|htpasswd|ini|zip|rar|mp3|phps|fla|psd|log|sh|php)$">
Order Allow,Deny
Deny from all
</FilesMatch>
It is confirmed that the server has PHP Installed and executes PHP on all other directories except uploads folder.
Steps already performed:
Tried uploading shell with different extensions and combination of lower/upper case like PhP, PHp. phtml extension also gets uploaded but same issue of internal server error while executing phtml too.
Checked uploading and viewing HTML on browser, works fine.
Tried with a simple PHP echo. Not working.