Bug Bounty Chronicles: Exploiting the PUT Method for Remote Code Execution (RCE)
The target web server allowed unrestricted HTTP PUT uploads without authentication, and uploaded files were publicly accessible and executable. An attacker could upload a PHP script and run arbitrary commands on the server, achieving remote code execution.
Published on medium.com
Picture this: a seemingly harmless feature on NotYourAverageBoards.com becomes a hacker’s playground. I, Pushpak Pawar, a curious digital adventurer, discovered that this website was vulnerable to Remote Code Execution (RCE).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the web server was configured to accept PUT requests without authentication and to serve uploaded files from a directory where server-side scripts are executed.
Impact
An attacker could take over the server, steal sensitive data, or disrupt services.
What the attacker needed
None
The fix
The PUT method should be disabled unless strictly necessary, or at least require authentication and restrict uploaded file types.
How it was found
- Send a PUT request with a plain text file to the target and confirm it is accessible.
- Send a PUT request with an HTML file and confirm the HTML is rendered.
- Send a PUT request with a styled HTML page and confirm it is served.
- Send a PUT request with a PHP script that runs a command from a query parameter.
- Access the uploaded PHP file with a command parameter and observe directory listing output.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The HTTP PUT method is a way for a client to send a file to a web server, usually to create or replace it. Here the server accepted files from anyone, put them in a public folder, and even ran uploaded PHP scripts. That meant a stranger could upload a small program and then ask the server to run commands, taking control of the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.