RedSiege/Just-Metadata

whois_info.py does not fail gracefully

Rich5 opened this issue · 2 comments

Rich5 commented

Querying Shodan for information about x.x.x.x
Querying Shodan for information about x.x.x.x
Getting info on... x.x.x.x
Getting info on... x.x.x.x
Gathering whois information about x.x.x.x
Traceback (most recent call last):
File "JustMetadata.py", line 94, in
the_conductor.menu_system()
File "/root/Tools/Just-MetaData/common/orchestra.py", line 226, in menu_system
self.user_command.split()[1])
File "/root/Tools/Just-MetaData/common/orchestra.py", line 340, in run_gather_command
ig_obj.gather(self.system_objects)
File "modules/intelgathering/whois_info.py", line 26, in gather
incoming_ip_obj[0].ip_whois = ip_whois.lookup()

File "/usr/local/lib/python2.7/dist-packages/ipwhois/ipwhois.py", line 115, in lookup
asn_data, response = self.net.lookup_asn(retry_count)
File "/usr/local/lib/python2.7/dist-packages/ipwhois/net.py", line 623, in lookup_asn
retry_count
File "/usr/local/lib/python2.7/dist-packages/ipwhois/net.py", line 517, in get_http_json
raise HTTPLookupError('HTTP lookup failed for %r.' % url)
ipwhois.exceptions.HTTPLookupError: HTTP lookup failed for 'http://whois.arin.net/rest/nets;q=x.x.x.x?showDetails=true&showARIN=true'.

This should now be fixed. Thanks for finding these! I'm catching some errors, but not the ones you're encountering, so I appreciate the help with reporting them!

Rich5 commented

Not a problem. You can't test every case