SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Bug fixes.
smicallefef0f3425b167
diff --git a/modules/sfp_bingsearch.py b/modules/sfp_bingsearch.pyindex 07889d35..bc98b824 100644--- a/modules/sfp_bingsearch.py+++ b/modules/sfp_bingsearch.py@@ -16,12 +16,15 @@ class sfp_bingsearch(SpiderFootPlugin):"""Bing:Footprint,Investigate,Passive:Search Engines:apikey:Obtain information from bing to identify sub-domains and links."""# Default options- opts = {"pages": 20, "api_key": ""}+ opts = {+ "pages": 20,+ "api_key": ""+ }# Option descriptionsoptdescs = {- "pages": "Number of max bing results to request from api.",- "api_key": "Bing API Key.",+ "pages": "Number of max bing results to request from the API.",+ "api_key": "Bing API Key."}results = list()@@ -91,7 +94,7 @@ class sfp_bingsearch(SpiderFootPlugin):timeout=self.opts["_fetchtimeout"],useragent=self.opts["_useragent"],)- if response['status'] == 'OK':+ if response['code'].startswith('2'):evt = SpiderFootEvent("SEARCH_ENGINE_WEB_CONTENT", response["content"], self.__name__, event)diff --git a/modules/sfp_googlesearch.py b/modules/sfp_googlesearch.pyindex 83ad7146..af69566e 100644--- a/modules/sfp_googlesearch.py+++ b/modules/sfp_googlesearch.py@@ -21,13 +21,14 @@ class sfp_googlesearch(SpiderFootPlugin):# Default optionsopts = {- "api_key": "", "cse_id": "",+ "api_key": "",+ "cse_id": ""}# Option descriptionsoptdescs = {"api_key": "Google API Key.",- "cse_id": "Google Custom Search Engine ID.",+ "cse_id": "Google Custom Search Engine ID."}# Targetdiff --git a/modules/sfp_onioncity.py b/modules/sfp_onioncity.pyindex a2775616..8d0fa003 100644--- a/modules/sfp_onioncity.py+++ b/modules/sfp_onioncity.py@@ -20,7 +20,9 @@ class sfp_onioncity(SpiderFootPlugin):# Default optionsopts = {- "api_key": "", "cse_id": "", 'fetchlinks': True+ "api_key": "",+ "cse_id": "",+ 'fetchlinks': True}# Option descriptions@@ -89,7 +91,7 @@ class sfp_onioncity(SpiderFootPlugin):timeout=self.opts["_fetchtimeout"],useragent=self.opts["_useragent"],)- if response['status'] == 'OK':+ if response['code'].startswith('2'):evt = SpiderFootEvent("SEARCH_ENGINE_WEB_CONTENT", response["content"], self.__name__, event)diff --git a/modules/sfp_scylla.py b/modules/sfp_scylla.pyindex a7a78819..270c8a80 100644--- a/modules/sfp_scylla.py+++ b/modules/sfp_scylla.py@@ -33,10 +33,12 @@ class sfp_scylla(SpiderFootPlugin):}results = None+ errorState = Falsedef setup(self, sfc, userOpts=dict()):self.sf = sfcself.results = dict()+ self.errorState = Falsefor opt in userOpts.keys():self.opts[opt] = userOpts[opt]@@ -67,6 +69,11 @@ class sfp_scylla(SpiderFootPlugin):time.sleep(self.opts['pause'])+ if res['code'].startswith("50"):+ self.sf.error("Syclla.sh is having problems.", False)+ self.errorState = True+ return None+if res['content'] is None:self.sf.debug('No response from Scylla.sh')return None@@ -88,6 +95,9 @@ class sfp_scylla(SpiderFootPlugin):if eventData in self.results:return None+ if self.errorState:+ return None+self.results[eventData] = Trueself.sf.debug("Received event, " + eventName + ", from " + srcModuleName)@@ -96,7 +106,14 @@ class sfp_scylla(SpiderFootPlugin):max_pages = int(self.opts['max_pages'])per_page = int(self.opts['per_page'])+ emails = list()+ hashes = list()+ passwords = list()+while position < (per_page * max_pages):+ if self.errorState:+ return None+data = self.query(eventData, per_page, position)if not data:@@ -107,10 +124,6 @@ class sfp_scylla(SpiderFootPlugin):#evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)#self.notifyListeners(evt)- emails = list()- hashes = list()- passwords = list()-for result in data:source = result.get('_source')@@ -125,9 +138,8 @@ class sfp_scylla(SpiderFootPlugin):# Skip unrelated emails# Scylla sometimes returns broader results than the searched data- mailDom = email.lower().split('@')[1]- if not self.getTarget().matches(mailDom, includeChildren=True, includeParents=True):- self.sf.debug("Skipped address: " + match)+ if not email.endswith("@" + eventData):+ self.sf.debug("Skipped address: " + email)continuebreach = source.get('Domain')diff --git a/modules/sfp_socialprofiles.py b/modules/sfp_socialprofiles.pyindex ee7c21cc..7ac28f60 100644--- a/modules/sfp_socialprofiles.py+++ b/modules/sfp_socialprofiles.py@@ -22,22 +22,22 @@ sites = {"Facebook": ["\"{name}\"+site:facebook.com",[- '"(https?://[a-z\.]*facebook.[a-z\.]+/[^/"<> ]+)"',- '(https?%3a%2f%2f[a-z\.]*facebook.[a-z\.]+%2f[^\/"<> ]+)',+ '[ \'"](https?://[a-z\.]*facebook.[a-z\.]+/[^/"\'<> ]+/?)[\'" ]',+ '(https?%3a%2f%2f[a-z\.]*facebook.[a-z\.]+%2f[^\/"\'<> ]+/?)',],],"Google+": ["\"{name}\"+site:plus.google.com",[- '"(https?://plus.google.[a-z\.]+/\d+[^"<>\/ ]+)"',- '(https?%3a%2f%2fplus.google.[a-z\.]+%2f\d+[^\/"<> ]+)',+ '[ \'"](https?://plus.google.[a-z\.]+/\d+[^"\'<>\/ ]+)[\'" ]',+ '(https?%3a%2f%2fplus.google.[a-z\.]+%2f\d+[^\/"\'<> ]+)',],],"LinkedIn": ["\"{name}\"+site:linkedin.com",[- '"(https?://[a-z\.]*linkedin.[a-z\.]+/[^/"<> ]+)"',- '(https?%3a%2f%2f[a-z\.]*linkedin.[a-z\.]+%2f[^\/"<> ]+)',+ '["\' ](https?://[a-z\.]*linkedin.[a-z\.]+/[^\?"\'<> ]+)[\'" ]',+ '(https?%3a%2f%2f[a-z\.]*linkedin.[a-z\.]+%2f[^\?"\'<> ]+)',],],}@@ -59,7 +59,7 @@ class sfp_socialprofiles(SpiderFootPlugin):# Option descriptionsoptdescs = {"count": "Number of bing search engine results of identified profiles to iterate through.",- "method": "Search engine to use: google or bing.",+ "method": "Search engine to use: 'google' or 'bing'.","tighten": "Tighten results by expecting to find the keyword of the target domain mentioned in the social media profile page results?","bing_api_key": "Bing API Key.","google_api_key": "Google API Key.",@@ -154,34 +154,23 @@ class sfp_socialprofiles(SpiderFootPlugin):return None- web_search_url = results["webSearchUrl"]- response = self.sf.fetchUrl(- web_search_url,- timeout=self.opts["_fetchtimeout"],- useragent=self.opts["_useragent"],- )-- if response["status"] != "OK":- self.sf.error("Failed to fetch bing web search URL", exception=False)- continue-# Submit the results for analysisevt = SpiderFootEvent(- "SEARCH_ENGINE_WEB_CONTENT", response["content"], self.__name__, event+ "SEARCH_ENGINE_WEB_CONTENT", str(results), self.__name__, event)self.notifyListeners(evt)-instances = list()for searchDom in sites[site][1]:# Search both the urls & the search engine web content- search_string = " ".join(results["urls"] + [response["content"]])+ search_string = " ".join(results["urls"] + [str(results)])++ self.sf.debug("Applying " + searchDom + " to " + search_string)matches = re.findall(searchDom, search_string, re.IGNORECASE | re.MULTILINE)- import pdb; pdb.set_trace()if not matches:continuediff --git a/sflib.py b/sflib.pyindex d8515a64..4e7e2369 100644--- a/sflib.py+++ b/sflib.py@@ -1266,7 +1266,7 @@ class SpiderFoot:# timeout: API call timeoutdef bingIterate(self, searchString, opts=dict()):endpoint = "https://api.cognitive.microsoft.com/bing/v7.0/search?q={search_string}&".format(- search_string=SearchString.replace(" ", "%20")+ search_string=searchString.replace(" ", "%20"))params = {