Added exception handling for shodan lookup

This commit is contained in:
Daniel Dayley 2020-02-21 10:49:33 -07:00
parent 146daef0df
commit d0ca476b35

View File

@ -26,9 +26,12 @@ class ServiceDelegate(ServiceBase) :
def perform_lookup(self,subject) :
if self._api_sessions :
session = next(self.get_api())
host = session.host(subject)
clean = self._clean_newlines(host)
return host
try :
host = session.host(subject)
clean = self._clean_newlines(host)
return host
except shodan.exception.APIError as e:
self.debug("Unable to search for " + subject + " on shodan",1)
pass
def _clean_newlines(self,structure) :