Pages

Tuesday, December 30, 2008

Using ProxyChains

There are probably dozens of programs on any OS that don't have any option for using proxies. Many common command line tools like ping, traceroute don't work if the network you are on, forces you to use a proxy. Finally found a way to specify a proxy for these programs . ProxyChains  is one very good tool that enables you to use a proxy for not only specifying a path to outside networks but also use anonymous proxies for your privacy. 

 It's quite simple to install and use. First download and install the script. 

Then navigate to /etc folder and open proxychains.conf file in any text editor of your choice. It should look like this.

# proxychains.conf VER 3.1
#
# HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.


# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
#dynamic_chain
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
strict_chain
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
#random_chain
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see chain_len) from the list.
# this option is good to test your IDS :)

# Make sense only if random_chain
#chain_len = 2

# Quiet mode (no output from library)
#quiet_mode

# Proxy DNS requests - no leak for DNS data
proxy_dns 

# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000

# ProxyList format
# type host port [user pass]
# (values separated by 'tab' or 'blank')
#
#
# Examples:
#
# socks5 192.168.67.78 1080 lamer secret
# http 192.168.89.3 8080 justu hidden
# socks4 192.168.1.49 1080
# http 192.168.39.93 8080 
#  
#
# proxy types: http, socks4, socks5
# ( auth types supported: "basic"-http "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
http 10.123.137.1 8080
socks4 111.44.45.31 80


Now depending upon your network configuration, you'll need to add proxies to this file. If you're on a network that routes all data through a proxy server, then replace the bold green text with the type of proxy (http, socks4,5 ), ip address and port number. Separate each field by a TAB. That'll be enough for you to force your programs to use your network's proxy.

But if  you want to use another proxy for any purpose including hiding your ip, you can add other proxies along with their type and port number same way as previous one. (Red bold text). Additionaly you may have to add username and password if the proxy server requires so.

Notice the options #dynamic_chain, #strict_chain and #random_chain . 
Removing the # sign from any one of these 3 specifies the order in which the proxies are to be used. In this example I'm using strict_chain option, though dynamic_chain will also work.

Save the file and exit from text editor. Now it's time to see it in action. Open up your command line and type proxychains before the program name to force it to use your proxylist. 

user~# proxychains program

As simple as that :)

0 comments:

Post a Comment

Pageviews past week