Public IP DNS rebinding: Another reason not to use default passwords

 

Summary

DNS rebinding first appeared 15 years ago. It was a clever penetration technique until Web browsers were fixed. It now appears there is a workaround for the fix and residential gateway devices are the targets.

Events

IBM Technology Conference & Expo 2012
May 23, 2012

Convention Centre B2 Room at 22nd Floor, Centara Grand @ Central World, 999/99 Rama I Road, Pathumwan, Bangkok 10330

Echelon 2012
June 11 and 12, 2012

University Cultural Centre, National University of Singapore

Startup Asia Jakarta 2012
June 7 and 8, 2012

12th Floor, Annex Building, Wisma Nusantara Complex, Jl. M.H. Thamrin No. 59 Jakarta 10350, Indonesia

MMA Forum Singapore
April 23-25, 2012

Grand Hyatt Singapore

Craig Heffner, senior security engineer for Seismic LLC gave a talk at this year's Black Hat conference called "How to Hack Millions of Routers". A rather dramatic title, but his research uncovered an exploitable weakness.

Some background
The new attack leverages several concepts that aren't well known. With that in mind, I would like to step through the process in a bit more detail.

DNS was created because it's easier to remember words (domain names), than numbers (IP addresses). You type in a name and the Web browser asks the appropriate DNS server for the IP address. In IT-speak, that means there is a binding between the domain name and associated IP address.

What might not be known is that quite often more than one IP address is bound to the same domain name. This is to facilitate load balancing or redundancy for Web sites with critical uptime requirements. Using NS Lookup, one can see that Google has six IP addresses bound to Google.com:

Now let's look at how the attack works.

The original attack
The DNS-rebinding attack requires the bad guys to set up a malicious Web site. Or more insidiously, malicious Web ads that are published on trusted sites. For example, the New York Times was caught up in such an attack.

To help explain, let's say that example.com is such a Web site. The victim visits example.com, causing a client-side script or applet to be downloaded onto the victim's Web browser. Once entrenched, the attacker's Web application asks to create a connection with example.com, separate from the Web browser and hidden from the victim. The DNS server for example.com will then return the correct IP address for example.com, along with the private IP address of the victim’s computer.

Once that information is cached, the Web app asks for more information from example.com. Knowing what’s going on, the attacker's server responds with what is called a TCP reset. This is meant to deceive the supposedly legitimate Web application (set up by the script) into believing the first IP address used for example.com is not working. So the Web application checks its DNS cache and tries the second IP address for the domain name example.com.

Here's where it gets interesting. By using the second trusted IP address the malicious browser applet gains network-level access to the victim's computer. That means the attacker can establish a session with any Web server on the internal network if the Web server's private IP address is known.

Guess what uses Web servers--most network devices and Web-based email servers. All sorts of havoc can now be wreaked by the attacker.

Fixed the problem?
I mentioned earlier that this problem was fixed. Developers realized what was happening and changed how Web browsers handle DNS responses. If the response contains a non-routable (RFC 1918) IP address, the packet is to be dropped. This change negated the attack vector and it disappeared for years.

The new attack
It's common knowledge that configuration pages for residential network devices are accessed by entering the device's internal IP address in the Web browser. We now also know that spoofed DNS responses using private IP addresses are dropped.

So routers and such are safe now, right? Well maybe not. For some reason, you can enter the public or routable IP address of gateway devices/routers in the Web browser and gain access to the configuration Web page. Remember now, that http request is coming from a computer on the internal network.

What's more, this approach works regardless if public-side access has been disabled in the gateway. I have an ActionTec gateway on my perimeter, and I was able to access the configuration pages using the public IP as shown below:

Heffner and the people at Seismic diligently tested most residential gateway routers and have come up with the following list of secure and vulnerable devices or third party firmware:

What this means


This attack vector is unsettling because it's subtle. In most households, the gateway device provides DHCP information to all computers on the internal network. Besides providing the proper IP address for the computer, DHCP also publishes what DNS servers to use. If attackers gain access to the gateway device, they could change the DNS server entries to point to their malicious DNS servers and that's not good at all.

