For the complete documentation index, see llms.txt. This page is also available as Markdown.

Thecus N4800Eco Nas Server Control Panel Comand Injection

Command Injection vulnerability that lets attacker for executing command with root privileges.

I have discovered command injection vulnerability on the Thecus N4800Eco Nas Server control panel during penetration test. I could not analyze source code because I didn't have enough time. Hence, I will describe only how vulnerability is detected.

# Description

Firstly, I have tried to add user through Local User Configuration, but server didn't accept special chars such as $)( . Also, user and group could be created using Batch Input option that is under the User and Group Authentication section. I set Batch Content as $(ifconfig),22222,9999 that corresponds to username, password and group name.

Request:
POST /adm/setmain.php?fun=setbatch HTTP/1.1
Host: target
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 42
Origin: https://target
Connection: close
Referer: https://target/adm/index.php
Cookie: select_md=0; MYSESSID=*

batch_content=%24(ifconfig)%2C22222%2C9999

So that filtering can be bypassed using Batch Content option for adding malicious payload as username. After the user adding process, I sent second request for deleting $(ifconfig) user and Local User remove succeeds response is returned. However the user was not deleted, it is very interesting to me. I tried to understand what happened and noticed that there is a system log section.

Surprisingly I saw that ifconfig command is executed.

For verifying the command injection vulnerability i tried another command such as id

So there is a comman injection vulnerability that lets to execute command with root privilege. Username parameter seems to vulnerable. It is time to write basic Python script.

Last updated