Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there any way to anonymize http requests through the command line? In other words, is it possible to wget a page without the requester's IP showing up?

share|improve this question
 
Are you asking how to use an annonymizer service, such as tor, from the command line for http requests? –  slm Aug 17 at 14:57

1 Answer

up vote 3 down vote accepted

One method of annoymizing HTTP traffic from the command line is to use tor. This article discusses the method, titled: How to anonymize the programs from your terminal with torify.

General steps from article

  1. You can install the tor package as follows:

    Fedora/CentOS/RHEL

    $ sudo yum install tor
    

    Ubuntu/Debian

    $ sudo apt-get install tor
    
  2. Edit this file /etc/tor/torrc so that the following lines are present and uncommented:

    ControlPort 9051
    CookieAuthentication 0
    
  3. Start the tor service

    $ sudo /etc/init.d/tor restart
    
  4. Testing setup

    Real IP

    $ curl ifconfig.me 67.253.170.83

    anonymized IP

    $ torify curl ifconfig.me 2>/dev/null 46.165.221.166

    As you can see the ifconfig.me website thinks our IP address is now 46.165.221.166. You can tell tor to start a new session triggering a new IP address for us:

    $ echo -e 'AUTHENTICATE ""\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051
    250 OK
    250 OK
    250 closing connection
    
    $ torify curl ifconfig.me 2>/dev/null
    37.252.121.31
    

    Do it again to get another different IP

    $ echo -e 'AUTHENTICATE ""\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051
    250 OK
    250 OK
    250 closing connection
    
    $ torify curl ifconfig.me 2>/dev/null
    91.219.237.161
    
  5. Downloading Pages

    $ torify curl www.google.com 2>/dev/null
    
  6. Browsing the internet via elinks

    $ torify elinks www.google.com
    

         ss of elinks

References

share|improve this answer
 
Exactly what I needed. Thanks for this. –  Dervin Thunk Aug 17 at 16:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.