Name | Modified | Size | Downloads / Week |
---|---|---|---|
BlockDNS_V1.0_20211218.rar | 2021-12-18 | 41.2 kB | |
ReadMe.txt | 2021-12-18 | 2.6 kB | |
Totals: 2 Items | 43.9 kB | 1 |
BlockDNS V1.0 Build 20211218 ------------------------------ BlockDNS is used to block DNS traffic for OpenVPN in Windows XP, because the OpenVPN implementation for Windows XP and Server 2003 can not effectively block DNS traffic and we have DNS leaks during the VPN connection. The Win32_NetworkAdapterConfiguration WMI class can manipulate the attributes of a network adapter. We created a fully working real world example program called BlockDNS, which shows how to use the methods and properties of this WMI class. After many days of research this WMI class seems to be the only officially supported way to manipulate IP addresses of a network adapter that Microsoft provides in Windows XP and Server 2003. We found a few examples during the research, but none of them worked out of the box. A big problem of the code was, that most times the network adapter index was hardcoded. To make a working sample we have to retrieve the class object path for the ExecMethod of the network adapter. We included two example versions of BlockDNS to illustrate the differences between plain C and C++ code for COM objects. The differences are minimal and can clearly be seen if you compare the source code files. The program is structured in the following 4 steps: Step 1 is used for OpenVPN before the connection is established. For static network adapters we get the static DNS servers. After that we save the static DNS server entries to a global structure. Step 2 is used for OpenVPN before the connection is established. For DHCP enabled network adapters we set IP address, subnet mask, default gateway and DNS server to static values. We save the static DNS server entries to a global structure. Step 3 is used for OpenVPN directly after the connection is established. For all network adapters we remove the static DNS servers completely. This way every possible DNS leak attempt is blocked. Step 4 is used for OpenVPN directly after the connection is closed. For DHCP enabled network adapters we reenable DHCP and set the old static DNS servers if there were any present before. For static network adapters we set the old static DNS servers. The source code was inspired by the internet site "www.dnsleaktest.com". This site has an executable called "dnsfixsetup.exe" which includes the 3 scripts called "pre.vbs", "up.vbs" and "down.vbs". These scripts can also block the DNS leak for OpenVPN in Windows XP successfully. Many thanks go out to the guys at "dnsleaktest.com", which did a great job with their DNS blocking scripts! Greets Kai Schtrom