Prevention is simple
This attack requires knowing the username and password to access the gateway device's configuration Web pages. The bad guys are hoping the default settings are still in use. So, make it hard for them. Change the user name if possible and replace the default password with a nasty and hard to figure out one. That should stop the attackers.

Another option is to require each and every Web site to ask permission to load any kind of scripting. This is easy to do if you use the Firefox Web browser. Get the NoScript add-on. In fact, Giorgio Maone, NoScript's developer added a new feature in the latest version of NoScript. The feature is called Application Boundaries Enforcer and one of default rules prevents the DNS rebinding attack.

One final suggestion is to use well-respected DNS servers and hard code their IP addresses into the network adaptor's configuration. I use OpenDNS. Doing so eliminates this and many other DNS-related exploits.

Final thoughts
Heffner's public IP rebinding attack is dangerous when successfully applied. Fortunately, it's complex to pull off and easily thwarted. All we have to do is get people to stop using default login credentials. Please spread the word.

Michael Kassner has been involved with with IT for over 30 years. Currently a systems administrator for an international corporation and security consultant with MKassner Net.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment

ZDNet Asia Live

Integration, focused investments to propel Windows Phone: By Kevin Kwang , ZDNet Asia on May 23, 2012 (2 mins ag... http://t.co/aaa0Cb73

Homegrown smartphone OSes gaining favor in China http://t.co/lOBVp1T6

Homegrown smartphone OSes gaining favor in China: 59 Jakarta 10350, Indonesia Locally-made mobile operating syst... http://t.co/gHypbdIY

Integration, focused investments to propel Windows Phone - ZDNet Asia http://t.co/7sZi6Dhb

RT @zdnetasia: Homegrown smartphone OSes gaining favor in China. http://t.co/lL8KbccW

Big data acquisitions pave way to fast, effective innovation - ZDNet Asia http://t.co/ky8YgPAn #Bigdata #analytics via @ciropuglisi

Big data acquisitions pave way to fast, effective innovation - ZDNet Asia: Big data acquisition... http://t.co/r6taCmG1 #ITNews #BigData

Big data acquisitions pave way to fast, effective innovation - Zd Net http://t.co/d9k21ro5: David G... http://t.co/4JgaOz8g #bigdata #sna

Big data acquisitions pave way to fast, effective innovation - Zd Net http://t.co/fbori8UQ: Incr... http://t.co/nuEeUbj7 #ITNews #BigData

Big data acquisitions pave way to fast, effective innovation - ZDNet Asia http://t.co/iFQ74xYI #Bigdata #analytics

@ChemarieMonica : Integration, focused investments to propel Windows Phone - ZDNet As... http://t.co/ZVPDpbxH http://t.co/1QrdIsaV #tech

China social media companies have global potential
http://t.co/p8fkRbfD Chinese social media companies such as #Renren and #Sina might...

China social media companies have global potential
http://t.co/Y3x1qBI1 Chinese social media companies such as #Renren and #Sina might...

#radio Radio United Kingdom by EnjoyIT 1.0 http://t.co/YoV1dcFJ

#radio Radio United Kingdom by EnjoyIT 1.0 http://t.co/CbzcXPPO

So much as we know , MTK6575 extremely integrated frequency1GHz ARM Cortex-A9 processor, the superiority of 3G / HSPA Modem, and help the...

1 day ago by y15822137359 on 5 SaaS adoption speed bumps to avoid

I reckon your view: "CRM is strategy, not software", if a company replicating the approach uses in ERP implementation into CRM, what they...

2 days ago by wykoong on Gartner: Mobile CRM gives better ROI than social

This video will teach you about the Excel fill handle but also provide you with a workook to download... http://www.youtube.com/watch?v=...

3 days ago by TradeBrother on A quick fill handle trick for Microsoft Excel

waiting...

5 days ago by eapete on What should count in a company's market value?

Boy, you've opened a can of worms now.

Wait for the rants & raves.

5 days ago by eapete on What should count in a company's market value?

I was puzzling before this whether to replicate the success formula we executed for a financial institute, and come out with a standard s...

5 days ago by wykoong on Drop the egos, copy ideas, then innovate