Skip to content

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

flake8: modules: Resolve violations: A, SFS101, SFS201 (#1304)

bcolesd3657a6db4d4
diff --git a/modules/sfp_abusech.py b/modules/sfp_abusech.py
index b924ab1e..c017f4e0 100644
--- a/modules/sfp_abusech.py
+++ b/modules/sfp_abusech.py
@@ -132,7 +132,7 @@ class sfp_abusech(SpiderFootPlugin):
"MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]
# Look up 'list' type resources
- def resourceList(self, id, target, targetType):
+ def resourceList(self, replaceme_id, target, targetType):
targetDom = ''
# Get the base domain if we're supplied a domain
if targetType == "domain":
@@ -142,7 +142,7 @@ class sfp_abusech(SpiderFootPlugin):
for check in list(malchecks.keys()):
cid = malchecks[check]['id']
- if id == cid:
+ if replaceme_id == cid:
data = dict()
url = malchecks[check]['url']
data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
diff --git a/modules/sfp_bambenek.py b/modules/sfp_bambenek.py
index 4c7b23ee..a5cee99f 100644
--- a/modules/sfp_bambenek.py
+++ b/modules/sfp_bambenek.py
@@ -112,7 +112,7 @@ class sfp_bambenek(SpiderFootPlugin):
"MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]
# Look up 'list' type resources
- def resourceList(self, id, target, targetType):
+ def resourceList(self, replaceme_id, target, targetType):
targetDom = ''
# Get the base domain if we're supplied a domain
if targetType == "domain":
@@ -122,7 +122,7 @@ class sfp_bambenek(SpiderFootPlugin):
for check in list(malchecks.keys()):
cid = malchecks[check]['id']
- if id == cid:
+ if replaceme_id == cid:
data = dict()
url = malchecks[check]['url']
data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
diff --git a/modules/sfp_bitcoin.py b/modules/sfp_bitcoin.py
index 94970614..3756d8b9 100644
--- a/modules/sfp_bitcoin.py
+++ b/modules/sfp_bitcoin.py
@@ -53,8 +53,7 @@ class sfp_bitcoin(SpiderFootPlugin):
def to_bytes(self, n, length):
h = '%x' % n
- s = codecs.decode(('0' * (len(h) % 2) + h).zfill(length * 2), "hex")
- return s
+ return codecs.decode(('0' * (len(h) % 2) + h).zfill(length * 2), "hex")
def decode_base58(self, bc, length):
digits58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
@@ -75,7 +74,7 @@ class sfp_bitcoin(SpiderFootPlugin):
sourceData = self.sf.hashstring(eventData)
if sourceData in self.results:
- return None
+ return
self.results[sourceData] = True
@@ -84,7 +83,7 @@ class sfp_bitcoin(SpiderFootPlugin):
# thanks to https://stackoverflow.com/questions/21683680/regex-to-match-bitcoin-addresses
matches = re.findall(r"[\s:=\>]([13][a-km-zA-HJ-NP-Z1-9]{25,34})", eventData)
for m in matches:
- self.sf.debug("Bitcoin potential match: " + m)
+ self.sf.debug(f"Bitcoin potential match: {m}")
if self.check_bc(m):
evt = SpiderFootEvent("BITCOIN_ADDRESS", m, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_cinsscore.py b/modules/sfp_cinsscore.py
index 0ce2ab58..7bec13e1 100644
--- a/modules/sfp_cinsscore.py
+++ b/modules/sfp_cinsscore.py
@@ -81,12 +81,12 @@ class sfp_cinsscore(SpiderFootPlugin):
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data["code"] != "200":
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
@@ -98,15 +98,15 @@ class sfp_cinsscore(SpiderFootPlugin):
if targetType == "netblock":
try:
if IPAddress(ip) in IPNetwork(qry):
- self.sf.debug("%s found within netblock/subnet %s in cinsscore.com list." % (ip, qry))
+ self.sf.debug(f"{ip} found within netblock/subnet {qry} in cinsscore.com list.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing: %s" % e)
+ self.sf.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug("%s found in cinsscore.com list." % qry)
+ self.sf.debug(f"{qry} found in cinsscore.com list.")
return url
return None
@@ -149,14 +149,14 @@ class sfp_cinsscore(SpiderFootPlugin):
else:
return None
- self.sf.debug("Checking maliciousness of %s with cinsscore.com" % eventData)
+ self.sf.debug(f"Checking maliciousness of {eventData} with cinsscore.com")
url = self.query(eventData, targetType)
if not url:
return None
- text = "cinsscore.com [%s]\n<SFURL>%s</SFURL>" % (eventData, url)
+ text = f"cinsscore.com [{eventData}]\n<SFURL>{url}</SFURL>"
evt = SpiderFootEvent(evtType, text, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_circllu.py b/modules/sfp_circllu.py
index 7af0d8d3..dd0f9bb7 100644
--- a/modules/sfp_circllu.py
+++ b/modules/sfp_circllu.py
@@ -110,7 +110,7 @@ class sfp_circllu(SpiderFootPlugin):
secret = self.opts['api_key_login'] + ':' + self.opts['api_key_password']
b64_val = base64.b64encode(secret.encode('utf-8'))
headers = {
- 'Authorization': 'Basic %s' % b64_val.decode('utf-8')
+ 'Authorization': f"Basic {b64_val.decode('utf-8')}"
}
# Be more forgiving with the timeout as some queries for subnets can be slow
diff --git a/modules/sfp_cleantalk.py b/modules/sfp_cleantalk.py
index 25215fa7..8e94325a 100644
--- a/modules/sfp_cleantalk.py
+++ b/modules/sfp_cleantalk.py
@@ -95,12 +95,12 @@ class sfp_cleantalk(SpiderFootPlugin):
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data["code"] != "200":
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
@@ -115,15 +115,15 @@ class sfp_cleantalk(SpiderFootPlugin):
if targetType == "netblock":
try:
if IPAddress(ip) in IPNetwork(qry):
- self.sf.debug("%s found within netblock/subnet %s in CleanTalk Spam List." % (ip, qry))
+ self.sf.debug(f"{ip} found within netblock/subnet {qry} in CleanTalk Spam List.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing: %s" % e)
+ self.sf.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug("%s found in CleanTalk Spam List." % qry)
+ self.sf.debug(f"{qry} found in CleanTalk Spam List.")
return url
return None
@@ -166,14 +166,14 @@ class sfp_cleantalk(SpiderFootPlugin):
else:
return None
- self.sf.debug("Checking maliciousness of %s with CleanTalk Spam List" % eventData)
+ self.sf.debug(f"Checking maliciousness of {eventData} with CleanTalk Spam List")
url = self.query(eventData, targetType)
if not url:
return None
- text = "CleanTalk Spam List [%s]\n<SFURL>%s</SFURL>" % (eventData, url)
+ text = f"CleanTalk Spam List [{eventData}]\n<SFURL>{url}</SFURL>"
evt = SpiderFootEvent(evtType, text, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_coinblocker.py b/modules/sfp_coinblocker.py
index 808ba56c..fd12328c 100644
--- a/modules/sfp_coinblocker.py
+++ b/modules/sfp_coinblocker.py
@@ -110,7 +110,7 @@ class sfp_coinblocker(SpiderFootPlugin):
"MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]
# Look up 'list' type resources
- def resourceList(self, id, target, targetType):
+ def resourceList(self, replaceme_id, target, targetType):
targetDom = ''
# Get the base domain if we're supplied a domain
if targetType == "domain":
@@ -120,7 +120,7 @@ class sfp_coinblocker(SpiderFootPlugin):
for check in list(malchecks.keys()):
cid = malchecks[check]['id']
- if id == cid:
+ if replaceme_id == cid:
data = dict()
url = malchecks[check]['url']
data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
diff --git a/modules/sfp_company.py b/modules/sfp_company.py
index 652c0b26..2a4804bf 100644
--- a/modules/sfp_company.py
+++ b/modules/sfp_company.py
@@ -86,13 +86,13 @@ class sfp_company(SpiderFootPlugin):
# Don't re-parse company names
if eventName in ["COMPANY_NAME", "AFFILIATE_COMPANY_NAME"]:
- return None
+ return
if eventName == "TARGET_WEB_CONTENT":
url = event.actualSource
if self.opts['filterjscss'] and (".js" in url or ".css" in url):
self.sf.debug("Ignoring web content from CSS/JS.")
- return None
+ return
self.sf.debug(f"Received event, {eventName}, from {srcModuleName} ({len(eventData)} bytes)")
diff --git a/modules/sfp_customfeed.py b/modules/sfp_customfeed.py
index 2018a417..13b26421 100644
--- a/modules/sfp_customfeed.py
+++ b/modules/sfp_customfeed.py
@@ -84,7 +84,7 @@ class sfp_customfeed(SpiderFootPlugin):
"MALICIOUS_COHOST"]
# Look up 'list' type resources
- def resourceList(self, id, target, targetType):
+ def resourceList(self, replaceme_id, target, targetType):
targetDom = ''
# Get the base domain if we're supplied a domain
if targetType == "domain":
@@ -95,7 +95,7 @@ class sfp_customfeed(SpiderFootPlugin):
for check in list(malchecks.keys()):
cid = malchecks[check]['id']
url = self.opts['url']
- if id == cid:
+ if replaceme_id == cid:
data = dict()
data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
if data['content'] is None:
diff --git a/modules/sfp_dnsraw.py b/modules/sfp_dnsraw.py
index 20f948c5..e45e9103 100644
--- a/modules/sfp_dnsraw.py
+++ b/modules/sfp_dnsraw.py
@@ -110,7 +110,7 @@ class sfp_dnsraw(SpiderFootPlugin):
if not len(res.answer):
continue
except Exception as e:
- self.sf.error("Failed to obtain DNS response for %s (%s)" % (eventData, e))
+ self.sf.error(f"Failed to obtain DNS response for {eventData} ({e})")
continue
# Iterate through DNS answers
diff --git a/modules/sfp_emailcrawlr.py b/modules/sfp_emailcrawlr.py
index f5a8514c..9e502a59 100644
--- a/modules/sfp_emailcrawlr.py
+++ b/modules/sfp_emailcrawlr.py
@@ -95,7 +95,7 @@ class sfp_emailcrawlr(SpiderFootPlugin):
}
res = self.sf.fetchUrl(
- "https://api.emailcrawlr.com/v2/domain?%s" % urllib.parse.urlencode(params),
+ f"https://api.emailcrawlr.com/v2/domain?{urllib.parse.urlencode(params)}",
headers=headers,
timeout=15,
useragent=self.opts['_useragent']
@@ -168,7 +168,7 @@ class sfp_emailcrawlr(SpiderFootPlugin):
data = self.queryDomain(eventData)
if data is None:
- self.sf.debug("No information found for domain %s" % eventData)
+ self.sf.debug(f"No information found for domain {eventData}")
return None
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -177,7 +177,7 @@ class sfp_emailcrawlr(SpiderFootPlugin):
emails = data.get("emails")
if not emails:
- self.sf.info("No emails found for domain %s" % eventData)
+ self.sf.info(f"No emails found for domain {eventData}")
return None
for res in emails:
diff --git a/modules/sfp_emergingthreats.py b/modules/sfp_emergingthreats.py
index b2219c6f..2734020f 100644
--- a/modules/sfp_emergingthreats.py
+++ b/modules/sfp_emergingthreats.py
@@ -88,12 +88,12 @@ class sfp_emergingthreats(SpiderFootPlugin):
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data["code"] != "200":
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return None
@@ -105,15 +105,15 @@ class sfp_emergingthreats(SpiderFootPlugin):
if targetType == "netblock":
try:
if IPAddress(ip) in IPNetwork(qry):
- self.sf.debug("%s found within netblock/subnet %s in emergingthreats.net list." % (ip, qry))
+ self.sf.debug(f"{ip} found within netblock/subnet {qry} in emergingthreats.net list.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing: %s" % e)
+ self.sf.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug("%s found in emergingthreats.net list." % qry)
+ self.sf.debug(f"{qry} found in emergingthreats.net list.")
return url
return None
@@ -156,14 +156,14 @@ class sfp_emergingthreats(SpiderFootPlugin):
else:
return None
- self.sf.debug("Checking maliciousness of %s with emergingthreats.net" % eventData)
+ self.sf.debug(f"Checking maliciousness of {eventData} with emergingthreats.net")
url = self.query(eventData, targetType)
if not url:
return None
- text = "emergingthreats.net [%s]\n<SFURL>%s</SFURL>" % (eventData, url)
+ text = f"emergingthreats.net [{eventData}]\n<SFURL>{url}</SFURL>"
evt = SpiderFootEvent(evtType, text, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_greensnow.py b/modules/sfp_greensnow.py
index ad2936ed..0dd15d5d 100644
--- a/modules/sfp_greensnow.py
+++ b/modules/sfp_greensnow.py
@@ -87,12 +87,12 @@ class sfp_greensnow(SpiderFootPlugin):
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data["code"] != "200":
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error("Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error("Unable to fetch {url}")
self.errorState = True
return None
@@ -104,15 +104,15 @@ class sfp_greensnow(SpiderFootPlugin):
if targetType == "netblock":
try:
if IPAddress(ip) in IPNetwork(qry):
- self.sf.debug("%s found within netblock/subnet %s in greensnow.co list." % (ip, qry))
+ self.sf.debug(f"{ip} found within netblock/subnet {qry} in greensnow.co list.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing: %s" % e)
+ self.sf.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug("%s found in greensnow.co list." % qry)
+ self.sf.debug(f"{qry} found in greensnow.co list.")
return url
return None
@@ -155,14 +155,14 @@ class sfp_greensnow(SpiderFootPlugin):
else:
return None
- self.sf.debug("Checking maliciousness of %s with greensnow.co" % eventData)
+ self.sf.debug(f"Checking maliciousness of {eventData} with greensnow.co")
url = self.query(eventData, targetType)
if not url:
return None
- text = "greensnow.co [%s]\n<SFURL>%s</SFURL>" % (eventData, url)
+ text = f"greensnow.co [{eventData}]\n<SFURL>{url}</SFURL>"
evt = SpiderFootEvent(evtType, text, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_hunter.py b/modules/sfp_hunter.py
index d10c5156..acad524f 100644
--- a/modules/sfp_hunter.py
+++ b/modules/sfp_hunter.py
@@ -92,7 +92,7 @@ class sfp_hunter(SpiderFootPlugin):
ret = None
- url = "https://api.hunter.io/v2/domain-search?%s" % urllib.parse.urlencode(params)
+ url = f"https://api.hunter.io/v2/domain-search?{urllib.parse.urlencode(params)}"
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")
@@ -105,7 +105,7 @@ class sfp_hunter(SpiderFootPlugin):
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error("Error processing JSON response from hunter.io: %s" % e)
+ self.sf.error(f"Error processing JSON response from hunter.io: {e}")
return None
return ret
diff --git a/modules/sfp_hybrid_analysis.py b/modules/sfp_hybrid_analysis.py
index 940a775a..36b0c155 100644
--- a/modules/sfp_hybrid_analysis.py
+++ b/modules/sfp_hybrid_analysis.py
@@ -175,7 +175,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
if res['code'] == '400':
self.sf.error("Failed to retrieve content from Hybrid Analysis: Invalid request")
- self.sf.debug("API response: %s" % res['content'])
+ self.sf.debug(f"API response: {res['content']}")
return None
# Future proofing - Hybrid Analysis does not implement rate limiting
@@ -186,7 +186,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from Hybrid Analysis: Unexpected response status %s" % res['code'])
+ self.sf.error(f"Failed to retrieve content from Hybrid Analysis: Unexpected response status {res['code']}")
self.errorState = True
return None
@@ -227,7 +227,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
return None
if data is None:
- self.sf.debug("No information found for %s" % eventData)
+ self.sf.debug(f"No information found for{eventData}")
return None
results = data.get("result")
@@ -238,14 +238,14 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
hashes = []
for result in results:
- hash = result.get('sha256')
- if hash:
- hashes.append(hash)
+ file_hash = result.get('sha256')
+ if file_hash:
+ hashes.append(file_hash)
if not hashes:
return None
- self.sf.info("Found %s results for %s" % (len(hashes), eventData))
+ self.sf.info(f"Found {len(hashes)} results for {eventData}")
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
self.notifyListeners(evt)
@@ -253,11 +253,11 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
urls = []
domains = []
- for hash in hashes:
- results = self.queryHash(hash)
+ for file_hash in hashes:
+ results = self.queryHash(file_hash)
if not results:
- self.sf.debug("No information found for hash %s" % hash)
+ self.sf.debug(f"No information found for hash {file_hash}")
continue
evt = SpiderFootEvent('RAW_RIR_DATA', str(results), self.__name__, event)
@@ -301,7 +301,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain):
- self.sf.debug("Host %s could not be resolved" % domain)
+ self.sf.debug(f"Host {domain} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", domain, self.__name__, event)
self.notifyListeners(evt)
else:
diff --git a/modules/sfp_jsonwhoiscom.py b/modules/sfp_jsonwhoiscom.py
index 4b79b132..8815b319 100644
--- a/modules/sfp_jsonwhoiscom.py
+++ b/modules/sfp_jsonwhoiscom.py
@@ -94,7 +94,7 @@ class sfp_jsonwhoiscom(SpiderFootPlugin):
}
res = self.sf.fetchUrl(
- "https://jsonwhois.com/api/v1/whois?%s" % urllib.parse.urlencode(params),
+ f"https://jsonwhois.com/api/v1/whois?{urllib.parse.urlencode(params)}",
headers=headers,
timeout=15,
useragent=self.opts['_useragent']
@@ -171,7 +171,7 @@ class sfp_jsonwhoiscom(SpiderFootPlugin):
res = self.queryDomain(eventData)
if res is None:
- self.sf.debug("No information found for domain %s" % eventData)
+ self.sf.debug(f"No information found for domain {eventData}")
return None
evt = SpiderFootEvent('RAW_RIR_DATA', str(res), self.__name__, event)
diff --git a/modules/sfp_malwaredomainlist.py b/modules/sfp_malwaredomainlist.py
index 70531297..58ec8d97 100644
--- a/modules/sfp_malwaredomainlist.py
+++ b/modules/sfp_malwaredomainlist.py
@@ -107,7 +107,7 @@ class sfp_malwaredomainlist(SpiderFootPlugin):
"MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]
# Look up 'list' type resources
- def resourceList(self, id, target, targetType):
+ def resourceList(self, replaceme_id, target, targetType):
targetDom = ''
# Get the base domain if we're supplied a domain
if targetType == "domain":
@@ -117,7 +117,7 @@ class sfp_malwaredomainlist(SpiderFootPlugin):
for check in list(malchecks.keys()):
cid = malchecks[check]['id']
- if id == cid:
+ if replaceme_id == cid:
data = dict()
url = malchecks[check]['url']
data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
diff --git a/modules/sfp_onyphe.py b/modules/sfp_onyphe.py
index 6b7d4f87..1d59753e 100644
--- a/modules/sfp_onyphe.py
+++ b/modules/sfp_onyphe.py
@@ -249,7 +249,7 @@ class sfp_onyphe(SpiderFootPlugin):
if self.errorState:
return None
- self.sf.debug("Received event, %s, from %s" % (eventName, srcModuleName))
+ self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
self.sf.error("You enabled sfp_onyphe, but did not set an API key!")
diff --git a/modules/sfp_pageinfo.py b/modules/sfp_pageinfo.py
index f0cbc3da..8485bf83 100644
--- a/modules/sfp_pageinfo.py
+++ b/modules/sfp_pageinfo.py
@@ -131,7 +131,7 @@ class sfp_pageinfo(SpiderFootPlugin):
continue
if self.getTarget().matches(self.sf.urlFQDN(match)):
continue
- self.sf.debug("Externally hosted JavaScript found at: %s" % match)
+ self.sf.debug(f"Externally hosted JavaScript found at: {match}")
evt = SpiderFootEvent("PROVIDER_JAVASCRIPT", match, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_pastebin.py b/modules/sfp_pastebin.py
index c5f7ac5d..9fac28de 100644
--- a/modules/sfp_pastebin.py
+++ b/modules/sfp_pastebin.py
@@ -103,10 +103,7 @@ class sfp_pastebin(SpiderFootPlugin):
for dom in list(self.domains.keys()):
target = self.domains[dom]
res = self.sf.googleIterate(
- searchString="+site:{target_site} \"{search_keyword}\"".format(
- target_site=target,
- search_keyword=eventData,
- ),
+ searchString=f'+site:{target} "{eventData}"',
opts={
"timeout": self.opts["_fetchtimeout"],
"useragent": self.opts["_useragent"],
diff --git a/modules/sfp_subdomain_takeover.py b/modules/sfp_subdomain_takeover.py
index 3fb4a4b4..4dc2fe9b 100644
--- a/modules/sfp_subdomain_takeover.py
+++ b/modules/sfp_subdomain_takeover.py
@@ -54,7 +54,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
res = self.sf.fetchUrl(url, useragent="SpiderFoot")
if res['content'] is None:
- self.sf.error("Unable to fetch %s" % url)
+ self.sf.error(f"Unable to fetch {url}")
self.errorState = True
return
@@ -108,7 +108,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
for proto in ["https", "http"]:
res = self.sf.fetchUrl(
- "%s://%s/" % (proto, eventData),
+ f"{proto}://{eventData}/",
timeout=15,
useragent=self.opts['_useragent'],
verify=False
@@ -119,7 +119,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
continue
for fingerprint in fingerprints:
if fingerprint in res['content']:
- self.sf.info("%s appears to be vulnerable to takeover on %s" % (eventData, service))
+ self.sf.info(f"{eventData} appears to be vulnerable to takeover on {service}")
evt = SpiderFootEvent("AFFILIATE_INTERNET_NAME_HIJACKABLE", eventData, self.__name__, event)
self.notifyListeners(evt)
break
@@ -136,7 +136,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
for cname in cnames:
if not cname.lower() in eventData.lower():
continue
- self.sf.info("%s appears to be vulnerable to takeover on %s" % (eventData, service))
+ self.sf.info(f"{eventData} appears to be vulnerable to takeover on {service}")
evt = SpiderFootEvent("AFFILIATE_INTERNET_NAME_HIJACKABLE", eventData, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_tool_nmap.py b/modules/sfp_tool_nmap.py
index 7f49909f..8ba3750f 100644
--- a/modules/sfp_tool_nmap.py
+++ b/modules/sfp_tool_nmap.py
@@ -145,14 +145,14 @@ class sfp_tool_nmap(SpiderFootPlugin):
content = stdout.decode('utf-8', errors='replace')
else:
self.sf.error("Unable to read Nmap content.")
- self.sf.debug("Error running Nmap: " + stderr + ", " + stdout)
+ self.sf.debug(f"Error running Nmap: {stderr}, {stdout}")
return
if "No exact OS matches for host" in content or "OSScan results may be unreliable" in content:
- self.sf.debug("Couldn't reliably detect the OS for " + eventData)
+ self.sf.debug(f"Couldn't reliably detect the OS for {eventData}")
return
except Exception as e:
- self.sf.error("Unable to run Nmap: " + str(e))
+ self.sf.error(f"Unable to run Nmap: {e}")
return
if not content:
diff --git a/modules/sfp_zetalytics.py b/modules/sfp_zetalytics.py
index 499f6234..e6fdee38 100644
--- a/modules/sfp_zetalytics.py
+++ b/modules/sfp_zetalytics.py
@@ -186,10 +186,10 @@ class sfp_zetalytics(SpiderFootPlugin):
self.errorState = True
return
- if "{}:{}".format(eventName, eventData) in self.results:
+ if f"{eventName}:{eventData}" in self.results:
self.sf.debug(f"Skipping {eventName}:{eventData}, already checked.")
return
- self.results["{}:{}".format(eventName, eventData)] = True
+ self.results[f"{eventName}:{eventData}"] = True
if eventName == "INTERNET_NAME":
data = self.query_hostname(eventData)
diff --git a/setup.cfg b/setup.cfg
index 4430e944..53aedfd7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,15 +3,17 @@ flake8-max-line-length = 120
max-line-length = 120
max-complexity = 80
select = C,E,F,W,I,B,DUO,D,R,A,S,SLF,Q0,SIM,SFS
-ignore = E501 W503 B006 DUO130 E800 B9 SFS301 Q0 S SIM
+ignore = E501 W503 B006 DUO130 E800 B9 SFS301 Q000 S SIM
per-file-ignores =
spiderfoot/event.py:A,D
spiderfoot/db.py:A,D,SFS101
sf.py:I,D,SFS101,SFS201
sflib.py:I,D,SFS101
- sfwebui.py:A,I,D,SFS101
+ sfwebui.py:A,I,D,SFS101,Q003
sfscan.py:I,D
- modules/*:R,A,I,D,SFS101,SFS201
+ modules/*:R,I,D
+ modules/sfp__stor_stdout.py:D,SFS201
+ modules/sfp_bitcoin.py:D,SFS101
spiderfoot/*:I,D
spiderfoot/__init__.py:I,D,F401
sfcli.py:D