SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
refactor: improve search template for sites in socialprofiles
Amr Awadd49ed8eff36b
diff --git a/modules/sfp_socialprofiles.py b/modules/sfp_socialprofiles.pyindex 87e6c970..fe37c39a 100644--- a/modules/sfp_socialprofiles.py+++ b/modules/sfp_socialprofiles.py@@ -20,21 +20,21 @@ sites = {# Search string to use, domain name the profile will sit on within# those search results."Facebook": [- "+title:%22{0}%22%20+site:facebook.com",+ "\"{0}\" site:facebook.com",['"(https?://[a-z\.]*facebook.[a-z\.]+/[^/"<> ]+)"','(https?%3a%2f%2f[a-z\.]*facebook.[a-z\.]+%2f[^\/"<> ]+)',],],"Google+": [- "+title:%22{0}%22%20+site:plus.google.com",+ "\"{0}\" site:plus.google.com",['"(https?://plus.google.[a-z\.]+/\d+[^"<>\/ ]+)"','(https?%3a%2f%2fplus.google.[a-z\.]+%2f\d+[^\/"<> ]+)',],],"LinkedIn": [- "+title:%22{0}%22%20+site:linkedin.com",+ "\"{0}\" site:linkedin.com",['"(https?://[a-z\.]*linkedin.[a-z\.]+/[^/"<> ]+)"','(https?%3a%2f%2f[a-z\.]*linkedin.[a-z\.]+%2f[^\/"<> ]+)',@@ -148,11 +148,12 @@ class sfp_socialprofiles(SpiderFootPlugin):if results is None:self.sf.info("No data returned from " + self.opts["method"] + ".")- return None+ continueif self.checkForStop():return None+web_search_url = results["webSearchUrl"]response = self.sf.fetchUrl(web_search_url,@@ -162,7 +163,7 @@ class sfp_socialprofiles(SpiderFootPlugin):if response["status"] != "OK":self.sf.error("Failed to fetch bing web search URL", exception=False)- return None+ continue# Submit the results for analysisevt = SpiderFootEvent(@@ -170,6 +171,7 @@ class sfp_socialprofiles(SpiderFootPlugin):)self.notifyListeners(evt)+for searchDom in sites[site][1]:matches = re.findall(searchDom, response["content"], re.IGNORECASE | re.MULTILINE