|
|
几个软件,配合起来,方便使用。
这个帖子是整理出来的。部分是从我发的其他帖子提取后修改的。
===============================================================================================
Privoxy 的作用:
Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, modifying web page content, managing cookies, controlling access,
and removing ads, banners, pop-ups and other obnoxious Internet junk.
简单的说,就是一个web代理,并且带有高级的过滤效果。
tor 的作用:
An anonymous Internet communication system. 使用Socks5协议。
简单的说,tor 是一个匿名代理系统。越多人用而且提供服务的话,效果越好。
tsocks 的作用:
tsocks' role is to allow these non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use SOCKS without any modification. It does this by interce
pting the calls that applications make to establish network connections and negotating them through a SOCKS server as necessary.
简单的说,tsocks是一个库代替品,把相应的网络操作转换成Socks操作然后传送到Socks代理服务器。
tsocks 在这篇文章没用到。只是单纯安装了备用,简单使用方法见后。
Squid 的作用:
Web Proxy Cache
这个就不用说了吧:)。
firefox 中的一个扩展 SwitchProxy:
SwitchProxy in a multiple proxies environment. also SwitchProxy As An Anonymizer.
一个提供给 Firefox 代理服务器管理的插件。
===============================================================================================
使用过程:
使用普通代理:
firefox 指定代理为3128端口。使用Squid做代理。
使用匿名代理:
firefox 指定代理为8118端口。使用Privoxy做代理,Privoxy转发所有请求到9050端口(tor端口)。
===============================================================================================
安装过程:
要装3个包包。不过效果不错,还支持SOCK5。
libevent-1.1a.tar.bz2
http://www.monkey.org/~provos/libevent/
privoxy-3.0.3-2-stable.src.tar.bz2
http://www.privoxy.org/
tor-0.1.0.15.tar.bz2
http://tor.eff.org/
firefiox里边有一个 SwitchProxy 扩展,官方网站提供的那个过时了,用这里提供的:
http://www.scorpiondb.com/firefox/extensions/
端口说明:
3128 squid
8118 privoxy
9050 tor
===============================================================================================
配置细节:
privoxy配置文件:
- toggle 0 # disable fancy functions
- confdir /etc/privoxy
- logdir /var/log/privoxy
- listen-address 127.0.0.1:8118
- listen-address 192.168.0.1:8118
- enable-remote-toggle 0
- enable-edit-actions 1
- permit-access localhost
- permit-access 192.168.0.1/24
- buffer-limit 4096
- forward-socks4a / 192.168.0.1:9050 .
复制代码
===============================================================================================
tor 的配置文件:
/usr/local/etc/tor/torrc
- RunAsDaemon 1
- SocksPort 9050 # what port to open for local application connections
- SocksBindAddress 127.0.0.1 # accept connections only from localhost
- SocksBindAddress 192.168.0.1 # accept connections only from localhost
- SocksPolicy accept 192.168.0.1/24
- SocksPolicy reject *
- AllowUnverifiedNodes middle,rendezvous
- Log debug-err file /dev/null
- DataDirectory /var/lib/tor
- User privoxy
- Group privoxy
复制代码
/usr/local/etc/tor/tor-tsocks.conf
- server = 192.168.0.1
- server_port = 9050
复制代码
===============================================================================================
tsocks是一个库软件。默认安装是有错误的,要改动 /usr/bin/tsocks 文件。
tsocks 配置文件:/etc/tsocks.conf
- # We can access 192.168.0.* directly
- local = 192.168.0.0/255.255.255.0
- # Otherwise we use the server
- server = 192.168.0.1
- server_port = 9050
- server_type = 5
复制代码
使用方法:
- 如果以上配置正确的话,运行以下命令测试。
- . tsocks on
- env | grep "LD_PRELOAD"
- wget http://www.google.com
复制代码
停掉tor进程,再运行一下 wget 命令,会失败的,如下:
- # wget http://www.google.com
- --05:11:36-- http://www.google.com/
- => `index.html.1'
- Resolving www.google.com... 66.249.93.104, 66.249.93.99
- Connecting to www.google.com|66.249.93.104|:80... 05:11:36 libtsocks(17089): Error 111 attempting to connect to SOCKS server (Connection refused)
- failed: Connection refused.
- Connecting to www.google.com|66.249.93.99|:80... 05:11:36 libtsocks(17089): Error 111 attempting to connect to SOCKS server (Connection refused)
- failed: Connection refused.
复制代码
===============================================================================================
参考资料:
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#FtpProxy
为什么要用 Privoxy ?光用 tor 不可以么?(但是本机似乎还是能看到DNS查询。)
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS |
|