User Controls

How does TOR handle DNS queries for hidden services?

  1. #1
    Sophie Pedophile Tech Support
    I read that normally the exit node queries the DNS server which sends the resolved host back through the network. But how does this work with .onion domains?
  2. #2
    inb4lock Yung Blood
    This is actually pretty complicated, I'll see if I can remember it all.

    In short, there's no DNS, and a .onion address is not a domain, but a 16 character string derived from the hidden service's public key.

    When a hidden service comes online, it builds circuits to several relays and sends them its public key, which tells the relays it wants to use them as introduction points.

    It then creates a hidden service descriptor and uploads it to Tor's distributed hash table, which is spread across all relays with the HSDir flag. The descriptor contains the service's public key and information about its introduction points, and is signed by its private key.

    Once a client knows the .onion address of the service, it connects to the DHT to retrieve the hash, and learns about the service's public key and introduction points.

    The client builds a circuit to another relay, which it will use as a rendezvous point, and tells it a one time secret. It then creates an introduce message containing the one time secret and information about the rendezvous point, and signs it with the service's public key. It sends this message to the introduction point, which then forwards it to the service.

    The service decrypts the introduce message with its private key, creates a rendezvous message containing the one time secret, and sends it to the rendezvous point.

    The rendezvous point tells the client that a connection has been established, and they procede to communicate over separate Tor circuits. Few people realize that connecting to a hidden service involves 6 hops instead of 3, which is one of the reasons they tend to be so slow and time out often.

    Also worth noting that the key pair used for authentication is only 1024 bit RSA, which is a pretty major criticism of hidden service security. I'm not really sure if I trust them anymore given that the implementation hasn't been updated in years.
  3. #3
    Sophie Pedophile Tech Support
    This is actually pretty complicated, I'll see if I can remember it all.

    In short, there's no DNS, and a .onion address is not a domain, but a 16 character string derived from the hidden service's public key.

    When a hidden service comes online, it builds circuits to several relays and sends them its public key, which tells the relays it wants to use them as introduction points.

    It then creates a hidden service descriptor and uploads it to Tor's distributed hash table, which is spread across all relays with the HSDir flag. The descriptor contains the service's public key and information about its introduction points, and is signed by its private key.

    Once a client knows the .onion address of the service, it connects to the DHT to retrieve the hash, and learns about the service's public key and introduction points.

    The client builds a circuit to another relay, which it will use as a rendezvous point, and tells it a one time secret. It then creates an introduce message containing the one time secret and information about the rendezvous point, and signs it with the service's public key. It sends this message to the introduction point, which then forwards it to the service.

    The service decrypts the introduce message with its private key, creates a rendezvous message containing the one time secret, and sends it to the rendezvous point.

    The rendezvous point tells the client that a connection has been established, and they procede to communicate over separate Tor circuits. Few people realize that connecting to a hidden service involves 6 hops instead of 3, which is one of the reasons they tend to be so slow and time out often.

    Also worth noting that the key pair used for authentication is only 1024 bit RSA, which is a pretty major criticism of hidden service security. I'm not really sure if I trust them anymore given that the implementation hasn't been updated in years.

    That's pretty interesting, i was also wondering via what potocol this all transpires. Normal DNS goes via UDP but since there is no DNS involved is it safe to assume this all transpires via TCP? Sorry if it's a silly question but my knowledge of networking is pretty limited as of yet.
  4. #4
    inb4lock Yung Blood
    All TCP. Tor doesn't handle UDP yet.
  5. #5
    Sophie Pedophile Tech Support
    All TCP. Tor doesn't handle UDP yet.


    Not yet? Will it do so in the future to your knowledge?
  6. #6
    Sophie Pedophile Tech Support
    Also what's the benefit of enabling UDP together with TCP on TOR, when both are layer 4 and TCP is generally considered to be more reliable?
  7. #7
    inb4lock Yung Blood
    It's listed as a very long term milestone.

    https://trac.torproject.org/projects/tor/ticket/7830

    It would be nice to have UDP support because it works better for certain programs where performance and lower latency are desired, for example VoIP clients.
  8. #8
    Sophie Pedophile Tech Support
    It's listed as a very long term milestone.

    https://trac.torproject.org/projects/tor/ticket/7830

    It would be nice to have UDP support because it works better for certain programs where performance and lower latency are desired, for example VoIP clients.

    My nigga'. Thanks for the insightful responses.
  9. #9
    G4LM African Astronaut
    Idklol
Jump to Top