SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Use self.checkForStop() in module loops
Brendan Colesc8716e71e974
diff --git a/modules/sfp_darksearch.py b/modules/sfp_darksearch.pyindex 25a48e04..a33bed57 100644--- a/modules/sfp_darksearch.py+++ b/modules/sfp_darksearch.py@@ -89,6 +89,9 @@ class sfp_darksearch(SpiderFootPlugin):page = 1pages = self.opts['max_pages']while page <= pages:+ if self.checkForStop():+ return None+res = self.query(eventData, page)if res is None:diff --git a/modules/sfp_dnsneighbor.py b/modules/sfp_dnsneighbor.pyindex 1ddbe2c5..73aa23e0 100644--- a/modules/sfp_dnsneighbor.py+++ b/modules/sfp_dnsneighbor.py@@ -87,11 +87,12 @@ class sfp_dnsneighbor(SpiderFootPlugin):c = int(maxip)while s <= c:- sip = str(IPAddress(s))- self.sf.debug("Attempting look-aside lookup of: " + sip)if self.checkForStop():return None+ sip = str(IPAddress(s))+ self.sf.debug("Attempting look-aside lookup of: " + sip)+if sip in self.hostresults or sip == eventData:s += 1continuediff --git a/modules/sfp_flickr.py b/modules/sfp_flickr.pyindex 9a24eb76..3e55ad54 100644--- a/modules/sfp_flickr.py+++ b/modules/sfp_flickr.py@@ -105,6 +105,9 @@ class sfp_flickr(SpiderFootPlugin):pages = self.opts['maxpages']per_page = self.opts['per_page']while page <= pages:+ if self.checkForStop():+ return None+res = self.query("@"+eventData, api_key, page=page, per_page=per_page)if res is None:diff --git a/modules/sfp_intelx.py b/modules/sfp_intelx.pyindex e9fb1882..ed48d453 100644--- a/modules/sfp_intelx.py+++ b/modules/sfp_intelx.py@@ -115,6 +115,9 @@ class sfp_intelx(SpiderFootPlugin):count = 0status = 3 # status 3 = No results yet, keep trying. 0 = Success with resultswhile status == 3 and count < limit:+ if self.checkForStop():+ return None+res = self.sf.fetchUrl(resulturl, headers=headers)if res['content'] is None:self.sf.info("No IntelligenceX info found for results from " + qry)diff --git a/modules/sfp_onionsearchengine.py b/modules/sfp_onionsearchengine.pyindex e22d6d10..0665fca3 100644--- a/modules/sfp_onionsearchengine.py+++ b/modules/sfp_onionsearchengine.py@@ -67,6 +67,9 @@ class sfp_onionsearchengine(SpiderFootPlugin):paging = ""pagenr = 1while keepGoing:+ if self.checkForStop():+ return None+# Sites hosted on the domaindata = self.sf.fetchUrl("https://onionsearchengine.com/search.php?search=\"" + \eventData.replace(" ", "%20") + "\"&submit=Search" + paging,diff --git a/modules/sfp_scylla.py b/modules/sfp_scylla.pyindex 989813d6..7a948387 100644--- a/modules/sfp_scylla.py+++ b/modules/sfp_scylla.py@@ -110,6 +110,9 @@ class sfp_scylla(SpiderFootPlugin):passwords = list()while position < (per_page * max_pages):+ if self.checkForStop():+ return None+if self.errorState:breakdiff --git a/modules/sfp_torch.py b/modules/sfp_torch.pyindex 71fe2281..86a1f59d 100644--- a/modules/sfp_torch.py+++ b/modules/sfp_torch.py@@ -81,6 +81,10 @@ class sfp_torch(SpiderFootPlugin):pagecount = 0p = ""while "color=gray>next >>" not in pagecontent.lower() and pagecount < self.opts['pages']:+ # Check if we've been asked to stop+ if self.checkForStop():+ return None+if pagecount > 0:p = "&np=" + str(pagecount)pagecount += 1@@ -97,10 +101,6 @@ class sfp_torch(SpiderFootPlugin):pagecontent = data['content']if "No documents were found" not in data['content']:- # Check if we've been asked to stop- if self.checkForStop():- return None-# Submit the google results for analysisevt = SpiderFootEvent("SEARCH_ENGINE_WEB_CONTENT", data['content'],self.__name__, event)