Tuesday, October 25, 2016

how to use proxychains

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

- to easily setup http proxy, you can follow the following link

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

2- configure proxychains by modify file, /etc/proxychains.conf, to the following content
tcp_read_time_out 15000
tcp_connect_time_out 8000
http    8080
http    808

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
ProxyChains-3.1 (http://proxychains.sf.net)

- 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
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'];
        $ipaddress = 'UNKNOWN';
    return $ipaddress;

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

1 comment: