Re:Reverse Engineering a D-Link Backdoor
by ttctciyf on Saturday October 12, 2013 @10:16PM
(#6541214)
As a couple of reddit commenters point out, the user agent string that bypasses auth (according to the post) can be read backwards as "Edit by 04882 Joel Backdoor", and one possible Joel is CTO Alpha Networks, whose thttpd this appears to be.
I've no security expertise, but this seems cataclysmically bad!
Note how you could have a header some includes 'User-Agent:' somewhere back in the value, and the arrive with an entirely incorrect pointer to what you think is the value - strstr just finds the needle anywhere in the haystack, not necessarily at the beginning. This particular piece (AFAICT) cannot be exploited for e.g. overruns or similar, maybe just for a subsequent crash or unexpected behaviour due to lack of input sanitization, but still, crazy strstr juggling on untrusted user input? oh oh.
If the rest of this code looks like that, this should never, ever be exposed to the wild wild web.
Re:Reverse Engineering a D-Link Backdoor
by __david__ on Sunday October 13, 2013 @04:27PM
(#6544049)
So while you're right that the strstr() is lazy (should probably be a strncmp() or something), it's probably not that big of a deal in this particular case. The worst an attacker could do here is get a weird user agent string, which they could already do by just setting the User-Agent field to something weird...
Re:Reverse Engineering a D-Link Backdoor
by nicolast on Sunday October 13, 2013 @07:21AM
(#6542217)
Doesn't this mean if '/admin/factory_reset' normally requires authentication, requesting '/admin/factory_reset?_=graphic/' would bypass this without the need for custom headers...
Re:Reverse Engineering a D-Link Backdoor
by barrkel on Sunday October 13, 2013 @10:18AM
(#6542658)
Does anyone know how to view this page in desktop mode on any Android browser? The pictures are not fully visible, and I've tried AOSP, Chrome, Firefox, Phony Firefox extension. Nothing works...
Re:Reverse Engineering a D-Link Backdoor
by booop on Sunday October 13, 2013 @05:53AM
(#6542032)
I would guess for both good and evil.
The good reason being able to login to the router to reset the password if the customer forgot it (I remember some home/small office routers don't reset the admin password when you use the reset button).
The evil reason being able to login remotely to any router and snoop around.
Re:Reverse Engineering a D-Link Backdoor
by homeomorphic on Sunday October 13, 2013 @09:33AM
(#6542531)
Sure, but all the adversary needs is for the user to visit a webpage that makes his/her browser contact the router (i.e. from within the LAN). If the adversary has to take into account defeating the user's password, this becomes an impractical attack. With the backdoor, however…
Re:Reverse Engineering a D-Link Backdoor
by smtddr on Sunday October 13, 2013 @10:40AM
(#6542723)
Well, I have a router that has remote-WAN-access disabled[1] ....and yet, if you type that (blurred out) IP:PORT into your browser you STILL get the prompt for user/pass. And if you type it correctly, you STILL access my router!!!!! So if my router has the same kind of UserAgent:roodkcabvogasn backdoor, I'm screwed.
I really should get a new router... like...very soon.
Also, I'm a conspiracy-nut and I think a significant amount of these "bugs" happen on purpose.
I've no security expertise, but this seems cataclysmically bad!
Specific title: Senior Director-Chief Technology Office
Via: http://www.joesdata.com/executive/Joel_Liu_421313008.html
http://www.bloomberg.com/quote/3380:TT/profile
Where did you get "Joel"?
If the rest of this code looks like that, this should never, ever be exposed to the wild wild web.
The good reason being able to login to the router to reset the password if the customer forgot it (I remember some home/small office routers don't reset the admin password when you use the reset button).
The evil reason being able to login remotely to any router and snoop around.
I really should get a new router... like...very soon.
Also, I'm a conspiracy-nut and I think a significant amount of these "bugs" happen on purpose.
1. http://i.imgur.com/W06W1oB.png