Skip to content
Permalink
Browse files

Update ip_whois bot command

  • Loading branch information...
pwnbus committed Jul 1, 2019
1 parent ed6c3f6 commit dd1f74ef65cab3a64d4ee1f61b86d82e7bdcd92e
Showing with 2 additions and 2 deletions.
  1. +1 −1 bot/irc/mozdefbot.py
  2. +1 −1 bot/slack/commands/ip_whois.py
@@ -219,7 +219,7 @@ def priv_handler(client, actor, recipient, message):
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')
description = whois['nets'][0]['description']
self.client.msg(
recipient, "{0} description: {1}".format(field, description))
else:
@@ -16,7 +16,7 @@ def handle_command(self, parameters):
ip = netaddr.IPNetwork(ip_token)[0]
if (not ip.is_loopback() and not ip.is_private() and not ip.is_reserved()):
whois = IPWhois(ip).lookup_whois()
description = str(whois['nets'][0]['description']).encode('string_escape')
description = whois['nets'][0]['description']
response += "{0} description: {1}\n".format(ip_token, description)
else:
response += "{0}: hrm...loopback? private ip?\n".format(ip_token)

0 comments on commit dd1f74e

Please sign in to comment.
You can’t perform that action at this time.