Is there some magical way which I can programmatically detect whether a hidden service exists, is up, or is dead, other than trying to connect to it through the Tor socks protocol?

I can connect using Python socks module.

I wonder if there's some magic, so if I know the .onion address I can check whether there is an up-to-date service descriptor magically out there in the Tor network?


To elaborate on the previous answer, there are degrees of "up"-ness.

Connecting to a hidden service involves roughly the following steps. You could write a tool that performed any number of them and declares the service "up" if they succeed, but you won't know if subsequent steps would have failed unless you try them too.

  1. Connect to Tor
  2. Download the directory consensus
  3. Connect to the first HSDir node for your hidden service and fetch the HS descriptor
    • If the first HSdir fails, try another. There are several HSDirs responsible for each HS (for details, read about consistent hashing, DHTs, etc)
  4. Try communicating with the HS via the first introduction node in the HS descriptor
    • If the first introduction node fails, try another. There are several.
  5. Tell the hidden service (via the introduction point) about a rendezvous node, and build a circuit there. The HS should also build a circuit there, and the rendezvous node will merrily connect the two.
  6. Connect to the hidden service through the new circuit to rendezvous node

If the hidden service has been completely down for a while, step 3 will fail (none of the HSDirs will have a record of it).

If the hidden service went down recently, step 4 will fail (none of the introduction points will have an open circuit to it).

If the hidden service's Tor daemon is running but the service behind it (eg, a webserver) is not, then step 6 will fail.


  • 1
    Back in the day when anons were attacking Freedom Hosting (FH) with slowloris, I found that some Tor clients would consistently connect to FH. But others, simultaneously but via different VPN paths, would consistently not connect to FH, and yet would connect to other hidden services. What might have caused that? Do different entry guards affect reachability of a particular hidden service? – mirimir Oct 8 '13 at 3:39

as I know, tordir automatically check if published links/websites are alive or dead. but how it checks, I don't know, you can ask admin of tordir website.


I can't tell if there's some "magic trick" but if there is you don't know if the webserver or whatever is running. So you still have to try to connect so why not doing it in the first place?

Your Answer

