LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2088|回复: 6

[未完成] Internet 访问:Squid, tor, privoxy, tsocks.

[复制链接]
发表于 2006-1-25 21:19:33 | 显示全部楼层 |阅读模式
几个软件,配合起来,方便使用。
这个帖子是整理出来的。部分是从我发的其他帖子提取后修改的。

===============================================================================================
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配置文件:

  1. toggle  0  # disable fancy functions

  2. confdir /etc/privoxy
  3. logdir /var/log/privoxy

  4. listen-address  127.0.0.1:8118
  5. listen-address  192.168.0.1:8118

  6. enable-remote-toggle  0
  7. enable-edit-actions 1

  8. permit-access  localhost
  9. permit-access  192.168.0.1/24

  10. buffer-limit 4096

  11. forward-socks4a /       192.168.0.1:9050    .
复制代码


===============================================================================================
tor 的配置文件:
/usr/local/etc/tor/torrc

  1. RunAsDaemon 1

  2. SocksPort 9050 # what port to open for local application connections
  3. SocksBindAddress 127.0.0.1 # accept connections only from localhost
  4. SocksBindAddress 192.168.0.1 # accept connections only from localhost

  5. SocksPolicy accept 192.168.0.1/24
  6. SocksPolicy reject *

  7. AllowUnverifiedNodes middle,rendezvous

  8. Log debug-err file /dev/null
  9. DataDirectory /var/lib/tor

  10. User privoxy
  11. Group privoxy
复制代码

/usr/local/etc/tor/tor-tsocks.conf

  1. server = 192.168.0.1
  2. server_port = 9050
复制代码

===============================================================================================
tsocks是一个库软件。默认安装是有错误的,要改动 /usr/bin/tsocks 文件。
tsocks 配置文件:/etc/tsocks.conf

  1. # We can access 192.168.0.* directly
  2. local = 192.168.0.0/255.255.255.0

  3. # Otherwise we use the server
  4. server = 192.168.0.1
  5. server_port = 9050

  6. server_type = 5
复制代码

使用方法:

  1. 如果以上配置正确的话,运行以下命令测试。
  2. . tsocks on
  3. env | grep "LD_PRELOAD"
  4. wget http://www.google.com
复制代码

停掉tor进程,再运行一下 wget 命令,会失败的,如下:

  1. # wget http://www.google.com
  2. --05:11:36--  http://www.google.com/
  3.            => `index.html.1'
  4. Resolving www.google.com... 66.249.93.104, 66.249.93.99
  5. 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)
  6. failed: Connection refused.
  7. 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)
  8. failed: Connection refused.
复制代码


===============================================================================================
参考资料:
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#FtpProxy

为什么要用 Privoxy ?光用 tor 不可以么?(但是本机似乎还是能看到DNS查询。)
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS
发表于 2006-1-25 21:43:15 | 显示全部楼层
组合起来干啥用的?有啥特效?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-25 22:20:44 | 显示全部楼层
没啥大用,就是方便使用。比如想转换代理什么的,隐匿IP,过滤内容等。
就作为 BLFS 的一点继续吧(BBLFS)。
回复 支持 反对

使用道具 举报

发表于 2006-1-26 12:03:07 | 显示全部楼层
也许可以写个hints提交linuxfromscratch.org,造福後世。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-27 07:19:41 | 显示全部楼层
等过年的时候完成。提议不错。
回复 支持 反对

使用道具 举报

发表于 2006-2-3 10:15:01 | 显示全部楼层
终极幻想, I found a OpenBSD based LiveCD preconfigured with Tor and Privoxy.  I think you may have interest with this toy.

http://www.linuxsir.cn/bbs/showthread.php?t=241418
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-2-3 21:12:29 | 显示全部楼层
thanks, I will have a look at it.
I want to know what they use and how they use them.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表