0

I'm doing a research on Onion routing (Tor). I've successfully set up a middle relay for the purpose of analyzing Tor traffic. I'd like to:

  1. See all circuits that my relay is currently part of
  2. See "unencrypted" Tor packets (512b cells) for exchanging keys and establishing tunnels (in Wireshark or similar)
  3. See unencrypted headers of encrypted data packets that has to be forwarded (instruction to forward packet to xyz relay)
  4. Configure a Tor client to use my relay when establishing a circuit
  5. See the establishment of circuits and tunnels from the Tor client's perspective

I'm looking for tools and techniques to achieve this. Thanks.

1
  • install NYX using sudo apt install nyx
    – Teso
    Feb 8, 2021 at 11:15

1 Answer 1

0

As always, please don't log any information on the public Tor network unless you're sure you're only logging your own personal information. Since the data you want to collect is sensitive, you should use a test Tor network generated using something like Chutney. See Tor's Research Safety Board for more information.

  1. See all circuits that my relay is currently part of

I don't think tor exposes this information. You will need to add custom code to the relay to log when other nodes create new circuits at this relay and when they extend those circuits. If you want this information in real-time, you could expose it through tor's control protocol as a custom command.

  1. See "unencrypted" Tor packets (512b cells) for exchanging keys and establishing tunnels (in Wireshark or similar)

You might be able to use Wireshark, but it would be a pain to do. If you ignore the older tor link handshakes that include things like client authentication and renegotiation, the TLS connections might still be established with either your relay's certificate or the other relay's certificate depending on which relay first established the connection.

It would probably be easiest to again add custom code to the relay to log this information after the link encryption has been removed.

  1. See unencrypted headers of encrypted data packets that has to be forwarded (instruction to forward packet to xyz relay)

This information is part of the Relay{Extend2} cell and is encrypted. You will need to log this information from within your relay by making custom changes to the tor code.

  1. Configure a Tor client to use my relay when establishing a circuit

You can use tor's control protocol to have a client use a custom circuit path. You can find an example here: https://stem.torproject.org/tutorials/to_russia_with_love.html#custom-path-selection

  1. See the establishment of circuits and tunnels from the Tor client's perspective

You can use tor's control protocol to list the client's circuits. You can find an example here: https://stem.torproject.org/tutorials/examples/list_circuits.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.