Last active
August 29, 2015 16:59
-
-
Save pavel-odintsov/fac1c8160fd10ceb74e4 to your computer and use it in GitHub Desktop.
Get abuse email for subnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import urllib2 | |
import sys | |
import pprint | |
if len(sys.argv) != 2: | |
sys.exit("Please provide params"); | |
answer = urllib2.urlopen("https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=" + sys.argv[1]) | |
decoded_answer = json.load(answer) | |
try: | |
abuse_email = decoded_answer['data']['anti_abuse_contacts']['abuse_c'][0]['email'] | |
print abuse_email | |
except (KeyError, IndexError): | |
print "Can't request abuse email" | |
А оно возвращает abuse email, если сеть не под RIPE? ARIN, например?
Я использовал API https://abusix.com/contactdb.html в свое время для этих целей.
Надо проверять :(
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: