Tuesday, October 25, 2016

how to use proxychains

*** setup information
- proxy1: 192.168.202.24 8080
- proxy2: 192.168.202.124 8080

- to easily setup http proxy, you can follow the following link
http://www.atechnote.com/2016/10/httphttps-proxy-quick-setup.html

1- install proxychains on our client
$ sudo apt-get install proxychains

2- configure proxychains by modify file, /etc/proxychains.conf, to the following content
strict_chain
random_chain
proxy_dns
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
http    192.168.202.124    8080
http    192.168.202.24    808
0


3- now we  can access webserver  on use nmap with the proxychains and it will use proxy1 and proxy2 as random when access to the web server.
$ proxychains curl http://192.168.202.1/ip.php
ProxyChains-3.1 (http://proxychains.sf.net)
|R-chain|-<>-192.168.202.124:8080-<><>-192.168.202.1:80-<><>-OK
192.168.202.124



- snapshot of using proxychains to access website,


*** tips,

- this ip.php, file, will show the ip address of client that make the request, so you can easily now, which ip address that proxychains use to access the website
<?php
function get_client_ip() {
    $ipaddress = '';
    if (isset($_SERVER['HTTP_CLIENT_IP']))
        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
    else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
    else if(isset($_SERVER['HTTP_X_FORWARDED']))
        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
    else if(isset($_SERVER['HTTP_FORWARDED_FOR']))
        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
    else if(isset($_SERVER['HTTP_FORWARDED']))
        $ipaddress = $_SERVER['HTTP_FORWARDED'];
    else if(isset($_SERVER['REMOTE_ADDR']))
        $ipaddress = $_SERVER['REMOTE_ADDR'];
    else
        $ipaddress = 'UNKNOWN';
    return $ipaddress;
}

$ip = get_client_ip();
echo $ip;
echo "\n";
?>

No comments:

Post a Comment