Linksys routers under attack from self-replicating malware
Posted by: Jon Ben-Mayor on 02/17/2014 11:48 AM
[
Comments
]
The ongoing attack has infected at least 1000 routers, but this number will grow due to the nature of the worm; it looks to infect other home and small-office wireless routers.
Johannes B. Ullrich from the SANS Technology Institute warns of the attack in detail and indicates that pretty much the whole E series of Linksys wireless routers are at risk due to this code-execution vulnerability.

The worm will connect first to port 8080, and if necessary using SSL, to request the "/HNAP1/" URL. This will return an XML formatted list of router features and firmware versions. The worm appears to extract the router hardware version and the firmware revision. The relevant lines are:
E2500
1.0.07 build 1
(this is a sample from an E2500 router running firmware version 1.0.07 build 1)
Next, the worm will send an exploit to a vulnerable CGI script running on these routers. The request does not require authentication. The worm sends random "admin" credentials but they are not checked by the script. Linksys (Belkin) is aware of this vulnerability.
This second request will launch a simple shell script, that will request the actual worm. The worm is about 2MB in size, samples that we captured so far appear pretty much identical but for a random trailer at the end of the binary. The file is an ELF MIPS binary.
Once this code runs, the infected router appears to scan for other victims. The worm includes a list of about 670 different networks (some /21, some /24). All appear to be linked to cable or DSL modem ISPs in various countries.
An infected router will also serve the binary at a random low port for new victims to download. This http server is only opened for a short period of time, and for each target, a new server with a different port is opened.
We do not know for sure if there is a command and control channel yet. But the worm appears to include strings that point to a command and control channel. The worm also includes basic HTML pages with images that look benign and more like a calling card. They include images based on the movie "The Moon" which we used as a name for the worm.
We call this a "worm" at this point, as all it appears to do is spread. This may be a "bot" if there is a functional command and control channel present.
Indicators of compromise:
- heavy outbound scanning on port 80 and 8080.
- inbound connection attempts to misc ports < 1024.
Detecting potentially vulnerable system:
echo "GET /HNAP1/ HTTP/1.1rnHost: testrnrn" | nc routerip 8080
if you get the XML HNAP output back, then you MAY be vulnerable.

The worm will connect first to port 8080, and if necessary using SSL, to request the "/HNAP1/" URL. This will return an XML formatted list of router features and firmware versions. The worm appears to extract the router hardware version and the firmware revision. The relevant lines are:
(this is a sample from an E2500 router running firmware version 1.0.07 build 1)
Next, the worm will send an exploit to a vulnerable CGI script running on these routers. The request does not require authentication. The worm sends random "admin" credentials but they are not checked by the script. Linksys (Belkin) is aware of this vulnerability.
This second request will launch a simple shell script, that will request the actual worm. The worm is about 2MB in size, samples that we captured so far appear pretty much identical but for a random trailer at the end of the binary. The file is an ELF MIPS binary.
Once this code runs, the infected router appears to scan for other victims. The worm includes a list of about 670 different networks (some /21, some /24). All appear to be linked to cable or DSL modem ISPs in various countries.
An infected router will also serve the binary at a random low port for new victims to download. This http server is only opened for a short period of time, and for each target, a new server with a different port is opened.
We do not know for sure if there is a command and control channel yet. But the worm appears to include strings that point to a command and control channel. The worm also includes basic HTML pages with images that look benign and more like a calling card. They include images based on the movie "The Moon" which we used as a name for the worm.
We call this a "worm" at this point, as all it appears to do is spread. This may be a "bot" if there is a functional command and control channel present.
Indicators of compromise:
- heavy outbound scanning on port 80 and 8080.
- inbound connection attempts to misc ports < 1024.
Detecting potentially vulnerable system:
echo "GET /HNAP1/ HTTP/1.1rnHost: testrnrn" | nc routerip 8080
if you get the XML HNAP output back, then you MAY be vulnerable.
Comments