当使用某些 Tor 浏览器时,例如在 iOS 中,我有一个很好的列表,其中包含速度和国家/地区,我可以从中选择可以使用/从中退出的中继点。
运行守护进程时我可以从 Linux 命令行获取这样的列表tor
吗?
答案1
正如相关帖子所man tor
描述的Tor 浏览器捆绑包是否缓存中继信息?,系统中存在这样一个带有缓存信息的文件。
DataDirectory/缓存共识和/或缓存microdesc共识
The most recent consensus network status document we’ve downloaded.
因此,在 Debian 中,带有缓存 Tor 中继的文件是/var/lib/tor/cached-microdesc-consensus
,其中的信息最多可以在 24 小时内有效。 (如果没有更新,这是正常行为)
与这篇文章相关的内容似乎从我的家庭服务器中的第 36 行开始,到第 35963 行的某个地方结束:
36 r mintberryCrunch ABCTIE984gTgUHkIeZdNvcDTiRE 2016-11-26 20:55:20 88.99.35.166 443 9030
37 m V1CEu0LsXapK9Ci55c+VHLEP89EG+1wWjSjsDSYyC0Y
38 s Fast Guard HSDir Running Stable V2Dir Valid
39 v Tor 0.2.5.12
40 w Bandwidth=16800
41 r CalyxInstitute14 ABG9JIWtRdmE7EFZyI/AZuXjMA4 2016-11-27 01:19:50 162.247.72.201 443 80
42 m hiyRvQn2CqLG7Xgp+eDcQe9u2IpJ44p/qZ+CrgIp+W4
43 s Exit Fast Guard HSDir Running Stable V2Dir Valid
44 v Tor 0.2.8.6
45 w Bandwidth=10800
我在命令行上编写了一个小型 bash 脚本,从该文件中获取前 20 个速度继电器:
sudo egrep ^"r |^w " /var/lib/tor/cached-microdesc-consensus | paste -d " " - - \
| sed "s/Unmeasured=. //" | \
awk ' { printf("%s %s %s ", $2, $6, $10 ); system("geoiplookup " $6 ); } ' | \
cut -f1,2,3,8- -d" " | sed "s/=/ /" | sort -k4 -n -r | head -20
最终结果是:
IPredator 197.231.221.211 Bandwidth 254000 Liberia
cry 192.42.115.101 Bandwidth 182000 Netherlands
GrmmlLitavisNew 163.172.194.53 Bandwidth 180000 France
regar42 62.210.244.146 Bandwidth 164000 France
xshells 178.217.187.39 Bandwidth 161000 Poland
dopper 192.42.113.102 Bandwidth 159000 Netherlands
TorLand1 37.130.227.133 Bandwidth 151000 United Kingdom
0x3d001 91.121.23.100 Bandwidth 151000 France
hviv104 192.42.116.16 Bandwidth 149000 Netherlands
colosimo 109.236.90.209 Bandwidth 136000 Netherlands
Onyx 192.42.115.102 Bandwidth 135000 Netherlands
redteam01 209.222.77.220 Bandwidth 134000 United States
belalugosidead 217.20.23.204 Bandwidth 129000 United Kingdom
redjohn1 62.210.92.11 Bandwidth 124000 France
Unnamed 46.105.100.149 Bandwidth 121000 France
theblazehenTor 188.138.17.37 Bandwidth 119000 France
splitDNA 62.210.82.44 Bandwidth 116000 France
radia2 91.121.230.212 Bandwidth 115000 France
ArachnideFR5 62.210.206.25 Bandwidth 115000 France
quadhead 148.251.190.229 Bandwidth 111000 Germany
或者我的祖国的中继节点列表:
sudo egrep ^"r |^w " /var/lib/tor/cached-microdesc-consensus | paste -d " " - - \
| sed "s/Unmeasured=. //" | \
awk ' { printf("%s %s %s ", $2, $6, $10 ); system("geoiplookup " $6 ); } ' | \
cut -f1,2,3,8- -d" " | sed "s/=/ /" | grep Portugal | sort -k4 -n -r
输出:
Laika 51.254.164.50 Bandwidth 47300 Portugal
freja 194.88.143.66 Bandwidth 15400 Portugal
cserhalmi 188.93.234.203 Bandwidth 1870 Portugal
Eleutherius 85.246.243.40 Bandwidth 1400 Portugal
luster 94.126.170.165 Bandwidth 1390 Portugal
undercity 178.166.97.51 Bandwidth 1180 Portugal
helper123 85.245.103.222 Bandwidth 1060 Portugal
Pi 94.60.255.42 Bandwidth 271 Portugal
TheSpy 85.240.255.230 Bandwidth 142 Portugal
MADNET00 89.153.104.243 Bandwidth 78 Portugal
MADNET01 82.155.67.190 Bandwidth 14 Portugal
顺便说一句,Tor 服务器/客户端中的带宽默认以 KB 为单位定义。