Added exception handling for shodan lookup
This commit is contained in:
parent
146daef0df
commit
d0ca476b35
@ -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) :
|
||||
|
Loading…
Reference in New Issue
Block a user