Skip to content

Instantly share code, notes, and snippets.

@th4s1s
Created January 6, 2025 01:40
Show Gist options
  • Save th4s1s/5435e605e6e9f14a5b76c313483eb58a to your computer and use it in GitHub Desktop.
Save th4s1s/5435e605e6e9f14a5b76c313483eb58a to your computer and use it in GitHub Desktop.

Online Book Shop Using PHP has SQL Injection vulnerability via $usernm paremeter in /process_login.php.

Project

https://code-projects.org/online-book-shop-using-php-source-code/

Vulnerability

/process_login.php - $usernm paremeter.

Description

The SQL Injection vulnerability exists in diretory /process_login.php where this function query the usernm parameter into the SQL statement without any restriction, validation or sanitization. An attacker could exploit this vulnerability to get unauthorized access to the server database, or even perform Remote Code Execution (RCE).

$unm=$_POST['usernm'];

$q="select * from user where u_unm='$unm'";

$res=mysqli_query($conn,$q) or die("wrong query");

$row=mysqli_fetch_assoc($res);

PoC

Enumerate all databases with sqlmap: image

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