How to Check Command Line Requests Routed Thru Tor?
I Think I Have Virtualbox Set up So That All Traffic Originating from the Guest Os Is Routed Through Tor. Tor Is Only Installed on the Host Os and the Web...
I think I have Virtualbox set up so that all traffic originating from the guest OS is routed through Tor. Tor is only installed on the host OS and the web browsers on the guest OS all report Tor IP's in Europe when I test with seemyip.com. The host OS shows my real IP when going to the same sites.
But I initiate a lot of requests from the Linux command line and I haven't been able to confirm to my satisfaction that these are routing through Tor, though I have no reason to think they do not.
When I use this command I get no output from the guest OS, but my real IP from the host OS:
dig myip.opendns.com @resolver1.opendns.com +short
This bash file gives no output from either OS:
#!/bin/bash
echo Your external IP Address is:
wget -O - -o /dev/null | grep '<TITLE>' |\
sed -r 's/<TITLE>WhatIsMyIP\.com \- //g' | sed -r 's/<\/TITLE>//g'
exit 0
Suggestions?
2 Answers
Usually software which is called from your shell doesn't know about about Tor or any other proxy. So you have to tell it. The bad thing is that many software has specific ways to set a proxy up. Below you find some ways to get Tor working on commandline. I assume that you run a combination of Tor and Privoxy at the IP address 127.0.0.1 and port 8118. This might not true in your case. So you should enter the correct values.
Proxy environment variable
There is a special environment variable which is respected by some shell software. Open your .bashrc (or other shell rc file) and enter the following lines.
export http_proxy=""
export https_proxy=${http_proxy}
export HTTP_PROXY=${http_proxy}
export HTTPS_PROXY=${http_proxy}
Applications like wget, GnuPG and curl are known to respect those values.