“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:
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.
(Security Affairs – Tenda Technology, hacking, backdoor)