本文介绍了使用Python进行BGP ASN查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道Python模块或我如何通过ASN(自治系统编号)号码查找公司信息(最好是名称)的解决方案吗?

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?

ASN工具有很多IP,但这不是我所需要的.

There are lots of IP to ASN tools but that is not what I require.

ASN需要输入-公司名称输出.

ASN needs to be the input - company name output.

该网站提供了我需要的信息: http://bgp.potaroo.net/cgi-bin /as-report?as=AS5607&view=2.0

This website has the sort of info I need:http://bgp.potaroo.net/cgi-bin/as-report?as=AS5607&view=2.0

任何想法都值得赞赏!

推荐答案

尝试,也许这就是您所需要的

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('==============')

这篇关于使用Python进行BGP ASN查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 16:25