Skip to content

Instantly share code, notes, and snippets.

@th4s1s
Created January 2, 2025 19:09
Show Gist options
  • Save th4s1s/24925a20d1f9336858dee1cbbb30c249 to your computer and use it in GitHub Desktop.
Save th4s1s/24925a20d1f9336858dee1cbbb30c249 to your computer and use it in GitHub Desktop.

Online Shoe Store Using PHP has SQL Injection vulnerability via $tid paremeter in /summary.php.

Project

https://code-projects.org/online-shoe-store-using-php-source-code/

Vulnerability

/summary.php - $tid paremeter.

Description

The SQL Injection vulnerability exists in diretory /summary.php where this function query the tid 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).

<?php
  $t_id = $_GET['tid'];
  $query = $conn->query("SELECT * FROM transaction WHERE transaction_id = '$t_id'") or die (mysqli_error());
  $fetch = $query->fetch_array();

PoC

Enumerate all databases with sqlmap: image

Get OS-shell and execute command: image

image

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