VPN DNS leak test
dnsleaktest.com
dnsleaktest.com
Casting aside actual "vulnerabilities" (like buffer overflows, bad encryption, etc...), why can't a software VPN act just like a hardware VPN? Take every byte of traffic sent to a network device, and tunnel it to another endpoint?
I'm assuming there are several major reasons that I don't know about that makes what seems like a really trivial problem super difficult...
The network traffic is totally taken.
The problem here is OTHER SOFTWARE running on the computer that also has visibility into the OS. For example, browsers with p2p connections will enumerate all network interfaces - including your actual adapter's IP
The simplest solution is working in VMs, with a VPN client running in the host. VMs have only virtual/internal and VPN IPs, so there's nothing sensitive to leak. Or you can use pfSense VMs as VPN gateways. Indeed, you can use a few of them, to create nested VPN chains. Also Whonix, for Tor connectivity.
You have to set up routing tables to decide which interface to use for which destination address. Obviously you can't direct VPN packets via VPN - that would be circular. They have to use your normal, physical connection to get to your default gateway. But what if your default gateway is also a local DNS server? You can't differentiate protocols in routing table.
Hardware VPN have it easier - they already know which packets to tunnel because it has designated hardware port for internal network.
I can see why it can so quickly become a giant mess...
Assuming it's the OS that needs to "fix" this, are there any changes either already made or in the works to better address this use case, or is a hardware VPN still going to be the only "real" way to securely tunnel a system for the foreseeable future?
Software can do the equivalent of ifconfig | grep addr, software can print the routing table (and therefore get all gateways)
A really basic thing to do would just be to drop all traffic not destined toward your VPN endpoint, so leaks would fail and/or be logged, but this still doesn't solve the fact that _other software running on your computer can enumerate all your interfaces for IPs and MAC addrs and gateways_
If you do it one layer up, you solve the software problem. Software and software on generally on same layer, so equally access, at least in usual conditions
Of course, introducing custom kernel driver and/or your own mini IP stack is way harder to do in a safe way - that's why it's not usually included.
As for Linux solutions - I haven't seen VPN client that used this technique, but I guess it's a lot easier, since all the required userland tools are already there.
Create VPN, spin up network namespace, move tunnel interface to network namespace, start resolver in that namespace, start VPN'ed applications in that namespace. if-up scripts for OpenVPN can do this for you[0].
As long as you operate the tunnel interface and the genuine network interface side by side some applications may simply decide to ignore default routes and explicitly bind to specific network interface. There are valid reasons to do so. For proper isolation you need to hide all the non-VPN interfaces.
[0] https://www.synkretie.net/writings/easy%20namespaced%20openv...
The usage you mention is the roadwarrior, where the physical network is untrusted and you want to route all traffic through the server. This is what commercial VPN providers provide.
The other use case is routing a set of domains though the tunnel, since the local network is trusted. This is useful when you are at home with your personal computer and want to access the work's LAN, but still want YouTube or large traffic to keep going through the local network. Since you are not exclusively bound to an uplink, you can have multiple VPN of this type connected that "expose" different sets of domains. This is possible if you dig through docs, since everyone and their mother are trying to do the other kind.
[1]: https://curl.haxx.se/docs/manpage.html#--proxy [2]: https://github.com/git/git/blob/20fed7cad40ed0b96232feb82812... [3]: http://docs.python-requests.org/en/master/user/advanced/#soc...
ssh -D 9999 -q -N <your ssh server>
and then configure that in the firefox proxy settings (socks to localhost:9999). If you want a simple way to enable/disable this in firefox I built a minimal extension to do it:https://addons.mozilla.org/en-US/firefox/addon/proxyswitcher...
The defaults in the config already match that ssh line so all you need to do is press the globe button to enable the proxy.
When I tried shadowsocks and enabled "proxy dns" in Firefox, every website became painfully slow. Is this simply because no DNS cache had been built?
Edit → Preferences → Network → Settings → Proxy DNS when using Socks v5
But yeah, it's not the default. :\
The only clue I have is that they're trying to resolve a bunch of fake domain names (which show up as unresolveable in the console).
The webpage has the IP addresses written directly into it (so clearly the data came from the server) which means there's nothing I can investigate (eg, in JS) from my end.
What's going on?
via https://www.dnsleaktest.com/what-is-the-difference.html
Basically it's sending you unique subdomains and then in turn seeing what IP addresses DNS requests come from. Since the subdomains are tied to you, it can tie the requests from the DNS servers you're using back to you.
Google has ~7ms response time for me though. Even my ISP's nameservers are slower than that :( the average everywhere else is 200ms (yup).
My internet is slow enough that this makes it a tiny bit more annoying.
But you make a very valid point, and... sigh convenience is such an hacked catalyst nowadays :(
Unless you're the tinfoil-hat wearing type who believes they're lying, their privacy policy looks pretty good to me.
One way to ensure that DNS responses have not been tampered with is to use DNSCrypt [2].
Can someone confirm that I understand this correctly : if I don't use DNSCrypt and if my DNS responses are tampered with in a phishing attempt, on a site that uses https, the browser will raise a cert error since the attacker won't have a valid certificate. So phishing attempts by spoofing DNS responses are only effective when the site uses plain http.
[0] https://www.dnsleaktest.com/what-is-transparent-dns-proxy.ht...
For what it's worth though, a modern openvpn configuration can beat it handily. An example of a service that passes with flying colors is ProtonVPN, which I just checked last night since they've got a crazy discount going right now.