在命令行上查询网络滥用联系人,以获取滥用-contacts.abusix.zone上的给定IP地址
querycontacts的Python项目详细描述
query contacts-查询滥用联系人
安装
pip install querycontacts
命令行用法
usage: querycontacts [-h] [--provider PROVIDER] [--version] ip
QueryContact - Find the Abuse contact for a IP address
positional arguments:
ip query network abuse contacts for a given ip address
optional arguments:
-h, --help show this help message and exit
--provider PROVIDER change standard network abuse contacts provider.
Defaults to abuse-contacts.abusix.zone
--version show program's version number and exit
示例
显示版本:
$ querycontacts --version
querycontacts 1.1.1
显示IP的滥用联系人:
$ IP=$(curl ipecho.net/plain)
$ querycontacts $IP
abuse@yourisp.example.com
未找到滥用联系人时出错:
$ querycontacts 127.0.0.1
querycontacts: error: no contacts for 127.0.0.1
库使用
>>> from querycontacts import ContactFinder
>>> qf = ContactFinder()
>>> qf.find('127.0.0.2')
['root@localhost', 'abuse@localhost']
>>> qf.find('::ffff:7f00:2')
['root@localhost']