Command Injection via PHP File Upload in an College Recruitment R
A recruitment portal accepted PHP files without validation, and the uploaded file was executed by the server. An attacker could run arbitrary commands on the server, list uploaded resumes, and potentially create backdoors or extract sensitive data.
Published on medium.com
At first glance, their current site was secure and modern, with no upload forms or exposed inputs. But I took a different approach — I fired up Wayback Machine and searched for different subdomains of the portal.
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 file upload feature lacked server-side validation of file type and stored uploaded files in a directory where PHP execution was enabled.
Impact
This allowed remote command execution on the server, enabling an attacker to enumerate users, create backdoors, and extract sensitive data.
What the attacker needed
Internet access; a dummy account (no email verification)
The fix
The upload should be fixed by validating file types on the server and preventing execution of uploaded files.
How it was found
- Find the recruitment portal via Wayback Machine and subdomain search.
- Register a dummy account without email verification.
- Upload a PHP file containing a command execution function.
- Access the uploaded file with a command parameter to run commands.
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 website let people upload files, but it did not check what kind of file was being uploaded. The author uploaded a small program written in PHP (a language used by many websites) that the server then ran, letting them run commands on the server. This is dangerous because an attacker can use it to take control of the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.