Friday, March 25, 2016

access website over dns tunnel

dns2tcpc is a tunneling tool that encapsulate TCP traffic over DNS. so if the firewall is blocked mostly of the traffic, but not dns. we can still surf website or do anything else on dns tunnel

***server***
1- create configuration file as below, named config
listen = 192.168.202.1
              port = 53
              user = nobody
              chroot = /tmp
              pid_file = /var/run/dns2tcp.pid
              domain = test.dns2tcp
              debug_level = 0
              resources = ssh:127.0.0.1:22 , smtp:127.0.0.1:25,
                           pop3:10.0.0.1:110, proxy:192.168.202.1:3128

2- start the dns2tcp service
$ sudo dns2tcpd -f config

*** client ***
1- list all resources on server
$ dns2tcpc -z test.dns2tcp  192.168.202.1
Available connection(s) :
    ssh
    smtp
    pop3
    proxy

Note : Compression SEEMS available !


2- use proxy resource and map the port to 13128 on the local machine
$ ns2tcpc -z test.dns2tcp -r proxy -l 13128 192.168.202.1

3- now you can set http proxy as localhost:13128 on browser before start browsing
if you use w3m on bash terminal
$ export http_proxy=http://localhost:13128
$ w3m http://google.com

No comments:

Post a Comment