Path: blob/master/documentation/modules/exploit/multi/http/carrental_fileupload_rce.md
21665 views
Vulnerable Application
The Online Car Rental System 1.0 is vulnerable to Authenticated Remote Code Execution (RCE) due to an insecure file upload mechanism. Specifically, the changeimage1.php
endpoint in the admin panel does not validate uploaded file types, allowing authenticated users to upload arbitrary PHP scripts. These scripts can be accessed and executed via a predictable file path, leading to full remote code execution.
You can download the vulnerable software from the following link: 🔗 Online Car Rental System 1.0 - Source Code
This module exploits the vulnerability by authenticating to the admin panel, uploading a malicious PHP payload using the vulnerable endpoint, and executing it to gain remote access.
CVE: CVE-2024-57487
Author: Aaryan Golatkar
Disclosure Date: 13/01/2025
Verification Steps
Vulnerable Application Installation Setup
For Windows:
Start Apache and MySQL via the XAMPP Control Panel.
Extract the Online Car Rental System 1.0 source code.
Place the extracted folder inside
htdocs
(e.g.,C:\xampp\htdocs\carrental
).Navigate to
http://localhost/phpmyadmin
in your browser.Create a database (e.g.,
carrental_db
), and import the SQL dump (carrental.sql
) provided in thedatabase
directory.Visit
http://localhost/carrental/
to verify installation.
For Linux:
Start services:
sudo systemctl start apache2 && sudo systemctl start mysql
Install PHPMyAdmin:
sudo apt install phpmyadmin -y
Edit
/etc/apache2/apache2.conf
and append:Extract the project into
/var/www/html/
Follow the same steps as Windows from here onward.
Exploit Module Usage
Start msfconsole and load the exploit:
Set the required options:
Checking Target Vulnerability
If vulnerable, you will see:
Launching the Exploit
If successful, you will receive a Meterpreter shell.
Scenarios
Options
Option | Required | Description |
---|---|---|
TARGETURI | Yes | The base path to the Car Rental System (e.g., /carrental ) |
USERNAME | Yes | Admin username (default: admin ) |
PASSWORD | Yes | Admin password (default: Test@12345 ) |
RHOSTS | Yes | The target IP address |
RPORT | Yes | The target web server port (default: 80) |
LHOST | Yes | The local host to receive the reverse shell |
LPORT | Yes | The local port to receive the reverse shell |