Bypassing a DNS man-in-the-middle attack against Google Drive
varnull.adityamukerjee.net
varnull.adityamukerjee.net
Secondly, imagine sharing a bus with someone pulling down tens of gigs of files from Google Drive over a shared cellular or satellite connection. They are watching out for everyones experience, not just yours. If you need to get work done, they don't prevent you from bringing your own dedicated connectivity.
The way it seems to me, they are intercepting outgoing DNS requests that should be queried against Google's DNS servers, since I had "8.8.8.8" and "8.8.4.4" in my /etc/resolv.conf.
Is that not correct?
> Secondly, imagine sharing a bus with someone pulling down tens of gigs of files from Google Drive over a shared cellular or satellite connection.
The solution to that would be to throttle speeds or bandwidth for each connected device, rather than block all access to specific domains. In my case, I just needed to read a static text document (a "Google Doc").
Calling it an "attack" is disingenuous and sensationalist.
> The solution to that would be to throttle speeds or bandwidth for each connected device
That is a pretty slippery slope. You are escalating from blocking some DNS records to doing deep packet inspection of all traffic. You also have no idea what the operating requirements are (maybe they don't have {financial,computational,power} budget to do it your way?).
Again, bring your own connectivity and you get to make the rules. Use someone else's bandwidth, and they make the rules.
Also, blocking a site that sometimes does and sometimes doesn't use a lot of bandwidth, instead of just blocking all uses of lots of bandwidth by measuring it in a destination-agnostic way, is clearly the worse option.
Finally, rules and restrictions on technological devices and connectivity are retarded world-round. Your personal gadgets, your home internet connection, your phone's internet connection, all have ridiculous restrictions that no self-respecting technically savvy person follows (although most don't realize all the things they do that are against the "terms of service"). I don't get too worked up about them anymore, just systematically work around any I run into, just like any sane technically proficient person.
Wait, what? If they have cheaper hardware and can't invest in more now, that certainly is an issue, but traffic shaping per device does not require deep packet inspection.
Perhaps they should have managed that process better / more transparently.
But you should dial back the entitlement. This "I just needed"..., and then there's the "Well, I'm going to get around it anyway, since it's obviously blocked".
Not that you're completely wrong, but he is most likely paying to be there. If the company advertised the WiFi as part of the deal, and he paid for it, I'd say he is at least a little entitled to it.
I generally don't find /etc/hosts to be a sustainable answer against DNS hijacking, at least on hostile networks. For one thing, one-off hosts entries can cause you quite a lot of grief if Google chooses to change up what machines they host various services on; it may well also result in degraded performance if they use geoDNS to give you a lower-latency machine based on where you are accessing from.
But, more than that, even though "most" of my applications are SSL, if I know a network to be hostile, I would rather have absolutely none of my traffic passing through them unencrypted. If you have a machine somewhere to run OpenVPN on, that's probably the safest thing to do; I've mine listening on TCP port 443, as well as the standard UDP port 1194.
There are times when /etc/hosts is your best workaround -- such as a network that you generally trust, but which has some filtering that you need to work around. (Work networks often qualify for this.) But in the case of a truly hostile network, OpenVPN is probably your friend.
Completely agreed. Unfortunately, this requires preparation in advance.
Thankfully, this was just for a short bus ride - I actually changed it back immediately after loading the Drive homepage.
How much overhead does OpenVPN add? I've used it a bit on reasonably fast networks, but I'm curious if it would be too slow to use here.
In UDP mode, I think you lose only 70-ish bytes per packet, which isn't too bad.
(Another win that you get is roaming: if your local IP keeps changing, perhaps because your bus's cell modem keeps dropping out, then you don't lose your SSH sessions.)
As a random aside, mosh (http://mosh.mit.edu/) is incredibly good at IP mobility. One of my favorite examples: I circumnavigated the globe in November of 2012, and used the same mosh session in San Francisco, Hong Kong, Singapore, Kuala Lumpur, Penang, Bangkok, and Istanbul. :-) mosh also provides predictive local echo, which has made working over high-latency links so much more pleasant.
(Alternatively, I just pull out my Nexus 7 with LTE support, and either turn on the portable wifi hotspot feature, or plug it into my laptop, and turn on USB tethering. Problem solved. :-P)
https://mikeash.com/ssh_socks.html
Though this might require some more work to avoid DNS MITM, because it only tunnels TCP.
They could stick hijack/block the traffic to the end server, but I suppose at that point you may as well give up and use a VPN.
Even my home network can't be trusted. Comcast hijacks DNS request to third party DNS servers.
Using a Digital Ocean droplet as a VPN is probably the same as driving to Fort Meade monthly and handing them a hard drive with your full upload and download streams for the month, but using an unknown provider from LEB feels like handing out 2 drives: one for no such agency, another for some guy with a lot less data to sift through, thus a greater disposition to look at my data.
* This was not a MITM attempt
* When traveling laptops, it's more secure to use DNSSEC + Unbound
* The author trusts Google with his data, which uses DNSSEC[1], but not DNSSEC because @tptacek said so - fair enough, I trust Dr Bernstein even more than tptacek - but it's a bit contradictory. He should be using OpenDNS which is the only major DNS provider of DNSCurve[2], instead of Google (8.8.8.8 and 8.8.8.4).
Also, note, all major DNS providers are collecting data: OpenDNS (also adds a few suspicious redirects when the URL doesn't exist), Google is the leader of world-data mining, etc. The most trustworthy DNS, according to the a research I did some time ago, was/is OpenNIC.
At home I run a dnsmasq + unbound (DNSSEC) + OpenNIC DNS's. On my laptop I have a similar configuration which uses by default a local unbound installation when joins every other network except mine.
[1] http://googleonlinesecurity.blogspot.cz/2013/03/google-publi...
I've heard captive portals on here eferred to as MITM attacks, and I think it's an accurate description of what's happening, regardless of the intent of the captor.
In this case, they were hijacking DNS requests that were explicitly being made to another provider (first OpenDNS, then Google), and returning their own results instead of OpenDNS's or Google's.
From a cryptographic perspective, I certainly would say that it fits the description of an MITM: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
> He should be using OpenDNS which is the only major DNS provider of DNSCurve[2], instead of Google (8.8.8.8 and 8.8.8.4).
Actually, I was using OpenDNS initially - I switched to Google because I thought that might be the source of the OpenDNS error I was getting (the very first screenshot - admittedly a bit small to read in the picture).
But it doesn't matter which DNS provider you use if they're hijacking traffic on port 53, which is what was happening here.
> The author trusts Google with his data, which uses DNSSEC[1], but not DNSSEC because @tptacek said so
It's not just "because tptacek says so" - it's because tptacek wrote a detailed critique comparing both services which I found convincing. I updated the post to link to tptackek's post that explains the issue in more detail; that's what I was referring to, but I couldn't find it at first when I wrote the post.
Not sure exactly that comparing DNSSEC (signatures == trust) and DNSCurve (encryption + signature but only hop_to_hop, not up to root.) makes sense, that's why I said above that unbound + OpenNIC (which I trust and support DNSCrypt).
Thanks for taking the time to reply
DNSCurve is more robust in that respect. It's very hard to tamper with the data stream other than to break it entirely.
Doing this can end up biting you in the butt in a few months time when Google move the service to a different place and you've forgotten to change the IP in hosts.
Certainly works as temporary solution - this is how I test some of my websites before I push them into production via DNS.
I'm pretty sure that name-based hosting is fairly common, especially for smaller websites...
$ dig drive.google.com
; <<>> DiG 9.8.3-P1 <<>> drive.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62437
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;drive.google.com. IN A
;; ANSWER SECTION:
drive.google.com. 300 IN A 74.125.226.225
drive.google.com. 300 IN A 74.125.226.238
drive.google.com. 300 IN A 74.125.226.231
drive.google.com. 300 IN A 74.125.226.228
drive.google.com. 300 IN A 74.125.226.224
drive.google.com. 300 IN A 74.125.226.227
drive.google.com. 300 IN A 74.125.226.232
drive.google.com. 300 IN A 74.125.226.226
drive.google.com. 300 IN A 74.125.226.229
drive.google.com. 300 IN A 74.125.226.233
drive.google.com. 300 IN A 74.125.226.230
;; Query time: 32 msec
;; SERVER: 192.169.1.1#53(192.169.1.1)
;; WHEN: Sun Jan 12 18:37:40 2014
;; MSG SIZE rcvd: 210