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?
Asked
Active
Viewed 1.8k times
13
Dervin Thunk
- 3,429
- 4
- 23
- 21
1 Answers
19
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
You can install the
torpackage as follows:Fedora/CentOS/RHEL
$ sudo yum install torUbuntu/Debian
$ sudo apt-get install torEdit this file
/etc/tor/torrcso that the following lines are present and uncommented:ControlPort 9051 CookieAuthentication 0Start the
torservice$ sudo /etc/init.d/tor restartTesting 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.mewebsite thinks our IP address is now 46.165.221.166. You can telltorto 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.31Do 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.161Downloading Pages
$ torify curl www.google.com 2>/dev/nullBrowsing the internet via
elinks$ torify elinks www.google.com
References
slm
- 363,520
- 117
- 767
- 871
-
1Thanks for this ! But do you mind adding an example on how to test tor 9050 socks without using torify ? I'm trying to use `curl --socks5` or even socks4 or socks4a, but never worked. It just freezed. – Bertie Jun 01 '14 at 14:20
-
@slm: sorry, i finally got it working. It's just because of i have environment http_proxy of localhost:4001 after installing anon_proxy. Removing the environment variables and redoing curl --socks5 worked out fine. I just deleted my question. Thank you for your answer. – Bertie Jun 01 '14 at 15:27