Monday, September 18, 2006

Web Browsing with Tor

In my Installing Privoxy post I said I needed to install Privoxy for a certain task. I decided to use Privoxy with Tor to facilitate anonymous Web browsing.

First I installed Tor via package.

orr:/root# pkg_add -vr tor
...edited...
Package 'tor-0.1.1.23' depends on 'tsocks-1.8.b5_3' with 'net/tsocks' origin.
...edited...
extract: Package name is tsocks-1.8.b5_3
extract: CWD to /usr/local
extract: /usr/local/man/man1/tsocks.1.gz
extract: /usr/local/man/man5/tsocks.conf.5.gz
extract: /usr/local/man/man8/tsocks.8.gz
extract: /usr/local/bin/tsocks
extract: /usr/local/etc/tsocks.conf.sample
extract: /usr/local/lib/libtsocks.so.1
extract: /usr/local/lib/libtsocks.so
extract: /usr/local/share/examples/tsocks/tsocks.conf.complex.example
extract: /usr/local/share/examples/tsocks/tsocks.conf.simple.example
extract: /usr/local/share/examples/tsocks/README
...edited...
Package 'tor-0.1.1.23' depends on 'libevent-1.2' with 'devel/libevent' origin.
- already installed.
Running pre-install for tor-0.1.1.23..
Added group "_tor".
Added user "_tor".
extract: Package name is tor-0.1.1.23
extract: CWD to /usr/local
extract: /usr/local/man/man1/tor.1.gz
extract: /usr/local/man/man1/tor-resolve.1.gz
extract: /usr/local/man/man1/torify.1.gz
extract: /usr/local/bin/tor
extract: /usr/local/bin/tor-resolve
extract: /usr/local/bin/torify
extract: /usr/local/etc/tor/tor-tsocks.conf.sample
extract: /usr/local/etc/tor/torrc.sample
extract: CWD to /usr/local
extract: /usr/local/etc/rc.d/tor
...edited.
================================================================================
To enable cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 tor server, set tor_enable="YES" in your /etc/rc.conf
and edit /usr/local/etc/tor/torrc. Also note that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 rc.subr script overrides
many torrc options and is tunable. See /usr/local/etc/rc.d/tor.sh for details
================================================================================
...truncated...

Next I made a copy of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 config file and enabled Tor's startup script.

orr:/root# cp /usr/local/etc/tor/torrc.sample /usr/local/etc/tor/torrc
orr:/root# echo "tor_enable=YES" >> /etc/rc.conf

Finally I told Privoxy to accept connections and send cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m to Tor, which would listen on port 9050 TCP.

orr:/root# echo "forward-socks4a / localhost:9050 ." >> /usr/local/etc/privoxy/config

Using SOCKS4A means my local host will not make DNS requests. Instead, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365y will be made by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 SOCKS server (ostensibly through Tor).

Thanks to this guide for help!

Now I start Privoxy.

orr:/root# /usr/local/etc/rc.d/privoxy start
Starting privoxy.


Finally I start Tor.

orr:/root# /usr/local/etc/rc.d/tor start
/usr/local/etc/rc.d/tor: WARNING: /var/db/tor is not a directory.

That's no good. I make cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 required directory. (Why isn't that a default?)

orr:/root# mkdir /var/db/tor
orr:/root# /usr/local/etc/rc.d/tor start
Starting tor.
Sep 18 10:50:59.336 [notice] Tor v0.1.1.23. This is experimental software.
Do not rely on it for strong anonymity.
Sep 18 10:50:59.346 [notice] Initialized libevent version 1.2 using method kqueue. Good.
Sep 18 10:50:59.348 [warn] /var/db/tor is not owned by this user (_tor, 256) but by root (0).
Perhaps you are running Tor as cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 wrong user?
Sep 18 10:50:59.349 [warn] Failed to parse/validate config: Couldn't access/create private data
directory "/var/db/tor"
Sep 18 10:50:59.350 [err] tor_init(): Reading config failed--see warnings above. For usage, try -h.

Shoot. I need to let cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 _tor user access cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 directory I just made.

orr:/root# chown _tor:_tor /var/db/tor

Now I start Tor.

orr:/root# /usr/local/etc/rc.d/tor start
Sep 18 11:12:06.587 [notice] Tor v0.1.1.23. This is experimental software.
Do not rely on it for strong anonymity.
Sep 18 11:12:06.597 [notice] Initialized libevent version 1.2 using method kqueue. Good.
Sep 18 11:12:06.597 [notice] connection_create_listener(): Opening Socks listener on
127.0.0.1:9050
Sep 18 11:12:06.600 [warn] options_init_logs(): Can't log to stdout with RunAsDaemon set;
skipping stdout

Let's see what's listening.

orr:/root# sockstat -4
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
_tor tor 39325 4 tcp4 192.168.2.5:57518 62.35.214.207:9030
_tor tor 39325 5 tcp4 127.0.0.1:9050 *:*
_tor tor 39325 6 tcp4 192.168.2.5:56850 70.32.145.204:9001
_tor tor 39325 8 tcp4 192.168.2.5:64675 218.189.210.17:4806
root privoxy 39312 3 tcp4 127.0.0.1:8118 *:*
richard ssh 691 3 tcp4 192.168.2.5:49499 172.16.3.2:22
root sendmail 468 4 tcp4 127.0.0.1:25 *:*
root sshd 462 4 tcp4 *:22 *:*
root syslogd 320 7 udp4 *:514 *:*

Now I configure my Web browser to connect to port 8118 (where Privoxy is listening), and Privoxy will send my traffic to port 9050 TCP where Tor is listening.

Now if I browse to a site like whatismyip.com I get a result like 195.71.8.10, which is plug.rfc822.org.

You can see Tor node status at sites like serifos.eecs.harvard.edu/cgi-bin/exit.pl and node2.xenobite.eu/torstat.php.

10 comments:

Anonymous said...

What is your pkg_add source?

Richard Bejtlich said...

I'm using cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 packages at pointyhat.

Anonymous said...

Great article! I'm able to run privoxy through tor, and privoxy runs on startup, but I can't get tor to run on startup, even though I have tor_enable="YES" in my /etc/rc.conf. Any suggestions?

Richard Bejtlich said...

Hmm, I suggest editing /usr/local/etc/rc.d/tor to make cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first line

#!/bin/sh -x

cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n run /usr/local/etc/rc.d/tor manually and see what errors appear.

Anonymous said...

I get "Permission Denied" when running as eicá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365r root or my user account

Richard Bejtlich said...

What are cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 permissions on /usr/local/etc/rc.d/tor ?

Anonymous said...

-r--r--r-- 1 root wheel 2705 Sep 29 18:08 /usr/local/etc/rc.d/tor

Anonymous said...

I changed cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 permissions to 550 and now my permissions are as follows:
-r-xr-x--- 1 root wheel 2705 Sep 29 18:08 /usr/local/etc/rc.d/tor. However, when I try to run it under my user account, it won't run, but I can run it under my root account. I am in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 wheel group, so I should be able to execute this file.

Anonymous said...

It asks for a password. I am able to run /usr/local/bin/tor and I don't have any problem, but when I try to run cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 one in etc, I have cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 problem.

Anonymous said...

I finally got it to work. I installed both privoxy and tor through cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 ports collection. Then added cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 changes to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 rc.conf and privoxy.conf. Then copied cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 torr.sample to torrc.

Thanks for your interest.