跳转到帖子

游客您好,欢迎来到黑客世界论坛!您可以在这里进行注册。

赤队小组-代号1949(原CHT攻防小组)在这个瞬息万变的网络时代,我们保持初心,创造最好的社区来共同交流网络技术。您可以在论坛获取黑客攻防技巧与知识,您也可以加入我们的Telegram交流群 共同实时探讨交流。论坛禁止各种广告,请注册用户查看我们的使用与隐私策略,谢谢您的配合。小组成员可以获取论坛隐藏内容!

TheHackerWorld官方

Online Healthcare Patient Record Management System 1.0 - Authentication Bypass

精选回复

发布于
# Exploit Title: Online Healthcare Patient Record Management System 1.0 - Authentication Bypass
# Google Dork: N/A
# Date: 2020-05-18
# Exploit Author: Daniel Monzón (stark0de)
# Vendor Homepage: https://www.sourcecodester.com
# Software Link: https://www.sourcecodester.com/php/14217/online-healthcare-patient-record-management-system-using-phpmysql.html
# Version: N/A
# Tested on: Kali Linux 2020.2 x64
# CVE : N/A


The Online Healthcare Patient Record Management System suffers from multiple authentication bypass vulnerabilities: 

The login.php file allows a user to just supply ‘ or 1=1 – as a username and whatever password and bypass the authentication

<?php
        session_start();
        if(ISSET($_POST['login'])){
                $username = $_POST['username'];
                $password = $_POST['password'];
                $conn = new mysqli("localhost", "root", "", "hcpms") or die(mysqli_error());
                $query = $conn->query("SELECT * FROM `user` WHERE `username` = '$username' && `password` = '$password'") or die(mysqli_error());

The same happens with login.php for the admin area:

<?php
        session_start();
        $username = $_POST['username'];
        $password = $_POST['password'];
        if(ISSET($_POST['login'])){
                $conn = new mysqli("localhost", "root", "", "hcpms") or die(mysqli_error());
                $query = $conn->query("SELECT *FROM `admin` WHERE `username` = '$username' && `password` = '$password'") or die(mysqli_error());
                $fetch = $query->fetch_array();
                $valid = $query->num_rows;
                        if($valid > 0){
                                $_SESSION['admin_id'] = $fetch['admin_id'];
                                header("location:home.php");



There is also an authentication bypass issue located in add_user.php:

<?php
        if(ISSET($_POST['save_user'])){
                $username = $_POST['username']; 
                $password = $_POST['password']; 
                $firstname = $_POST['firstname']; 
                $middlename = $_POST['middlename']; 
                $lastname = $_POST['lastname']; 
                $section = $_POST['section']; 
                $conn = new mysqli("localhost", "root", "", "hcpms");
                $q1 = $conn->query("SELECT * FROM `user` WHERE `username` = '$username'") or die(mysqli_error());
                $f1 = $q1->fetch_array();
                $c1 = $q1->num_rows;
                        if($c1 > 0){
                                echo "<script>alert('Username already taken')</script>";
                        }else{
                                $conn->query("INSERT INTO `user` VALUES('', '$username', '$password', '$firstname', '$middlename', '$lastname', '$section')");
                                header("location: user.php");
                        }
        }
If a request is made with the required parameters, any user can create an admin account (no authentication is required to do this).

Finally, there are many SQL injection vulnerabilities (GET parameters directly passed to SQL queries), but those are authenticated
            

创建帐户或登录后发表意见

最近浏览 0

  • 没有会员查看此页面。