
24 new exploits Entrepreneur Job Portal Script - SQL Injection Entrepreneur Job Portal Script 2.06 - SQL Injection NETGATE Registry Cleaner build 16.0.205 - Unquoted Service Path Privilege Escalation HP Client - Automation Command Injection / Remote Code Execution HP Client 9.1/9.0/8.1/7.9 - Command Injection NO-IP DUC v4.1.1 - Unquoted Service Path Privilege Escalation NO-IP DUC 4.1.1 - Unquoted Service Path Privilege Escalation Wondershare PDFelement 5.2.9 - Unquoted Service Path Privilege Escalation Firefox 49.0.1 - Denial of Service Graylog Collector 0.4.2 - Unquoted Service Path Privilege Escalation NETGATE AMITI Antivirus build 23.0.305 - Unquoted Service Path Privilege Escalation NETGATE Data Backup build 3.0.605 - Unquoted Service Path Privilege Escalation Student Information System (SIS) 0.1 - Authentication Bypass Web Based Alumni Tracking System 0.1 - SQL Injection Simple Dynamic Web 0.1 - SQL Injection Learning Management System 0.1 - Authentication Bypass Fashion Shopping Cart 0.1 - SQL Injection Health Record System 0.1 - Authentication Bypass Windows x64 - WinExec() Shellcode (93 bytes) Spy Emergency 23.0.205 - Unquoted Service Path Privilege Escalation PHP Telephone Directory - Multiple Vulnerabilities Subrion CMS 4.0.5 - Cross-Site Request Forgery Bypass / Persistent Cross-Site Scripting PHP Image Database - Multiple Vulnerabilities Simple Shopping Cart Application 0.1 - SQL Injection PHP NEWS 1.3.0 - Cross-Site Request Forgery (Add Admin) School Full CBT 0.1 - SQL Injection PHP Business Directory - Multiple Vulnerabilities Windows x86 - Keylogger Reverse UDP Shellcode (493 bytes) Ruby on Rails - Dynamic Render File Upload Remote Code Execution Microsoft Windows Diagnostics Hub - DLL Load Privilege Escalation (MS16-125)
85 lines
No EOL
3.1 KiB
Text
Executable file
85 lines
No EOL
3.1 KiB
Text
Executable file
# Exploit Title.............. Learning Management System Auth Bypass
|
|
# Google Dork................ N/A
|
|
# Date....................... 14/10/2016
|
|
# Exploit Author............. lahilote
|
|
# Vendor Homepage............ http://www.sourcecodester.com/php/7339/learning-management-system.html
|
|
# Software Link.............. http://www.sourcecodester.com/sites/default/files/download/jkev/lms.zip
|
|
# Version.................... 0.1
|
|
# Tested on.................. xampp
|
|
# CVE........................ N/A
|
|
|
|
|
|
The audit_list in lms/login.php
|
|
-------------------------------
|
|
|
|
----snip----
|
|
|
|
$username = $_POST['username'];
|
|
$password = $_POST['password'];
|
|
/* student */
|
|
$query = "SELECT * FROM student WHERE username='$username' AND password='$password'";
|
|
$result = mysql_query($query)or die(mysql_error());
|
|
$row = mysql_fetch_array($result);
|
|
$num_row = mysql_num_rows($result);
|
|
/* teacher */
|
|
$query_teacher = mysql_query("SELECT * FROM teacher WHERE username='$username' AND password='$password'")or die(mysql_error());
|
|
$num_row_teacher = mysql_num_rows($query_teacher);
|
|
$row_teahcer = mysql_fetch_array($query_teacher);
|
|
if( $num_row > 0 ) {
|
|
|
|
----snip----
|
|
|
|
lms/admin/login.php
|
|
-------------------
|
|
|
|
----snip----
|
|
|
|
$username = $_POST['username'];
|
|
$password = $_POST['password'];
|
|
|
|
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'")or die(mysql_error());
|
|
$count = mysql_num_rows($query);
|
|
$row = mysql_fetch_array($query);
|
|
|
|
----snip----
|
|
|
|
You can login with username and password: admin' or '1'='1
|
|
|
|
How to fix
|
|
----------
|
|
One of the method's to fix and secure such Auth Bypass flaw's, is to use the php function mysql_real_escape_string.
|
|
It causes that every of this characters \x00, \n, \r, \, '
|
|
get's replaced with a simple Backslash „/“, so the attackers commands become useless.
|
|
|
|
Example: lms/login.php
|
|
|
|
$username = mysql_real_escape_string($_POST['username']);
|
|
$password = mysql_real_escape_string($_POST['password']);
|
|
/* student */
|
|
$query = "SELECT * FROM student WHERE username='$username' AND password='$password'";
|
|
$result = mysql_query($query)or die(mysql_error());
|
|
$row = mysql_fetch_array($result);
|
|
$num_row = mysql_num_rows($result);
|
|
/* teacher */
|
|
$query_teacher = mysql_query("SELECT * FROM teacher WHERE username='$username' AND password='$password'")or die(mysql_error());
|
|
$num_row_teacher = mysql_num_rows($query_teacher);
|
|
$row_teahcer = mysql_fetch_array($query_teacher);
|
|
if( $num_row > 0 ) {
|
|
|
|
Example: lms/admin/login.php
|
|
|
|
$username = mysql_real_escape_string($_POST['username']);
|
|
$password = mysql_real_escape_string($_POST['password']);
|
|
|
|
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'")or die(mysql_error());
|
|
$count = mysql_num_rows($query);
|
|
$row = mysql_fetch_array($query);
|
|
|
|
Credits
|
|
-------
|
|
This vulnerability was discovered and researched by lahilote
|
|
|
|
References
|
|
----------
|
|
http://www.sourcecodester.com/php/7339/learning-management-system.html
|
|
http://php.net/manual/en/function.mysql-real-escape-string.php |