Parsing the Tor Consensus gives us the IP Addresses of active relays in the Tor network.
Is there a way of getting a relay's descriptors from that particular relay itself ?
Thanks :)
Tor Stack Exchange is a question and answer site for researchers, developers, and users of Tor. It only takes a minute to sign up.
Sign up to join this communityParsing the Tor Consensus gives us the IP Addresses of active relays in the Tor network.
Is there a way of getting a relay's descriptors from that particular relay itself ?
Thanks :)
A Tor relay's descriptor is available at that relay as the resource '/tor/server/authority[.z]'. This is useful when you don't know the relay's fingerprint.
Using IPredator as an example:
http://197.231.221.211:9030/tor/server/authority
Or, using stem:
import stem.descriptor.remote
dir_port = ('197.231.221.211', 9030)
stem.descriptor.remote.Query(resource='/tor/server/authority.z', endpoints=[dir_port]).run()[0]
Or, if you prefer to use the high-level API, which gets the same relay descriptor, but using a slightly different resource internally ('/tor/server/fp/fingerprint.z'):
import stem.descriptor.remote
fingerprint = 'BC630CBBB518BE7E9F4E09712AB0269E9DC7D626'
dir_port = ('197.231.221.211', 9030)
desc = stem.descriptor.remote.get_server_descriptors(fingerprints=[fingerprint], endpoints=[dir_port]).run()[0]
stem can retrieve descriptors using either method, but only when the relay has a DirPort.