- Beware of Windows 10 DNS resolver and DNS Leaks
- Windows 8
- Windows 10
- Информационный портал по безопасности
- Избавляемся от DNS Leak в Windows 10 — свой userspace WFP-фильтр в виде OpenVPN-плагина
- Windows Filtering Platform
- Что такое утечка DNS (DNS leak) и как это предотвратить
- Что такое DNS?
- Как работает DNS?
- Что такое DNS Leak ?
- Как защититься от DNS Leak:
- Как вручную задать публичные DNS в Windows 10 :
- Избавляемся от DNS Leak в Windows 10 — свой userspace WFP-фильтр в виде OpenVPN-плагина
- Windows Filtering Platform
- Step by Step Guide to Prevent VPN DNS Leak in Windows 10
- Table of Content
- DNS Overview: what is it about?
- So, What is a DNS Leak and VPN DNS leak?
- How to do a DNS leak test ?
- How to Prevent DNS Leak
- How to Change DNS Server on Windows 10
- Always Perform A DNS Leak Test
- Conclusion:
- 6 ways to take control of your data Top 6 Data Security Predictions 2016
- Rachael Chapman
- Written By Rachael Chapman
Beware of Windows 10 DNS resolver and DNS Leaks
Aug 11, 2015 · 3 min read
TL;DR: Windows 10 DNS resolver sends DNS requests in parallel to all available network interfaces and uses the fastest reply to come. If you use DNS from the local network, this problem allows your ISP or a hacker with Wi-Fi ap to hijack your DNS records even if you use VPN.
Modern Windows versions add headaches to active V P N users. DNS resolver in earlier versions up to Windows 7 was predictable and made DNS requests in order according to DNS servers preference, just as all other OS. This could lead to DNS Leak only if the DNS server inside the tunnel didn’t reply in time or sent en error, which wasn’t that horrible.
Windows 8
With Windows 8 release, Microsoft added a pretty interesting function called ‘Smart Multi-Homed Name Resolution’ which was passed over in silence as I can say using Google. It’s enabled by default, and if it’s enabled, OS sends queries to all known DNS servers via all available network interfaces, binding query to the interface. That’s probably done to speed up DNS resolving in case of preferred server failure or timeout (1 second by default) so the answer from the second server would be immediately returned to the application. In this case, all your queries are leaked via network interface which allows your ISP or Wi-Fi ap owner to monitor all the websites you visit. DNS Leak is only possible if your route table allows to forward DNS queries via internet interface. This is a typical situation for 99% SoHo routers as they set up their own caching DNS servers on their local IP address.
This feature could be disabled via registry editor. You should add a DWORD value with the name
To the registry path
with any value except zero.
Windows 10
Even if Windows 8 and 8.1 send all your DNS requests via public interface, dns spoofing is hard to do because OS would use hijacked answer only if your main DNS server (which goes via encrypted VPN connection) is failed to respond.
Everything changed when it comes to Windows 10. Now OS not only just sends DNS requests to all interfaces, it even uses the fastest one response to receive. This allows your ISP or a hacker to hijack your DNS really easy and reliable. Moreover, you can’t disable ‘Smart Multi-Homed Name Resolution’ in Windows 10, registry key which worked for Windows 8.1 doesn’t work now.
The only acceptable (but not fully reliable) way to workaround this issue is to explicitly set DNS on your network interface somewhere out of your local segment, like well-known 8.8.8.8 but it won’t help for OpenVPN. The only way to avoid DNS leaks in OpenVPN is to use scripts which temporary disable all DNS on external interfaces.
UPD: earlier I recommended to use redirect-gateway option without def1 parameter for OpenVPN. It seems that Windows reverts default route back on every DHCP renew and all your traffic would bypass VPN connection in some time after connect. There is no good fix for OpenVPN yet.
UPD3: Plugin functionality has been integrated in OpenVPN 2.3.9. Use block-outside-dns option.
Информационный портал по безопасности
Информационный портал по безопасности » Информационная безопасность » Избавляемся от DNS Leak в Windows 10 — свой userspace WFP-фильтр в виде OpenVPN-плагина
Избавляемся от DNS Leak в Windows 10 — свой userspace WFP-фильтр в виде OpenVPN-плагина
Автор: admin от 5-10-2015, 02:53, посмотрело: 1 164
Как вы уже можете знать, резолвер DNS в Windows 10 отправляет DNS-запросы на все интерфейсы параллельно, что часто бывает либо просто неудобно, когда используется так называемый Split Tunneling и DNS внутри VPN-туннеля отдает внутренние адреса для внутренних ресурсов, а Windows не может понять, что к чему, либо и вовсе создает угрозу безопасности, как в случае утечки DNS через публичный Wi-Fi.
Решить проблему можно разными способами, например, временно добавив правила firewall для блокировки 53 порта на всех интерфейсах, кроме интерфейса VPN, либо установить на всех интерфейсах, кроме VPN, DNS в 127.0.0.1. Однако, эти способы вносят изменения, выдерживающие перезагрузку, поэтому, если во время работы VPN у вас случайно отключили электричество или VPN-демон просто упал, вы останетесь с неработающим интернетом. Ничего хорошего в этом нет.
Однако есть способ лучше, который вносит только временные изменения и не оставит пользователя без интернета.
Windows Filtering Platform
Начиная с Windows Vista, на замену устаревшим технологиям обработки трафика вроде NDIS, TDI и LSP приходит WFP — современная, легкая и удобная технология, которая работает как в режиме ядра, так и в пользовательском режиме. Современные версии Брандмауэра Windows как раз используют WFP, как и все сторонние файрволлы и антивирусы с возможностью проверки трафика.
Драйвер режима ядра может просматривать, модифицировать и логировать пакеты и просто поток данных, а userspace-фильтры могут пропускать, отбрасывать, задеживать или направлять трафик в ядерный драйвер, основываясь на информации из Ethernet-фрейма или IP-пакета и их заголовков, а также (на уровне ALE) интерфейса источника и назначения, ID процесса, полный путь к exe, и некоторой другой.
WFP-фильтр может добавлять постоянные фильтры, которые выживают после перезагрузки, даже если ПО, установившее их, не было больше запущено, временные фильтры, которые сохраняются после завершения программы, но не после перезагрузки, и сессионные, которые действуют только тогда, когда программа, создавшая их, все еще исполняется.
Фильтра пользовательского режима с сессионными фильтрами вполне достаточно для наших задач, а нам нужно:
- Запретить все исходящие пакеты от всех интерфейсов на порт 53 по UDP/TCP и IPv4/IPv6
- Разрешить любой трафик с TAP-интерфейса (-ов) OpenVPN
Все это вылилось в плагин для OpenVPN, однако исходный код может быть собран и как обычный исполняемый файл:
github.com/ValdikSS/openvpn-fix-dns-leak-plugin
Чтобы использовать данный плагин, скачайте .dll-файлы из репозитория, положите их в папку config рядом с конфигурационным файлом, и добавьте в него строку:
для 32-битной системы и 32-битной версии OpenVPN, или
соответственно для 64-битной системы с 64-битным OpenVPN.
Теперь можно не бояться использовать VPN на Windows 10 через публичный Wi-Fi.
Что такое утечка DNS (DNS leak) и как это предотвратить
Что такое DNS?
Это Система доменных имен (Domain Name System), с помощью которой любому IP (например, 62.212.95.68) можно присвоить доменное имя (например, ipleak.com). DNS имеет собственные сервера и использует иерархическую систему для запросов.
Как работает DNS?
Когда вы вводите адрес сайта (напр., www.ipleak.com), происходит обращение к DNS-серверу вашего провайдера для перевода доменного имени в IP (резолвинг), а при необходимости обращение передается к вышестоящим DNS-серверам.
Что такое DNS Leak ?
Это утечка IP ближайшего к вам DNS-сервера, которая может происходить при резолвинге. DNS-запросы могут идти в обход вашего Proxy/VPN/TOR-подключения, то есть напрямую к DNS-серверу вашего интернет-провайдера, что приведет к раскрытию вашего реального местонахождения.
Утечка DNS может происходить через браузер или дополнения в нем (Flash, Java, WebRTC, Silverlight. ).
Как защититься от DNS Leak:
Принудительно указать нужные DNS-сервера в настройках подключения.
Установить специальные программы-проксификаторы, которые перехватывают все DNS-запросы и перенаправляют их через ваш Proxy/VPN/TOR.
Отключить сторонние плагины — Flash, Java, WebRTC, Silverlight.
Использовать утилиты для сокрытия IP и шифрования трафика со встроенной защитой от DNS Leak (например, DNS Leak Guard в Privatix).
Как вручную задать публичные DNS в Windows 10 :
Зайдите в “Control Panel (Settings)” Windows.
Откройте “Network & Internet”.
Найдите кнопку “Change Adapter Settings”. Это может быть Ethernet (если вы работаете через роутер) или другое подключение.
Кликните правой кнопкой мышки на сетевое подключение к вашему провайдеру и выберите “Properties”.
Затем выберите ваш протокол соединения: “IPv4” или “IPv6”.
Избавляемся от DNS Leak в Windows 10 — свой userspace WFP-фильтр в виде OpenVPN-плагина
Как вы уже можете знать, резолвер DNS в Windows 10 отправляет DNS-запросы на все интерфейсы параллельно, что часто бывает либо просто неудобно, когда используется так называемый Split Tunneling и DNS внутри VPN-туннеля отдает внутренние адреса для внутренних ресурсов, а Windows не может понять, что к чему, либо и вовсе создает угрозу безопасности, как в случае утечки DNS через публичный Wi-Fi.
Решить проблему можно разными способами, например, временно добавив правила firewall для блокировки 53 порта на всех интерфейсах, кроме интерфейса VPN, либо установить на всех интерфейсах, кроме VPN, DNS в 127.0.0.1.
Однако, эти способы вносят изменения, выдерживающие перезагрузку, поэтому, если во время работы VPN у вас случайно отключили электричество или VPN-демон просто упал, вы останетесь с неработающим интернетом. Ничего хорошего в этом нет.
Однако есть способ лучше, который вносит только временные изменения и не оставит пользователя без интернета.
Windows Filtering Platform
Начиная с Windows Vista, на замену устаревшим технологиям обработки трафика вроде NDIS, TDI и LSP приходит WFP — современная, легкая и удобная технология, которая работает как в режиме ядра, так и в пользовательском режиме. Современные версии Брандмауэра Windows как раз используют WFP, как и все сторонние файрволлы и антивирусы с возможностью проверки трафика.
Драйвер режима ядра может просматривать, модифицировать и логировать пакеты и просто поток данных, а userspace-фильтры могут пропускать, отбрасывать, задерживать или направлять трафик в ядерный драйвер, основываясь на информации из Ethernet-фрейма или IP-пакета и их заголовков, а также (на уровне ALE) интерфейса источника и назначения, ID процесса, полный путь к exe, и некоторой другой.
WFP-фильтр может добавлять постоянные фильтры, которые выживают после перезагрузки, даже если ПО, установившее их, не было больше запущено, временные фильтры, которые сохраняются после завершения программы, но не после перезагрузки, и сессионные, которые действуют только тогда, когда программа, создавшая их, все еще исполняется.
Фильтра пользовательского режима с сессионными фильтрами вполне достаточно для наших задач, а нам нужно:
- Запретить все исходящие пакеты от всех интерфейсов на порт 53 по UDP/TCP и IPv4/IPv6
- Разрешить любой трафик с TAP-интерфейса (-ов) OpenVPN
Все это вылилось в плагин для OpenVPN, однако исходный код может быть собран и как обычный исполняемый файл:
github.com/ValdikSS/openvpn-fix-dns-leak-plugin
Чтобы использовать данный плагин, скачайте .dll-файлы из репозитория, положите их в папку config рядом с конфигурационным файлом, и добавьте в него строку:
для 32-битной системы и 32-битной версии OpenVPN, или
соответственно для 64-битной системы с 64-битным OpenVPN.
Теперь можно не бояться использовать VPN на Windows 10 через публичный Wi-Fi.
UPD: В OpenVPN 2.3.9 появилась опция для блокирования сторонних DNS: block-outside-dns . Используйте ее, а не плагин.
Step by Step Guide to Prevent VPN DNS Leak in Windows 10
Table of Content
DNS Overview: what is it about?
You might be wondering what a DNS is, yet you have been using the internet all this time. A DNS (Domain Name System) refers to a system that associates URLs with IP addresses. Usually, when you are visiting a website, your browser such as Chrome, will send a request to a domain name system with the URL you have just typed in – then the URL will be directed to the desired IP address.
So, What is a DNS Leak and VPN DNS leak?
Normally, the internet service providers (ISPs) are the ones who assign DNS servers. This simply means that they have the power to monitor as well as record each and every activity you conduct online as long as a request is sent to a server. Connecting to the internet through a VPN means that the domain name service request is directed to an unspecified domain name system server via the VPN. This is what keeps you anonymous while connecting to different websites. However, there are some unfortunate occasions when your operating system (specifically Windows) will ignore the VPN tunnel and send the request to a DNS server from your browser. This occurrence is what is referred to as a VPN DNS leak. Once a DNS leak occurs, you will no longer be anonymous and your ISP surveillance, hackers and all sorts of online criminals will be able to track your activities.
How to do a DNS leak test ?
The best way to test for a DNS leak is to do it through www.dnsleaktest.com. When you visit the website, you will be presented with the following depending on your IP address:
There are two tests that you can perform: the Standard Test and the Extended Test.
- The Standard Test carries out one round of six queries for a sum of six, which should be more than enough to pinpoint a DNS leak. This is the faster of the two tests.
- The Extended Test carries out six rounds of six queries for a sum of thirty six queries. This test is highly effective for unveiling all possible DNS leaks.
How to Prevent DNS Leak
1. Go for a VPN with In-Built DNS Leak Protection
This is the best as well as the simplest method of stopping/ preventing a DNS leak. The only problem with this method is that only handful VPN providers have such abilities. VPN providers with in-built DNS leak protection also feature internet kill switch.
2. Pro Version VPN is The Best
If you truly want to protect yourself against any VPN connection failure, then you have to go for the Pro version of a VPN provider. The Pro version package consists of a DNS leak fix, such as Stop DNS leaks; in addition to clean and fresh static private IP, dedicated private VPN node; dedicated bandwidth of 1 GBPS; and 20+ concurrent connections.
3. Change DNS Servers and Get a Static IP
The main benefit of changing DNS servers is ensuring that your internet service provider does not track you. You can always direct your request via a public DNS server. Some of the public DNS servers you can use are
- Comodo Secure DNS
- OpenDNS and
- Google Public DNS.
How to Change DNS Server on Windows 10
- Locate the network connections symbol and right-click on it; then open Network and Sharing Center.
- Under Network and Sharing Center click on Change Adapter Settings.
- Click on Ethernet and choose Properties and access the Internet Protocol Version 4 (TCP/IPv4)
- Double click on TCP/IPv4 and you will be presented with list of static IP information. It does not matter if yours is static or dynamic, since you can still set the IP address of the DNS server. Therefore, just make sure you check the boxes.
- You have to make sure that you use DNS server addresses that are in use and not just any kind.
- So, open command and input the various details as demonstrated on the image below.
- Based on the tests above the DNS that picks up is 75.75.75.75; so you can go ahead and use that DNS address if you want.
- You can also use the secondary one, which is 8.8.8.8 under alternative DNS server address.
- Check the Validate settings upon exit box and press OK.
- The system is going to do a quick detecting problems scan and when it is done you will have successfully changed the DNS server.
Always Perform A DNS Leak Test
As mentioned earlier a DNS leak test, either standard or extended will clearly tell you if you are experiencing a leak or not. The test results at dnsleaktest.com means that the owners of the servers that have been identified can link your personal IP address with all the websites you connect to every time you go online. The worst part is that they can store the data indefinitely. When connected to a VPN, you will know whether or not you are experiencing a VPN leak if the servers listed in the results are not provided by the VPN service you are using. A DNS leak test will always keep you alert, and you can take the aforementioned precautionary measures at any time.
Conclusion:
The use of VPN does not always mean that you are 100% secured, because of what is referred to as DNS leaks. When using the internet, it is important that all the traffic coming from your network device is routed through anonymous network. This simply means that if any traffic leaks through the underlying connection, then any snooping eyes will be able to log your online activities.
DNS leaks are a primary privacy threat because the anonymity network may be presenting a false sense of security while your personal data is leaking. Do not completely trust your VPN service and Windows, particularly Windows. Windows will always attempt to improve your web performance. As a result, the chances of Windows ignoring the VPN DNS servers are high. You might think that you are safe because you are using OSX or Linux; well, you are wrong. Always take the above measures to avoid the worst regardless of the operating system you are using.
Read also:
6 ways to take control of your data Top 6 Data Security Predictions 2016
Rachael Chapman
A Complete gamer and a Tech Geek. Brings out all her thoughts and love in writing blogs on IOT, software, technology etc
Written By Rachael Chapman
A Complete gamer and a Tech Geek. Brings out all her thoughts and love in writing blogs on IOT, software, technology etc