Skip to content

Instantly share code, notes, and snippets.

@nusenu
Created February 28, 2017 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nusenu/8339cfd5351b64c47676241a40ee2942 to your computer and use it in GitHub Desktop.
Save nusenu/8339cfd5351b64c47676241a40ee2942 to your computer and use it in GitHub Desktop.
accepts an onion address (without .onion suffix) and prints the introduction points (relay fingerprints)
#!/usr/bin/env python
from stem.control import Controller
import base64
import binascii
import sys
onion = sys.argv[1]
with Controller.from_socket_file(path='/home/username/.tor/mytorsocket') as controller:
controller.authenticate()
desc = controller.get_hidden_service_descriptor(onion)
for introduction_point in desc.introduction_points():
fingerprint = binascii.hexlify(base64.b32decode(introduction_point.identifier.upper())).upper()
print(onion+":"+fingerprint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment