5

When I try to access a hidden service on TOR using cURL, for some reason I'm not getting access to the site 100% of the time. Many times it returns "curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (5)"

Is there something I can do to configure cURL to work better with TOR? Here is the output I'm getting:

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 Answer 1

0

It may be your network environment issue.

I use duckduckgo onion site https://3g2upl4pq6kufc4m.onion as an example, it works well in either AWS EC2 or local network environment.

$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

Extract <title> info

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .