ISP typo pimping exposes users to fraudulent web pages
Provider in the middle attacks
ToorCon Comcast, Verizon and at least 70 other internet service providers are putting their customers at serious risk in their quest to make money from mistyped web addresses, security researcher Dan Kaminsky says.
Speaking at the ToorCon security conference in Seattle, Kaminsky demonstrated an exploit class he dubbed PiTMA, short for provider-in-the-middle attacks. A variation of man-in-the-middle attacks, it stole authentication cookies and injected arbitrary content into trusted web pages by exploiting weaknesses in an ad server Earthlink used when returning results for non-existent addresses.
Once upon a time, mistyped domain names resulted in a browser returning a simple DNS lookup error (not a 404 error, as incorrectly reported in an earlier version of this story) that said the address didn't exist. Then ISPs realized they could make money by returning a failure notice that included banner ads and other content. This ad injection is done through the magic of the domain name system. As a result, browsers get fooled into thinking a request for qww.microsoft.com is a legitimate address that's controlled by the same network responsible for www.microsoft.com.
"Guys, anything goes wrong on that subdomain [and] it is an element of the parent," Kaminsky said. "It can access cookies, it can do other things. Normally a subdomain is trusted by the parent. Not this time."
(Slides of the research, which was developed jointly by IOActive researchers Kaminsky and Jason Larsen, are available here.)
Pages that ISPs return for non-existent pages, for example fake.theregister.co.uk, are able to circumvent the so-called same origin policy, which prevents cookies and other types of content set by one domain from being accessed or manipulated by a different address.
Kaminsky's demo relied on an easily exploited cross site scripting (XSS) error in an ad server run by a company called BareFruit, which Earthlink and other ISPs pay to return results for non-existent pages. The flaw meant users of any ISP using the service were at risk of having virtually any website on the internet spoofed by a malicious attacker with knowledge of the vulnerability.
When notified of the error, "BareFruit defecated masonry" and "fixed the bug in about 27 minutes after they heard what they were up to," Kaminsky said.
Even though the specific problem has been corrected, similar ad servers are likely also vulnerable, Kaminsky said, imperiling large swaths of internet. He said the practice should serve as a strong argument in favor of net neutrality, a concept that holds that ISPs should be barred from changing the content of pages they deliver.
"This is not actually rare. This is not a small thing," said Kaminsky added that at least 72 ISPs he's counted are engaged in the practice of spoofing domain names when returning non-existent web pages. They include Verizon, Comcast, and on a smaller scale, Cox and Qwest. "Small amounts of failed net neutrality can lead to catastrophic effects on internet security. Intent not actually required."
To bring home his point, Kaminsky showed how exploitation of the now-patched BareFruit bug allowed him to to return spoofed pages from Microsoft and just about any other web destination he chose. The forgeries are especially convincing because in every case the legitimate domain name appeared in the browser's address bar.
Kaminsky also managed to superimpose a video of Rick Astley on the legitimate web pages of Facebook, Fox News and even Toorcon. "Rick Rolling," as the practice of fooling people into viewing the insipid performer's videos, has grown into a common way to show off hacking and social engineering prowess.
"It's a peculiarly awesome point in one's career when it turns out you get to Rick roll the internet," Kaminsky said in an interview." ®
302 or 303
Isn't a 302 (Moved Temporarily) or 303 (See Other) status code the least bad way to implement this (although how many browsers implement 303 I don't know).
It could then redirect to a page which is clearly under the ISP's control.
Personally I think it should be up to the browser to deal with it rather than the ISP but I guess they don't want to pass up a revenue stream.
Re: Don't use ISP's nameserver
"Use opendsn.org perhaps?"
Don't OpenDNS use exactly the same sort of advertising trick to fund their servers?
@Steve - The idea being that they will redirected to a legitimate page on your domain
Should stick another field in DNS for the default address on the domain, or maybe even just register default.domain and change the resolvers.
So I'd register (for instance) www.microsoft.co.uk and default.microsoft.co.uk then matches for wwq.microsoft.co.uk would fail and get the default.microsoft.co.uk.
www.microsotf.co.uk would get the default address default.co.uk, which I guess would be hijackable again.
It'd mess up the people who already have domains with "default" in them though so a new DNS field for the default address on the domain would be better.