
对NETIS WF2409E路由器进行的一次完整硬件安全分析研究。通过对设备进行拆解分析、调试接口识别、固件提取等工作,记录了硬件分析的全过程、漏洞细节以及相应的安全建议,希望能帮助提高物联网设备的安全性。

| Category | Parameter | Description |
|---|---|---|
| Device Information | Model | Netis WF2409E |
| Type | 300Mbps Wireless N Router | |
| Power Supply | DC 9V/500mA | |
| Hardware Version | V1.8 | |
| PCB Version | PB-7189-M02G-20 | |
| Production Date | 2015-03-23 | |
| Country of Origin | China | |
| Network Identifiers | Serial Number | 2409EEU5B102714 V1.8 |
| MAC Address | W8D398DFB68 | |
| Default SSID | netis_BDFB68 | |
| Default Password | password | |
| Management Address | http://netis.cc | |
| Hardware Interfaces | WAN Port | 1 (blue RJ45) |
| LAN Ports | 4 (black RJ45, LAN1-4) | |
| Antennas | 3 external antennas | |
| Power Connector | DC input (PWR) | |
| Function Buttons | Default | Reset to factory settings |
| WPS | Protected WiFi setup |



| Parameter | Specification |
|---|---|
| Processor Model | RealTek RTL8196E |
| Architecture | 16-bit |
| Clock Frequency | 380MHz |
| Compilation Date | 2014.09.29 |
| Parameter | Description |
|---|---|
| Bootloader Type | RealTek Proprietary Bootloader |
| Kernel Load Address | 0x80500000 |
| Start Execution Address | 0x80003440 |
| Signature Search Range | 0x10000-0x170000 |
| Parameter | Value |
|---|---|
| IP Address | 192.168.0.1 |
| Subnet Mask | 255.255.255.0 |
| MAC Address | 04:8d:38:bd:fb:69 |
| Wireless Interface | wlan0 (including va0-va3, vxd) |
| Parameter | Value |
|---|---|
| Device Model | netis WF2419E_RU |
| Firmware Version | V2.5.40200 |
| Firmware Date | 2016.09.02 |
| BusyBox Version | v1.00-pre8 (2015.01.23) |
It is important to note that this device likely does not use U-Boot. Key indicators:
---RealTek(RTL8196E)at 2014.09.29-19:16+0800 v1.0 [16bit](https://github.com/victorique-123/cve-2023-38829-netis-wf2409e_report/blob/master/380MHz)
Bootloader Commands:
<RealTek> FLR 80000000 0 100 #Read from Flash DB 80000000 100 #View memory contents



/dev/mtdblock1 mounted as root directory /none mounted as process filesystem /proctmpfs mounted as temporary filesystem /varThe root filesystem is configured as follows:
/dev/mtdblock1This indicates the use of MTD flash memory as the medium, with system files protected and space-optimized through read-only and squashfs compression.
The process filesystem is configured as follows:
The temporary filesystem is configured as follows:


binwalk -E --save netis.bin


binwalk netis.bin

And get:

| Offset | Partition Header |
|---|---|
| 0x12F0 | ![]() |
| 0x32818 | ![]() |

etc/passwd:
Using the hash decryption service https://hashes.com/en/decrypt/hash, the root password was successfully recovered as realtek.

web/welcome.htm:This is the default web interface page

Searching for devices in FOFA via characteristics in web/welcome.htm:
Search commands:
body="./images/logo_netis.png" && body="display:block; height:60px; float:left;"


Access to the device's admin panel may require authentication with a login and password

After successful authentication, you can enter the admin panel

First, using the command ~/squashfs-root/web$ find to find available directories, and using Burpsuite to check their accessibility:| | Payload | Code | | Lenth |
| ------ | ------------------------------- | ------- | ----- | --------- |
| 1 | /cgi-bin | 200 | | 167 |
| 2 | /cgi-bin/cgitest.cgi | - | ERROR | - |
| 3 | /script | 200 | | 168 |
| 4 | /script/init.js | 200 | | 1282 |
| 5 | /script/logic.js | 200 | | 65677 |
| 6 | /script/menu.js | 200 | | 4976 |
| 7 | /script/netcore.js | 200 | | 151935 |
| 8 | /script/action.js | 200 | | 182624 |
| 9 | /script/debug.js | 200 | | 28570 |
| ==10== | ==/version.txt== | ==200== | | ==206== |
| ==11== | ==/update.htm== | ==200== | | ==1230== |
| 12 | /config | 200 | | 168 |
| 13 | /config/language_es.js | 200 | | 79333 |
| 14 | /config/language_it.js | 200 | | 76802 |
| 15 | /config/language_id.js | 200 | | 74795 |
| 16 | /config/language_du.js | 200 | | 78782 |
| 17 | /config/language_ma.js | 200 | | 73594 |
| 18 | /config/language_po.js | 200 | | 76458 |
| 19 | /config/language_tu.js | 200 | | 77747 |
| 20 | /config/language_fr.js | 200 | | 78165 |
| 21 | /config/language_ro.js | 200 | | 73621 |
| 22 | /config/language_cz.js | 200 | | 75968 |
| 23 | /config/language_ua.js | 200 | | 98335 |
| 24 | /config/language_us.js | 200 | | 84173 |
| 25 | /config/config.js | 200 | | 75899 |
| 26 | /config/language_ru.js | 200 | | 108998 |
| 27 | /config/language_de.js | 200 | | 78674 |
| 28 | /config/language_pt.js | 200 | | 77954 |
| 29 | /config/language_cn.js | 200 | | 62001 |
| 30 | /config/language_tc.js | 200 | | 74268 |
| 31 | /system_log.txt | 404 | | 330 |
| ==32== | ==/index.htm== | ==200== | | ==4336== |
| 33 | /css | 200 | | 167 |
| 34 | /css/style.css | 200 | | 5441 |
| 35 | /css/netcore.css | 200 | | 11536 |
| 36 | /css/welcome.css | 200 | | 6270 |
| 37 | /Config.tgz | 404 | | 326 |
| 38 | /images | 200 | | 168 |
| 39 | /images/first.png | 200 | | 838 |
| 40 | /images/icon_no.gif | 200 | | 240 |
| 41 | /images/top_right_bg.gif | 200 | | 222 |
| 42 | /images/logo_netis.png | 200 | | 7297 |
| 43 | /images/icon_jian.gif | 200 | | 239 |
| 44 | /images/show_pwd.png | 200 | | 1433 |
| 45 | /images/icon_no1.gif | 200 | | 498 |
| 46 | /images/nextt.png | 200 | | 1026 |
| 47 | /images/lastt.png | 200 | | 845 |
| 48 | /images/icon_intro_internet.gif | 200 | | 6994 |
| 49 | /images/help_b1.gif | 200 | | 540 |
| 50 | /images/high.gif | 200 | | 10846 |
| 51 | /images/yandex_en.png | 200 | | 3519 |
| 52 | /images/help_b1.jpg | 200 | | 620 |
| 53 | /images/back.gif | 200 | | 379 |
| 54 | /images/icon_intro_wireless.jpg | 200 | | 3838 |
| 55 | /images/icon_jian1.gif | 200 | | 490 |
| 56 | /images/left_021.jpg | 200 | | 558 |
| 57 | /images/edit.gif | 200 | | 365 |
| 58 | /images/pre.png | 200 | | 1029 |
| 59 | /images/btn_mobile_setup.jpg | 200 | | 3053 |
| 60 | /images/icon_now.gif | 200 | | 242 |
| 61 | /images/top_right_bg.jpg | 200 | | 223 |
| 62 | /images/bg_intro_bottom.png | 200 | | 3562 |
| 63 | /images/favicon.ico | 200 | | 4458 |
| 64 | /images/btn_quick_setup.jpg | 200 | | 4353 |
| 65 | /images/bg_intro_top.png | 200 | | 3605 |
| 66 | /images/mt-link.gif | 200 | | 5823 |
| 67 | /images/link.gif | 200 | | 1045 |
| 68 | /images/del.gif | 200 | | 313 |
| ==69== | ==/images/Makefile== | ==200== | | ==593== |
| 70 | /images/icon_jia1.gif | 200 | | 490 |
| 71 | /images/blue.jpg | 200 | | 2584 |
| 72 | /images/normal.gif | 200 | | 10818 |
| 73 | /images/yandex.png | 200 | | 2159 |
| 74 | /images/bg_leftmenu.gif | 200 | | 686 |
| 75 | /images/icon_jia.gif | 200 | | 252 |
| 76 | /images/icon_now1.gif | 200 | | 487 |
| ==77== | ==/welcome.htm== | ==200== | | ==30155== |
| ==78== | ==/index.html== | ==200== | | ==326== |
| 79 | /help | 200 | | 166 |
| ==80== | ==/backup.htm== | ==200== | | ==1304== |
Potential locations of information:
After verification, we can find the following information in the file ==/version.txt==:

Extraction of this information was implemented using a Python script:

Currently, the following vulnerabilities have been found in this device, among which the vulnerability CVE-2023-38829 is a command injection vulnerability existing in the network testing module of the NETIS SYSTEMS Router WF2409E in the ping and traceroute functions. Through the web management interface, malicious commands can be injected into the parameters of these functions, leading to command execution.
To verify the presence of this vulnerability, I logged into the router's management panel and tested the vulnerability in the ping and traceroute functions.
Here I injected the command cd && ls && cd etc/ && cat passwd, which output the contents of the password file.
Below is the output of the router management panel upon command injection, confirming the presence of the vulnerability.

CVSS 3.1 analysis of the discovered command injection vulnerabilities:
Base Score Metrics:
Impact Metrics:


Final score: 9.2/10 points, which falls into the "critical" category. CVSS-Vector: AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:F/RL:O/RC:C
This high vulnerability score is due to the following reasons:
Let's first find files where vulnerabilities may exist:
find . -name "*.cgi" ./web/cgi-bin/cgitest.cgi ./bin/cgitest.cgi
I assume that vulnerabilities may appear in CGI programs, so I'll try to analyze the file ./web/cgi-bin/cgitest.cgi using IDA Pro.
First, we need to find places where similar functions are called. Through search, we found the string "killall ping".
When analyzing the call location, we can see that the program, after initializing the ping and traceroute functions, calls /bin/network_test.sh

And the vulnerability location is exactly in the network testing module. Good, we need to analyze /bin/network_test.sh.
First, we need to perform a search.

We find the network_test_sh function:
......

Upon detailed analysis of the function, command execution and result saving modules can be found.

In them: Ping command execution: ping -c %d -s %d %s -W %d > %s &
Traceroute command execution: traceroute -I -m %d %s > %s &
loc_4205B8: lw v0, 0x108+var_D4(sp) #прямая загрузка параметров lw a3, 0x108+var_D8(sp) la t9, sprintf #прямой вызов sprintf #отсутствует проверка параметров перед sprintf
## Installation
### Installation via Brew
```bash
brew install node
brew install wget
git clone https://github.com/khast3x/redcloud.git
cd redcloud
First, clone the repository:
git clone https://github.com/khast3x/redcloud.git
cd redcloud
Then run the dependency installation script:
./setup.sh
loc_420574: la $t9, sprintf #также прямой вызов sprintf lw $a2, 0x108+var_D0($sp) #также отсутствует проверка параметров
- **WAF Bypass Modules** - modules for bypassing WAF.
- **Protection Bypass** - bypassing protection (e.g., bypassing checks based on session cookies, Referer, User-Agent, certain headers, method-based download checks, Form-data content checks, basic authentication content checks).
- **Payload Encoder** - encoding payload to bypass protection.
- **Payload Patcher** - patching payload to bypass protection.
- **Event Based Bypass** - event-oriented bypass (e.g., for Perl-based protection, etc.).
```shell
git clone https://github.com/epsylon/xsser.git
cd xsser
python xsser.py --help
List of all modules and options:
-m or --modules Show all available modules.--see-modules Information about all prepared modules.git clone https://github.com/epsylon/xsser.git
cd xsser
python xsser.py --weak-links
Syntax, scenarios and examples:
https://xsser.03c8.net
Examples:
python xsser.py -u http://example.com -g "search=-->" --PhpIds "test" --Fuzz --Coo 'c=1' --Hdr 'User-Agent: Mozilla' --Htc 'text/html' --t 1 -vpython xsser.py --proxy tor -u http://example.com -g "search=-->" --PhpIds "test" --Fuzz --Coo 'c=1' --Hdr 'User-Agent: Mozilla' --Htc 'text/html' --t 1 -vpython xsser.py -u https://example.com -g "search=-->" --PhpIds "test" --Fuzz -vShort-Hand Syntax (demonstration):```
la $t9, run_by_system jalr $t9 ; run_by_system #прямой вызов system для выполнения команды move $a0, $s1 #отсутствуют проверки безопасности

The code lacks sufficient validation of input parameters, creating a potential risk of command injection. An attacker can control the transmitted IP parameter to execute shell commands, for example:```
# Нормальный ввод 192.168.0.1
# Примеры вредоносного ввода
192.168.0.1; rm -rf / #удаление файлов
192.168.0.1 & id & #выполнение произвольных команд
This script exploits a command injection vulnerability in the device's web interface to remotely execute commands by crafting special HTTP requests. The script performs exploitation using two HTTP POST requests: the first request injects the command, the second retrieves the execution output.
The first packet (netcore_set.cgi) is intended for: injecting and executing the command

The second packet (netcore_get.cgi) is intended for: retrieving the command execution result

2. URL encoding of all parameters
3. Sending POST request to netcore_set.cgi
### 11.3 Second Stage: obtaining results
1. Forming the second POST request:```
{ "mode_name": "netcore_get",
"noneed": "noneed" }
To test the script, I created a file ceshi on the host and tried to upload it to the device via the script



Success!
In fact, this vulnerability allows full control over the device, since the device uses root access by default
| Checked Parameter | Status | Note |
|---|
| Power LED | Working | Steady on when powered |
| Network LEDs | Working | Blink when connected |
| WAN Port Status | Working | Normal network connection |
| LAN Port Status | Working | All 4 ports operational |
| WiFi Function | Working | Antennas intact, signal normal |
| WPS Function | Working | Button responds |
| Reset Function | Working | Default button works |
| No | Chip Model | Manufacturer | Main Function | Technical Specifications | Notes |
|---|
| 1 | EM63A165TS-6G | EtronTech | System Memory | - Capacity 32 Mbit - Frequency 166 MHz - Architecture SDRAM - Package TSOP-II | - Used for temporary data storage - Supports main processor computations |
| 2 | FR9886 61504 | Unknown | Power Management | - Package SOIC-8 - Integrated circuit | - DC-DC - Responsible for voltage regulation - Provides stable system power |
| 3 | RTL8196E | Realtek/RMC | Main Processor | - Architecture MIPS - SoC design - Made in Taiwan | - System's central processor - Handles main computations and management - Integrated network processing |
| 4 | MX25L3206E | Macronix | Flash Memory | - Capacity 32Mb (4MB) - Interface SPI - Package SOIC | - Stores system firmware - Retains configuration data |
| 5 | RTL8192ER | Realtek/RMC | Wireless Connectivity | - WiFi controller - Package QFN | - Processes wireless signals - Supports WiFi functions |
| Parameter | Value | Hexadecimal Value |
|---|
| Chip Model | MX25L3205D | - |
| Total Capacity | 4MB | 0x400000 |
| Block Size | 64KB | 0x10000 |
| Sector Size | 4KB | 0x1000 |
| Page Size | 256B | 0x100 |
| Service Name | Status | Note |
|---|
| DHCP Server | Running | Normal |
| HTTP Server (Boa) | Running | Abnormal reboots |
| IAPP | Running | IEEE 802.11f |
| MiniIGD | Running | v1.08.1 |
| mini_upnpd | Error | File not found |
| telnetd | Error | File not found |
| ota_init.sh | Error | File not found |
| Command | Syntax | Function |
|---|
| HELP | ? | Show help |
| DB/DW | DB/DW | Read memory bytewise/wordwise |
| EB/EW | EB/EW | Write to memory bytewise/wordwise |
| FLR | FLR | Read data from Flash to RAM |
| FLW | FLW <dst_ROM><src_RAM> | Write data from RAM to Flash |
| IPCONFIG | IPCONFIG | Set IP address |
| LOADADDR | LOADADDR | Set load address |
| CMP | CMP | Compare data in memory |
| J | J | Jump to execution |
| MDIOR/MDIOW | MDIOR/W [data] | Read/write PHY registers |
| PHYR/PHYW | PHYR/W [data] | Read/write PHY registers (alternative method) |
| PORT1 | PORT1 | Port 1 patch test |
| AUTOBURN | AUTOBURN 0/1 | Control automatic flashing |
| Command Type | Available Commands |
|---|
| Basic Commands | ., :, cd, help, exit |
| Execution Control | break, continue, eval, exec |
| Variable Operations | export, read, readonly, set, shift |
| Process Control | times, trap, wait |
| Permission Control | login, newgrp, umask |
| Category | Tools | Function |
|---|
| Network Tools | iptables ip6tables brctl ifconfig | Firewall configuration, IPv6 firewall, bridge management, network interface configuration |
| System Management | busybox ps kill mount | Core tool set, process viewing, process management, filesystem mounting |
| VPN Communication | pppd pptp l2tpd pptpctrl | PPP daemon, PPTP client, L2TP daemon, PPTP management |
| Wireless Management | iwcontrol iwpriv wlanapp.sh wps_init.sh | Wireless control, wireless private commands, wireless application management, WPS initialization |
| Firewall Scripts | firewall.sh firewall_ipv6.sh firewall_pptp.sh | Main firewall, IPv6 firewall, PPTP firewall |
| DHCP/DNS | dhcpc.sh dhcpd.sh dnrd | DHCP client, DHCP server, DNS forwarding |
| Web Service | boa webs cgitest.cgi | Web server, web management, CGI test |
| Path | Information Type | Description |
|---|
| /proc/cpuinfo | CPU Information | Detailed processor information |
| /proc/meminfo | Memory Information | System memory usage status |
| /proc/mtd | Partition Information | Flash memory partitioning |
| /proc/net/* | Network Information | Network interface and connection status |
| /proc/sys/* | System Parameters | Adjustable system parameters |
| /proc/version | Version Information | Kernel version information |
| Component | Description | Technical Specifications |
|---|
| RTL8196E | Main Processor | - MIPS architecture - SoC design - Made in Taiwan - Central processor of the system - Handles main computations and management - Built-in network processing functions |
| EM63A165TS-6G | System Memory | - Capacity 32 Mbit - Frequency 166 MHz - SDRAM architecture - Package TSOP-II - Temporary system data storage - Supports main processor computations |
| MX25L3206E | Flash Memory | - Capacity 32 Mbit (4 MB) - SPI interface - Package SOIC - Stores system firmware - Retains configuration data |
| RTL8192ER | Wireless Network | - WiFi controller - Package QFN - Processes wireless signals - WiFi support |
| FR9886 61504 | Power Management | - Package SOIC-8 - Integrated circuit - DC-DC - Responsible for voltage regulation - Provides stable system power |
| File | Offset (decimal) | Offset (hexadecimal) | Description | Additional Information |
|---|
| netis.bin | 4848 | 0x12F0 | LZMA compressed data | Dictionary size: 8388608 bytes, uncompressed size: 56464 bytes; requires analysis of uncompressed content |
| netis.bin | 206872 | 0x32818 | LZMA compressed data | Dictionary size: 8388608 bytes, uncompressed size: 3278684 bytes; contains full Linux 2.6.30 kernel |
| netis.bin | 1507328 | 0x170000 | SquashFS filesystem | Little-endian, gzip compression, size: 2628241 bytes |
| 0x170000 | ![]() |
| Payload | Code | Lenth |
|---|
| ==10== | ==/version.txt== | ==200== | ==206== |
| ==11== | ==/update.htm== | ==200== | ==1230== |
| ==32== | ==/index.htm== | ==200== | ==4336== |
| ==69== | ==/images/Makefile== | ==200== | ==593== |
| ==77== | ==/welcome.htm== | ==200== | ==30155== |
| ==78== | ==/index.html== | ==200== | ==326== |
| ==80== | ==/backup.htm== | ==200== | ==1304== |
| Vulnerability ID | Vulnerability Type | Model | Version | Report/Exploit |
|---|
| CVE-2023-42336 | sensitive information disclosure | Netis | wf2409e_firmware < 1.0.1.705 wf3409e < v4 | https://github.com/adhikara13/CVE/blob/main/netis_WF2409E/Root_Hard_Code.md |
| CVE-2023-38829 | remote code execution | Netis | wf2409e_firmware < 3.6.42541 wf3409e < - | https://github.com/adhikara13/CVE-2023-38829-NETIS-WF2409E |