📜 ⬆️ ⬇️

How to send all tcp-traffic from the Windows guest system via Tor

I have been dreaming about an OS with completely anonymous traffic for a long time. Until recently, I used the following method.
The virtual machine on which the anonymized system is installed is connected via the local network only to the host system (Host-only mode of the virtual network adapter) on which Tor is installed. Inside the guest OS, applications that need the Internet were assigned the address of the Polipo proxy server installed with Tor on the host system. Thus, access to the Internet from the guest system is possible only via Tor. However, this method has a drawback. For each application, you need to register a proxy, besides not all applications have such tinctures. I did not want to resort to the use of proxy-fixers, since such a decision seemed to me not quite "natural." Below, I will talk about a more “natural” way of TORification.

After a hard googling I stumbled upon the tun2socks software. Using a TUN / TAP device (virtual network adapter), it directs all tcp and udp traffic through a SOCKS proxy. For the system, it looks like an Ethernet adapter connected to a router that distributes the Internet. Completely “natural,” isn't it?
We will need:



So let's get down to setting up:
')
  1. Install Windows on your favorite virtual machine. In the settings of the network adapter of the virtual machine, we set Host-only mode (this means that from the guest OS only the host OS will be available on the network).
  2. We assign fixed IP addresses for adapters in the host and guest systems, for example, 192.168.220.1 and 192.168.220.2, respectively.
  3. Install on the host OS Vidalia Bundle. Then open the torrc file (% USERPROFILE% \ AppData \ Local \ Vidalia) and append the following lines to the end:

    SocksListenAddress 192.168.220.1 # 9050 192.168.220.1
    DNSListenAddress 192.168.220.1 # Tor DNS-
    DNSPort 53 # DNS- (- )

    Launch Tor.
  4. On the guest system install OpenVPN. After that, the TUN / TAP network adapter with the status “network cable not connected” should appear in the network connections. We give him some shorter name, for example tor.
  5. Unpack somewhere badvpn. In the bin folder we find the badvpn-tun2sock.exe file and run it with the following parameters:
    --tundev <tun_spec> --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 192.168.220.1:9050


    Here:
    • <tun_spec> is the string tap0901: tor: 10.0.0.1: 10.0.0.0: 255.255.255.0, where tor is the name of our TUN / TAP adapter, 10.0.0.1 is the address of the adapter, 10.0.0.0 and 255.255.255.0 is the address and subnet mask .
    • 10.0.0.2 - the address of the virtual router, which acts as an Internet gateway.
    • 255.255.255.0 - subnet mask.
    • 192.168.220.1:9050 proxy address installed on the host OS. In our case, the role of the proxy performs Tor.


    The tun2sock startup field, the TUN / TAP adapter status should change to “Connected”.
    Now in the properties of this adapter, you must configure the gateway and DNS-server:
    In the role of the DNS server, we have the DNS built into Tor (192.168.220.1:53), and as a gateway, as mentioned above, a virtual router (10.0.0.2).
  6. In order for the hidden torus services to work, you need to add the following lines to torrc:

    AutomapHostsOnResolve 1
    AutomapHostsSuffixes .onion
    VirtualAddrNetwork 10.192.0.0/10


The author of tun2socks writes that this program also supports udp redirection, but the torus does not support it. I suspect that it was precisely because of this that I was unable to use WebICQ.
That's all. Anonymous internet to you.

Source: https://habr.com/ru/post/145436/


All Articles