Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

sflib: Set fetchUrl SSL verification default to True

Brendan Coles050a9a9cf876
diff --git a/modules/sfp_accounts.py b/modules/sfp_accounts.py
index 835810ac..89e485fe 100644
--- a/modules/sfp_accounts.py
+++ b/modules/sfp_accounts.py
@@ -102,7 +102,7 @@ class sfp_accounts(SpiderFootPlugin):
url + "</SFURL>"
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'], noLog=True)
+ useragent=self.opts['_useragent'], noLog=True, verify=False)
if not res['content']:
with self.lock:
diff --git a/modules/sfp_ahmia.py b/modules/sfp_ahmia.py
index 2cb907b8..fe5bc7a4 100644
--- a/modules/sfp_ahmia.py
+++ b/modules/sfp_ahmia.py
@@ -93,7 +93,8 @@ class sfp_ahmia(SpiderFootPlugin):
return None
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(link, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + link + " as no data returned")
diff --git a/modules/sfp_binstring.py b/modules/sfp_binstring.py
index 1bfb8e42..a25d2476 100644
--- a/modules/sfp_binstring.py
+++ b/modules/sfp_binstring.py
@@ -128,7 +128,8 @@ class sfp_binstring(SpiderFootPlugin):
res = self.sf.fetchUrl(eventData,
useragent=self.opts['_useragent'],
dontMangle=True,
- sizeLimit=self.opts['maxfilesize'])
+ sizeLimit=self.opts['maxfilesize'],
+ verify=False)
if res:
self.sf.debug("Searching for strings")
diff --git a/modules/sfp_crossref.py b/modules/sfp_crossref.py
index 8c920cd7..e858b7d1 100644
--- a/modules/sfp_crossref.py
+++ b/modules/sfp_crossref.py
@@ -78,7 +78,9 @@ class sfp_crossref(SpiderFootPlugin):
self.sf.debug("Testing for affiliation: " + eventData)
res = self.sf.fetchUrl(eventData, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'], sizeLimit=10000000)
+ useragent=self.opts['_useragent'],
+ sizeLimit=10000000,
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + eventData + " as no data returned")
@@ -108,7 +110,8 @@ class sfp_crossref(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'],
- sizeLimit=10000000)
+ sizeLimit=10000000,
+ verify=False)
if res['content'] is not None:
for name in self.getTarget().getNames():
pat = re.compile("([\.\'\/\"\ ]" + name + "[\'\/\"\ ])",
diff --git a/modules/sfp_darksearch.py b/modules/sfp_darksearch.py
index 76528cd9..ed38e27d 100644
--- a/modules/sfp_darksearch.py
+++ b/modules/sfp_darksearch.py
@@ -141,7 +141,8 @@ class sfp_darksearch(SpiderFootPlugin):
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(link,
timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + link + " as no data returned")
diff --git a/modules/sfp_filemeta.py b/modules/sfp_filemeta.py
index f3413948..cede4806 100644
--- a/modules/sfp_filemeta.py
+++ b/modules/sfp_filemeta.py
@@ -77,7 +77,8 @@ class sfp_filemeta(SpiderFootPlugin):
# typically large.
ret = self.sf.fetchUrl(eventData, timeout=self.opts['timeout'],
useragent=self.opts['_useragent'], dontMangle=True,
- sizeLimit=10000000)
+ sizeLimit=10000000,
+ verify=False)
if ret['content'] is None:
self.sf.error("Unable to fetch file for meta analysis: " +
eventData, False)
diff --git a/modules/sfp_greynoise.py b/modules/sfp_greynoise.py
index aad8886d..749f56ea 100644
--- a/modules/sfp_greynoise.py
+++ b/modules/sfp_greynoise.py
@@ -74,7 +74,7 @@ class sfp_greynoise(SpiderFootPlugin):
ret = None
header = { "key": self.opts['api_key'] }
- url = "https://" + "enterprise.api.greynoise.io/v2/experimental/gnql?query=" + qry
+ url = "https://enterprise.api.greynoise.io/v2/experimental/gnql?query=" + qry
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent="SpiderFoot", headers=header)
diff --git a/modules/sfp_junkfiles.py b/modules/sfp_junkfiles.py
index 6c9628fe..f0175bf0 100644
--- a/modules/sfp_junkfiles.py
+++ b/modules/sfp_junkfiles.py
@@ -67,7 +67,8 @@ class sfp_junkfiles(SpiderFootPlugin):
fetch = junkUrl + str(random.SystemRandom().randint(0, 99999999))
res = self.sf.fetchUrl(fetch, headOnly=True,
timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['code'] != "404":
host = self.sf.urlBaseUrl(junkUrl)
self.skiphosts[host] = True
@@ -115,7 +116,8 @@ class sfp_junkfiles(SpiderFootPlugin):
res = self.sf.fetchUrl(fetch, headOnly=True,
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'],
- sizeLimit=10000000)
+ sizeLimit=10000000,
+ verify=False)
if res['realurl'] != fetch:
self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
@@ -159,7 +161,8 @@ class sfp_junkfiles(SpiderFootPlugin):
continue
res = self.sf.fetchUrl(fetch, headOnly=True,
timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['realurl'] != fetch:
self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
@@ -188,7 +191,8 @@ class sfp_junkfiles(SpiderFootPlugin):
continue
res = self.sf.fetchUrl(fetch, headOnly=True,
timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['realurl'] != fetch:
self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
diff --git a/modules/sfp_onioncity.py b/modules/sfp_onioncity.py
index 10f82c8b..f0d5efdd 100644
--- a/modules/sfp_onioncity.py
+++ b/modules/sfp_onioncity.py
@@ -130,7 +130,8 @@ class sfp_onioncity(SpiderFootPlugin):
torlink = link.replace(".onion.link", ".onion")
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(torlink, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + link + " as no data returned")
diff --git a/modules/sfp_onionsearchengine.py b/modules/sfp_onionsearchengine.py
index c892d5c9..5ef2cdbd 100644
--- a/modules/sfp_onionsearchengine.py
+++ b/modules/sfp_onionsearchengine.py
@@ -140,7 +140,8 @@ class sfp_onionsearchengine(SpiderFootPlugin):
res = self.sf.fetchUrl(link,
timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + link + " as no data returned")
diff --git a/modules/sfp_scylla.py b/modules/sfp_scylla.py
index 7c84a0af..7c9be045 100644
--- a/modules/sfp_scylla.py
+++ b/modules/sfp_scylla.py
@@ -69,7 +69,9 @@ class sfp_scylla(SpiderFootPlugin):
res = self.sf.fetchUrl('https://scylla.sh/search?' + urllib.parse.urlencode(params),
headers=headers,
timeout=15,
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ # expired certficate
+ verify=False)
time.sleep(self.opts['pause'])
diff --git a/modules/sfp_socialprofiles.py b/modules/sfp_socialprofiles.py
index e4dfa46f..a04ebe0f 100644
--- a/modules/sfp_socialprofiles.py
+++ b/modules/sfp_socialprofiles.py
@@ -202,6 +202,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
match,
timeout=self.opts["_fetchtimeout"],
useragent=self.opts["_useragent"],
+ verify=False
)
if pres["content"] is None:
diff --git a/modules/sfp_spider.py b/modules/sfp_spider.py
index d13d7b06..d1e0f1e9 100644
--- a/modules/sfp_spider.py
+++ b/modules/sfp_spider.py
@@ -91,7 +91,8 @@ class sfp_spider(SpiderFootPlugin):
# Fetch the contents of the supplied URL (object returned)
fetched = self.sf.fetchUrl(url, False, cookies,
self.opts['_fetchtimeout'], self.opts['_useragent'],
- sizeLimit=10000000)
+ sizeLimit=10000000,
+ verify=False)
self.fetchedPages[url] = True
# Track cookies a site has sent, then send the back in subsquent requests
@@ -273,7 +274,8 @@ class sfp_spider(SpiderFootPlugin):
if eventName == "INTERNET_NAME":
for prefix in self.opts['start']:
res = self.sf.fetchUrl(prefix + eventData, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is not None:
spiderTarget = prefix + eventData
evt = SpiderFootEvent("LINKED_URL_INTERNAL", spiderTarget,
@@ -303,7 +305,9 @@ class sfp_spider(SpiderFootPlugin):
# Are we respecting robots.txt?
if self.opts['robotsonly'] and targetBase not in self.robotsRules:
robotsTxt = self.sf.fetchUrl(targetBase + '/robots.txt',
- timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
+ timeout=self.opts['_fetchtimeout'],
+ useragent=self.opts['_useragent'],
+ verify=False)
if robotsTxt['content'] is not None:
self.sf.debug('robots.txt contents: ' + robotsTxt['content'])
self.robotsRules[targetBase] = self.sf.parseRobotsTxt(robotsTxt['content'])
diff --git a/modules/sfp_subdomain_takeover.py b/modules/sfp_subdomain_takeover.py
index 1488b116..91474a11 100644
--- a/modules/sfp_subdomain_takeover.py
+++ b/modules/sfp_subdomain_takeover.py
@@ -102,7 +102,8 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
res = self.sf.fetchUrl(
"%s://%s/" % (proto, eventData),
timeout=15,
- useragent=self.opts['_useragent']
+ useragent=self.opts['_useragent'],
+ verify=False
)
if not res:
continue
diff --git a/modules/sfp_tldsearch.py b/modules/sfp_tldsearch.py
index 2e96f1f1..889a2445 100644
--- a/modules/sfp_tldsearch.py
+++ b/modules/sfp_tldsearch.py
@@ -126,7 +126,8 @@ class sfp_tldsearch(SpiderFootPlugin):
pageContent = self.sf.fetchUrl('http://' + result,
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'],
- noLog=True)
+ noLog=True,
+ verify=False)
if pageContent['content'] is not None:
evt = SpiderFootEvent("SIMILARDOMAIN", result, self.__name__, source)
self.notifyListeners(evt)
diff --git a/modules/sfp_torch.py b/modules/sfp_torch.py
index a06c4421..28ffc2b2 100644
--- a/modules/sfp_torch.py
+++ b/modules/sfp_torch.py
@@ -125,7 +125,8 @@ class sfp_torch(SpiderFootPlugin):
return None
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(link, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
+ useragent=self.opts['_useragent'],
+ verify=False)
if res['content'] is None:
self.sf.debug("Ignoring " + link + " as no data returned")
diff --git a/sflib.py b/sflib.py
index 059aa11f..3cd8a66e 100644
--- a/sflib.py
+++ b/sflib.py
@@ -2056,7 +2056,7 @@ class SpiderFoot:
def fetchUrl(self, url, fatal=False, cookies=None, timeout=30,
useragent="SpiderFoot", headers=None, noLog=False,
postData=None, dontMangle=False, sizeLimit=None,
- headOnly=False, verify=False):
+ headOnly=False, verify=True):
"""Fetch a URL, return the response object."""
result = {