Serviços onion são serviços que só podem ser acessados pelo Tor. Executar um serviço Onion oferece aos usuários toda a segurança do HTTPS com os benefícios de privacidade adicionais do Tor Browser.
Por que serviços onion?
Os serviços Onion oferecem vários benefícios de privacidade e segurança para seus usuários.
Esconderijo de localização
O endereço IP de um serviço Onion é protegido. Os serviços Onion são uma rede sobreposta no topo do TCP / IP, portanto, em certo sentido, os endereços IP não são significativos para os serviços Onion: eles não estão nem sendo usados no protocolo.
Autenticação ponta a ponta
Quando um usuário visita um Onion específico, ele sabe que o conteúdo que está vendo só pode vir desse Onion específico. Nenhuma falsificação de identidade é possível, o que geralmente não é o caso. Geralmente, o acesso a um site não significa que um interceptador não tenha redirecionado para outro local (por exemplo, ataques de DNS).
Criptografia de ponta a ponta
O tráfego do serviço Onion é criptografado do cliente para o host Onion. Isso é com obter um forte SSL / HTTPS gratuitamente.
NAT punching
A sua rede está filtrada e você não consegue abrir portas no firewall? Isso pode acontecer se você estiver em um campus universitário, um escritório, um aeroporto ou praticamente qualquer lugar. Os serviços Onion não precisam de portas abertas porque eles perfuram o NAT. Eles apenas estabelecem conexões de saída.
O protocolo de serviço Onion: Visão geral
Agora a questão é que tipo de protocolo é necessário para alcançar todas essas propriedades? Normalmente, as pessoas se conectam a um endereço IP e terminam, mas como você pode se conectar a algo que não tem um endereço IP?
Em particular, o endereço de um serviço Onion se parece com este: vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.onion
Isso parece estranho e aleatório porque é a chave pública de identidade do serviço Onion. Essa é uma das razões pelas quais podemos obter as propriedades de segurança acima.
O protocolo de serviço Onion usa a rede Tor para que o cliente possa se apresentar ao serviço e, em seguida, configurar um ponto de encontro com o serviço pela rede Tor. Aqui está uma análise detalhada de como isso acontece:
Ato 1: Onde o serviço Onion estabelece seus pontos de introdução
Let's imagine that your local newspaper decides to set up an onion service (using SecureDrop) to receive anonymous tips. As the first step in the protocol, the onion service will contact a bunch of Tor relays and ask them to act as its introduction points by establishing long-term circuits to them. These circuits are anonymized circuits, so the server does not reveal the service location to the introduction points.
The onion service will hide and protect itself behind the Tor network by only allowing access through three introduction points that it connects to through a two-hop Tor circuit.
Ato 2: Onde o serviço Onion publica seus descritores
Agora que os pontos de introdução estão configurados, precisamos criar uma maneira para que os clientes possam encontrá-los.
For this reason, the onion service assembles an onion service descriptor, containing a list of its introduction points (and "authentication keys"), and signs this descriptor with the onion service's identity private key. A chave privada de identidade usada aqui é a parte privada da chave pública que é codificada no endereço do serviço Onion .
The onion service upload that signed descriptor to a distributed hash table, which is part of the Tor network, so that clients can also get it. It uses an anonymized Tor circuit to do this upload so that it does not reveal its location.
Act 3: Where a client wants to visit the onion service
Say you want to anonymously send some tax fraud data to your local newspaper through its SecureDrop. You find the onion address for the newspaper's SecureDrop from a public website or friend.
Act 4: Where the client introduces itself to the onion service
All the previous steps were just set up for the onion service so that it's reachable by clients. Now let's fast-forward to the point where an actual client wants to visit the service.
In this case, the client has the onion address of SecureDrop and want to visit it, so they connect to the service with Tor Browser. Now the next thing that needs to happen is that the client goes to the distributed hash table from Step 2 and ask for the signed descriptor of SecureDrop's onion service.
Act 5: Where the client verify onion address signature
When the client receives the signed descriptor, they verify the signature of the descriptor using the public key that is encoded in the onion address. This provides the end-to-end authentication security property, since we are now sure that this descriptor could only be produced by that onion service and no one else.
And inside the descriptor, there are the introduction points that allow the client to introduce themselves to SecureDrop's onion service.
Act 6: Where the client establishes a rendezvous point
Before the introduction takes place, the client (in this case, you) picks a Tor relay and establishes a circuit to it. The client asks the relay to become their rendezvous point and give it an "one-time secret" that will be used as part of the rendezvous procedure.
Act 7: Where the onion service rendezvous with the client
The introduction point passes your details (secret string and rendezvous address) on to the onion service, which runs multiple verification processes to decide whether you're trustworthy or not.
Act 8: Where the rendezvous point verifies the client's secret
O serviço Onion se conecta ao ponto de encontro (por meio de um circuito anônimo) e envia o "segredo único" para ele. The rendezvous point makes one final verification to match the secret strings from you and service (the latter also comes from you but has been relayed through the service).
O ponto de encontro simplesmente retransmite mensagens (criptografadas de ponta a ponta) do cliente para o serviço e vice-versa.
Act 9: Where the onion service rendezvous with the client
In general, the complete connection between client and onion service consists of 6 relays: 3 of them were picked by the client, with the third being the rendezvous point, and the other 3 were picked by the onion service. This provides location hiding to this connection.
Finally, using the rendezvous point, a Tor circuit is formed between you and your newspaper's SecureDrop onion service.
Recursos adicionais
This was just a high-level overview of the Tor onion services protocol. Aqui estão mais alguns recursos se você quiser aprender mais:
- The Tor design paper describing the original design.
- The Tor v3 onion services protocol specification.
- Presentations about onion services: Understanding Tor Onion Services and Their Use Cases - HOPE XI 2016, DEF CON 25 - Roger Dingledine - Next Generation Tor Onion Services.