File Upload
Check:
Three ways to exploit:
This web application allows users to upload executable files and execute that script and get the shell.
Combining two vulnerabilities, such as file upload and directory traversal, can be quite powerful. For instance, an attacker might exploit a file upload feature to upload an SSH key, replacing the original file on the victim's machine with their own version.
If we are allowed to upload .docx files or any file which can have macros in it then also we can get shell using this.
Using Executable Files
Below are the steps to do it.
Look for place from where we can upload content to the website.
Check which file types can be uploaded. Change the extension to uppercase or lowercase letters to see if it allows us to bypass the filter on the extension.
Upload the file.
You can upload reverse shell directly or simple-backdoor.php first and then run the command.
After successful upload visit the page or run using curl command to get the shell.
Other example:
a There can be a situation in the upload of files that you upload on one port and can run from another port.
Using Non-executable
In this we can make use of an unrestricted upload function with other attack like directory traversal.

Unfortunately, we cannot know if the relative path was used for placing the file. It's possible that the web application's response merely echoed our filename and sanitized it internally.
Last updated