TOR 隐藏服务并不总是可以通过 cURL 访问。需要多次尝试

TOR 隐藏服务并不总是可以通过 cURL 访问。需要多次尝试

当我尝试使用 cURL 访问 TOR 上的隐藏服务时,由于某种原因,我无法 100% 地访问该网站。很多次都会返回"curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (5)"

我可以做些什么来配置 cURL 以便更好地与 TOR 配合使用吗?这是我得到的输出:

root@Dexter:~# curl --proxy socks5h://localhost:9050 http://5ztppjwojkuslibm.onion/
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (5)
root@Dexter:~# curl --proxy socks5h://localhost:9050 http://5ztppjwojkuslibm.onion/
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (5)
root@Dexter:~# curl --proxy socks5h://localhost:9050 http://5ztppjwojkuslibm.onion/
curl: (18) transfer closed with 1 bytes remaining to read
<h1>This is a test page to see if I can run a hidden tor service!</h1><h3>Looks like it's working!</h3>root@Dexter:~# 
root@Dexter:~# curl --proxy socks5h://localhost:9050 http://5ztppjwojkuslibm.onion/
curl: (18) transfer closed with 1 bytes remaining to read
<h1>This is a test page to see if I can run a hidden tor service!</h1><h3>Looks like it's working!</h3>root@Dexter:~# 

答案1

可能是你的网络环境问题。

我以duckduckgo洋葱网站https://3g2upl4pq6kufc4m.onion为例,它在AWS EC2或本地网络环境中都运行良好。

$time curl -I --proxy socks5h://localhost:9050 https://3g2upl4pq6kufc4m.onion/
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 17 Jul 2018 13:51:35 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 5499
Connection: keep-alive
ETag: "5b4d156e-157b"
Strict-Transport-Security: max-age=0
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src https: blob: data: 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: origin
Expect-CT: max-age=0
Expires: Tue, 17 Jul 2018 13:51:34 GMT
Cache-Control: no-cache
Accept-Ranges: bytes


real    0m2.235s
user    0m0.048s
sys 0m0.016s

提取<title>信息

curl -fsL --proxy socks5h://localhost:9050 https://3g2upl4pq6kufc4m.onion | grep 'title'
    <title>DuckDuckGo — Privacy, simplified.</title>

相关内容