зеркало из https://github.com/mozilla/MozDef.git
Use ipwhois description instead of name
This commit is contained in:
Родитель
28535ddf95
Коммит
8244e8bbbb
|
@ -238,8 +238,9 @@ class mozdefBot():
|
|||
ip = netaddr.IPNetwork(field)[0]
|
||||
if (not ip.is_loopback() and not ip.is_private() and not ip.is_reserved()):
|
||||
whois = IPWhois(ip).lookup_whois()
|
||||
description = whois['nets'][0]['description'].encode('string_escape')
|
||||
self.client.msg(
|
||||
recipient, "{0} name: {1}".format(field, whois['nets'][0]['name']))
|
||||
recipient, "{0} description: {1}".format(field, description))
|
||||
else:
|
||||
self.client.msg(
|
||||
recipient, "{0}: hrm..loopback? private ip?".format(field))
|
||||
|
|
Загрузка…
Ссылка в новой задаче