Tor需要正确的配置才能起到匿名效果,否则会适得其反更加的不安全。
网络的基本逻辑结构
目录服务(directory server DS):目录服务器(多个)负责存储和管理所有的OR节点信息,当Tor代理启动时候,首先需要连接到目录服务获取节点信息,所以OR和目录服务器的地址都是公开的。
Tor路由器(onion router OR):匿名通信链路的基本单元用于转发数据,且做为出口节点,必须在配置文件中被明确的定义,数据在经由3个随机OR发送到目标服务器。
网桥中继(Bridge relays BR):Bridge节点是一种特殊的非公开OR节点,当用户不能直接连接到DS和OR,那么就通过Bridge节点连接。
目标应用服务器(Bob):应用服务器提供具体的服务。
各单元之间使用tls协议连接,DS和OR的ip地址是已知的,在直接连接时,分析连接的ip地址就会被探测到正在使用tor网络,其次Tor的tls流量也能被识别,tls1.2的握手特征(密码套件,hello回应数据包长度等),包括使用obfs4 meek等流量混淆插件,这让Bridge节点失去了意义。要安全的使用tor就必须额外的配置加密代理。
在/etc/tor/torrc中,可以定义两种不同类型的代理
HTTPSProxy
Socks5Proxy
由于HTTPSProxy配置起来需要证书,直接使用shadowsocks的加密Socks5Proxy。
写了一个脚本快速部署
wget https://raw.githubusercontent.com/xxooxxooxx/openwrt_tor/master/install.sh
sh install.sh
说明和注意事项
第3行修改Socks5Proxy地址
第4,5行时区,请参考下面的地址修改
https://github.com/openwrt/luci/blob/master/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua
run-if-today 计划任务工具,脚本设置了一条计划任务,每月的第3个星期四,自动更新数据库
定义ip数据库,只有定义了GeoIPFile文件位置,下面的定义才会生效
GeoIPFile /opt/geoip
GeoIPv6File /opt/geoip6
指明那些OR(国家/地区)节点需要排除
https://en.wikipedia.org/wiki/ISO_3166-1
ExcludeNodes
ExcludeExitNodes
明确指明入口和出口
EntryNodes {us}
ExitNodes {us}
验证是否安装成功
netstat -anp|grep 9050
执行 logread 能看到类似如下的信息
Bootstrapped 0% (starting): Starting
Starting with guard context "default"
Bootstrapped 3% (conn_proxy): Connecting to proxy
Bootstrapped 4% (conn_done_proxy): Connected to proxy
Bootstrapped 10% (conn_done): Connected to a relay
Bootstrapped 14% (handshake): Handshaking with a relay
Bootstrapped 15% (handshake_done): Handshake with a relay done
Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Bootstrapped 100% (done): Done
浏览器配置
使用FireFox,复制出一份新的快捷方式,在新快捷方式的执行命令参数后面加 -P,运行,在弹出的窗口点“创建配置文件"名字任意,并且不要登陆任何的网络账号。
安装如下插件
decentraleyes
https://addons.mozilla.org/zh-CN/firefox/addon/decentraleyes/
disconnect
https://addons.mozilla.org/zh-CN/firefox/addon/disconnect/
privacy-badger
https://addons.mozilla.org/zh-CN/firefox/addon/privacy-badger17/
HTTPS Everywhere
https://addons.mozilla.org/zh-CN/firefox/addon/https-everywhere/
Proxy SwitchyOmega
https://addons.mozilla.org/zh-CN/firefox/addon/switchyomega/
安装自定义配置
https://github.com/pyllyukko/user.js
安装过程请参考下面的视频
最后在Proxy SwitchyOmega选项里配置代理
类型socks5 ip 9050
再次修改快捷方式的参数修改为
-P "配置文件名字" -no-remote
验证测试
https://ipx.ac/run
https://check.torproject.org/
https://www.doileak.com/
https://dnsleaktest.com/
能用于被追踪的信息
任何网络账号
浏览器漏洞
IP地址
DNS服务器
WebRTC
Flash IP(现在的浏览器会自动屏蔽Flash)
Battery(电池)
User agent(用户代理)
浏览器的语言
浏览器Cookie
CPU的核心数
屏幕的分辨率
时区(Timezone)
https://2019.www.torproject.org/docs/tor-manual.html
https://github.com/ruped24/toriptables2
https://wiki.archlinux.org/index.php/Firefox/Privacy

没有评论:
发表评论