Categories: Hacking

Root access backdoor discovered in Chinese Tenda Wireless Routers

Craig Heffner has discovered a new backdoor in the Wireless Routers produced by China based networking device and equipment manufacturer Tenda Technology.

Just a week ago I wrote on a serious backdoor found by researcher Craig Heffner within the D-Link routers, today I’m here describing a new flaw discovered in the Wireless Routers produced by China based networking device and equipment manufacturer Tenda Technology (www.tenda.cn).
The intriguing analysis, titled “From China, with Love” is published on the blog “/dev/ttyS0” specialized on the embedded device hacking. D-Link is not the unique vendor that puts backdoors in its products, Heffner has unpacked the software framework update for the Tenda Technology device, and locating the httpd binary has found that the manufacturer is using GoAhead server.In reality he notes a modification in the server itself.
The researcher discovered that despite Tenda Technology routers are protected with security protocols WPS and WPA, an attacker just sending a specifically crafted UDP packet is able to block them. Craig Heffner has found a flaw in the httpd component, the MfgThread() function instantiates a service that listens for incoming messages containing commands to execute, this means that an attacker within a local network is able to send commands to the router that it executes with root privileges.

“The thread then goes into a recvfrom loop, reading up to 128 bytes from the socket. It expects each received UDP packet to be at least 14 bytes in length:””We can see that the thread is expecting a packet with the following structure:”

struct command_packet_t
{
    char magic[10]; // 9 byte magic string ("w302r_mfg"), plus a NULL terminating byte
    char command_byte;
    char command_arg[117];
};

The Tenda Technology backdoor only listens on the LAN and it is not exploitable from the WAN, however hackers can exploit it over the wireless network if the victim has WPS enabled by default with no brute force rate limiting.

The service expects a packet starts with the string “w302r_mfg”, the code then compares the specified command byte against three ASCII characters (’1′, ‘x’, and ‘e’) associated with the following commands:

  • ‘e’ – Responds with a pre-defined string, basically a ping test
  • ’1′ – Intended to allow you to run iwpriv commands
  • ‘x’ – Allows you to run any command, as root
 

Resuming the attacker just needs to run the command on UDP port 7329 to gain the root access, following the Telnet command used

echo -ne “w302r_mfg\x00x/bin/busybox telnetd” | nc -q 5 -u 7329 192.168.0.1

Within the Telnet command is clearly visible the string “w302r_mfg” that is interpreted by the backdoor service. Some of the vulnerable routers are W302R and W330R as well as re-branded models including the Medialink MWN-WAPR150N.

An Nmap NSE script is available to test for the backdoored routers.

Pierluigi Paganini

(Security Affairs –  Tenda Technology, hacking, backdoor)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

Law enforcement dismantled the infrastructure behind Lumma Stealer MaaS

Microsoft found 394,000 Windows systems talking to Lumma stealer controllers, a victim pool that included…

33 minutes ago

Russia-linked APT28 targets western logistics entities and technology firms

CISA warns Russia-linked group APT28 is targeting Western logistics and tech firms aiding Ukraine, posing…

3 hours ago

A cyberattack was responsible for the week-long outage affecting Cellcom wireless network

Cellcom, a regional wireless carrier based in Wisconsin (US), announced that a cyberattack is the…

13 hours ago

Coinbase data breach impacted 69,461 individuals

Cryptocurrency exchange Coinbase announced that the recent data breach exposed data belonging to 69,461 individuals.…

20 hours ago

U.S. CISA adds Ivanti EPMM, MDaemon Email Server, Srimax Output Messenger, Zimbra Collaboration, and ZKTeco BioTime flaws to its Known Exploited Vulnerabilities catalog

U.S. Cybersecurity and Infrastructure Security Agency (CISA) adds Ivanti EPMM, MDaemon Email Server, Srimax Output…

24 hours ago

A critical flaw in OpenPGP.js lets attackers spoof message signatures

A critical flaw in OpenPGP.js, tracked as CVE-2025-47934, lets attackers spoof message signatures; updates have…

1 day ago