问题
Does anyone know of a Python module or a solution for how I could lookup company info (Name preferably) via the ASN (autonomous system number) number?
There are lots of IP to ASN tools but that is not what I require.
ASN needs to be the input - company name output.
This website has the sort of info I need: http://bgp.potaroo.net/cgi-bin/as-report?as=AS5607&view=2.0
Any ideas are appreciated!
回答1:
That information is available publicly on the CIDR-Report website.
This url has all the info you need and is updated daily. Big file, it might take a while to load : http://www.cidr-report.org/as2.0/autnums.html
回答2:
Try this, it's maybe what you need
from cymruwhois import Client
import ipresolved
domain='facebook.com'
ips=ipresolved.getipresolvedfromdomain(domain)
c=Client()
for i in ips.json()['resolutions']:
ip=i['ip_address']
print('ip : '+ip)
r=c.lookup(ip)
print('asn number: ',r.asn)
print('asn owener : ',r.owner)
print('==============')
来源:https://stackoverflow.com/questions/29476991/bgp-asn-lookup-with-python