Hey, Im trying to write an ip checker script for a mail server/firewall and i want to be able check if the ip is a tor relay, is their a api for looking up ips on atlas.torproject.org ?
Or any other easier way to do it in like python :)
On Fri, Feb 16, 2018 at 3:27 AM flipchan flipchan@riseup.net wrote:
Im trying to write an ip checker script for a mail server/firewall and i want to be able check if the ip is a tor relay, is their a api for looking up ips on atlas.torproject.org ?
Do you want to check if it's any relay, or do you want to check if it's an exit?
To check for an exit I've used: https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=X.X.X.X&port=...
Q
Hey
Am 16-Feb-18 um 02:26 schrieb flipchan:
Hey, Im trying to write an ip checker script for a mail server/firewall and i want to be able check if the ip is a tor relay, is their a api for looking up ips on atlas.torproject.org ?
Or any other easier way to do it in like python :)
You can run a tor client and: # grep "a.b.c.d" /var/db/tor/cached-consensus
On 16 Feb 2018, at 17:49, Felix zwiebel@quantentunnel.de wrote:
Hey
Am 16-Feb-18 um 02:26 schrieb flipchan: Hey, Im trying to write an ip checker script for a mail server/firewall and i want to be able check if the ip is a tor relay, is their a api for looking up ips on atlas.torproject.org ?
Or any other easier way to do it in like python :)
For exit IP addresses, you can query the bulk exit list, or Onionoo.
You can run a tor client and: # grep "a.b.c.d" /var/db/tor/cached-consensus
The cached consensus only contains ORPort addresses, not exit IP addresses. Most are the same, some are different.
T
On Thu, Feb 15, 2018 at 7:26 PM, flipchan flipchan@riseup.net wrote:
Hey, Im trying to write an ip checker script for a mail server/firewall and i want to be able check if the ip is a tor relay, is their a api for looking up ips on atlas.torproject.org ?
I found querying https://onionite.now.sh and grepping the result was an easy way to determine if an IP address is a relay or not.
Or any other easier way to do it in like python :)
Here ya go. This downloads the consensus so if you're gonna be doing more than an occasional one-off check you should use the suggestions from teor.
========================================
import sys import stem.descriptor.remote
def is_exit(address): for desc in stem.descriptor.remote.get_consensus(): if 'Exit' in desc.flags and address == desc.address: return True
return False
if __name__ == '__main__': if len(sys.argv) < 2: print('You need to provide an address to check.') elif is_exit(sys.argv[1]): print('%s is a tor exit.' % sys.argv[1]) else: print('%s is not a tor exit.' % sys.argv[1])
========================================
% python demo.py 199.58.81.140 199.58.81.140 is not a tor exit.
% python demo.py 154.16.149.74 154.16.149.74 is a tor exit.
On 17 Feb 2018, at 12:12, Damian Johnson atagar@torproject.org wrote:
Or any other easier way to do it in like python :)
Here ya go. This downloads the consensus so if you're gonna be doing more than an occasional one-off check you should use the suggestions from teor.
This script won't find exits that set OutboundBindAddress.
T
tor-relays@lists.torproject.org