SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
flake8: resolve flake8 violations
Brendan Coles95d808ae55c6
diff --git a/modules/sfp_abusech.py b/modules/sfp_abusech.pyindex 2869ccf8..4ae8f60a 100644--- a/modules/sfp_abusech.py+++ b/modules/sfp_abusech.py@@ -178,11 +178,10 @@ class sfp_abusech(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn None@@ -213,7 +212,7 @@ class sfp_abusech(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ self.sf.debug(f"Checking maliciousness of {target} ({itemType}) with: {cid}")return self.resourceList(cid, target, itemType)return Nonediff --git a/modules/sfp_abuseipdb.py b/modules/sfp_abuseipdb.pyindex abc8697a..8b1c7ee3 100644--- a/modules/sfp_abuseipdb.py+++ b/modules/sfp_abuseipdb.py@@ -164,10 +164,10 @@ class sfp_abuseipdb(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " + target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_alienvault.py b/modules/sfp_alienvault.pyindex d3c5570f..1b38bb43 100644--- a/modules/sfp_alienvault.py+++ b/modules/sfp_alienvault.py@@ -175,9 +175,9 @@ class sfp_alienvault(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'AFFILIATE_IPADDR' and not self.opts.get('checkaffiliates', False):@@ -188,9 +188,9 @@ class sfp_alienvault(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneqrylist = list()diff --git a/modules/sfp_alienvaultiprep.py b/modules/sfp_alienvaultiprep.pyindex d8dd666f..3c768c47 100644--- a/modules/sfp_alienvaultiprep.py+++ b/modules/sfp_alienvaultiprep.py@@ -144,11 +144,10 @@ class sfp_alienvaultiprep(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_bambenek.py b/modules/sfp_bambenek.pyindex 3c88344a..180f4b83 100644--- a/modules/sfp_bambenek.py+++ b/modules/sfp_bambenek.py@@ -158,11 +158,10 @@ class sfp_bambenek(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_binaryedge.py b/modules/sfp_binaryedge.pyindex 7b0abced..7338c9d6 100644--- a/modules/sfp_binaryedge.py+++ b/modules/sfp_binaryedge.py@@ -203,9 +203,9 @@ class sfp_binaryedge(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -213,9 +213,9 @@ class sfp_binaryedge(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneqrylist = list()diff --git a/modules/sfp_blocklistde.py b/modules/sfp_blocklistde.pyindex d44474fd..04f0fa40 100644--- a/modules/sfp_blocklistde.py+++ b/modules/sfp_blocklistde.py@@ -144,11 +144,10 @@ class sfp_blocklistde(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_botvrij.py b/modules/sfp_botvrij.pyindex cb1ab800..c26d516b 100644--- a/modules/sfp_botvrij.py+++ b/modules/sfp_botvrij.py@@ -128,11 +128,10 @@ class sfp_botvrij(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_coinblocker.py b/modules/sfp_coinblocker.pyindex e3f8101b..50e5cf28 100644--- a/modules/sfp_coinblocker.py+++ b/modules/sfp_coinblocker.py@@ -128,8 +128,7 @@ class sfp_coinblocker(SpiderFootPlugin):if data['content'] is None:self.sf.error("Unable to fetch " + url, False)return None- else:- self.sf.cachePut("sfmal_" + cid, data['content'])+ self.sf.cachePut("sfmal_" + cid, data['content'])# If we're looking at netblocksif targetType == "netblock":@@ -156,11 +155,10 @@ class sfp_coinblocker(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_commoncrawl.py b/modules/sfp_commoncrawl.pyindex d6361d26..909b3cc1 100644--- a/modules/sfp_commoncrawl.py+++ b/modules/sfp_commoncrawl.py@@ -68,8 +68,7 @@ class sfp_commoncrawl(SpiderFootPlugin):def search(self, target):ret = list()for index in self.indexBase:- url = "https://index.commoncrawl.org/" + index + \- "-index?url=" + target + "/*&output=json"+ url = f"https://index.commoncrawl.org/{index}-index?url={target}/*&output=json"res = self.sf.fetchUrl(url, timeout=60,useragent="SpiderFoot")diff --git a/modules/sfp_customfeed.py b/modules/sfp_customfeed.pyindex d6d38bfd..e375885b 100644--- a/modules/sfp_customfeed.py+++ b/modules/sfp_customfeed.py@@ -130,11 +130,10 @@ class sfp_customfeed(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn None@@ -165,8 +164,8 @@ class sfp_customfeed(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)+ self.sf.debug("Checking maliciousness of " + target + " ("+ + itemType + ") with: " + cid)return self.resourceList(cid, target, itemType)return Nonediff --git a/modules/sfp_cybercrimetracker.py b/modules/sfp_cybercrimetracker.pyindex b212d701..fa31dedd 100644--- a/modules/sfp_cybercrimetracker.py+++ b/modules/sfp_cybercrimetracker.py@@ -140,11 +140,10 @@ class sfp_cybercrimetracker(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_darksearch.py b/modules/sfp_darksearch.pyindex c7f61777..713c5e51 100644--- a/modules/sfp_darksearch.py+++ b/modules/sfp_darksearch.py@@ -203,8 +203,8 @@ class sfp_darksearch(SpiderFootPlugin):continueevt = SpiderFootEvent("DARKNET_MENTION_CONTENT",- "Title: " + result.get('title') + "\n\n" +- "..." + result.get('description') + "...",+ "Title: " + result.get('title') + "\n\n"+ + "..." + result.get('description') + "...",self.__name__,event)self.notifyListeners(evt)diff --git a/modules/sfp_dnscommonsrv.py b/modules/sfp_dnscommonsrv.pyindex d9696cf6..8e54b01e 100644--- a/modules/sfp_dnscommonsrv.py+++ b/modules/sfp_dnscommonsrv.py@@ -99,8 +99,8 @@ class sfp_dnscommonsrv(SpiderFootPlugin):srcModuleName = event.moduleeventData = event.data- self.sf.debug("Received event, " + eventName +- ", from " + srcModuleName)+ self.sf.debug("Received event, " + eventName+ + ", from " + srcModuleName)if srcModuleName == "sfp_dnscommonsrv":self.sf.debug("Ignoring " + eventName + ", from self.")diff --git a/modules/sfp_dnsresolve.py b/modules/sfp_dnsresolve.pyindex 262401f7..e4484ac7 100644--- a/modules/sfp_dnsresolve.py+++ b/modules/sfp_dnsresolve.py@@ -213,9 +213,9 @@ class sfp_dnsresolve(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return None# Not handling IPv6 (yet)diff --git a/modules/sfp_dnszonexfer.py b/modules/sfp_dnszonexfer.pyindex 898dbdc8..d5dcd33c 100644--- a/modules/sfp_dnszonexfer.py+++ b/modules/sfp_dnszonexfer.py@@ -129,7 +129,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):self.notifyListeners(evt)except BaseException as e:- self.sf.info("Unable to perform DNS zone transfer for " + eventData +- "(" + name + "): " + str(e))+ self.sf.info("Unable to perform DNS zone transfer for " + eventData+ + "(" + name + "): " + str(e))# End of sfp_dnszonexfer classdiff --git a/modules/sfp_dronebl.py b/modules/sfp_dronebl.pyindex c37a7a7d..df1815a8 100644--- a/modules/sfp_dronebl.py+++ b/modules/sfp_dronebl.py@@ -169,9 +169,9 @@ class sfp_dronebl(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -179,9 +179,9 @@ class sfp_dronebl(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneif eventName.startswith("NETBLOCK_"):diff --git a/modules/sfp_filemeta.py b/modules/sfp_filemeta.pyindex 7f3b3ca2..29c92c4d 100644--- a/modules/sfp_filemeta.py+++ b/modules/sfp_filemeta.py@@ -89,13 +89,13 @@ class sfp_filemeta(SpiderFootPlugin):sizeLimit=10000000,verify=False)if ret['content'] is None:- self.sf.error("Unable to fetch file for meta analysis: " +- eventData, False)+ self.sf.error("Unable to fetch file for meta analysis: "+ + eventData, False)return Noneif len(ret['content']) < 512:- self.sf.error("Strange content encountered, size of " +- str(len(ret['content'])), False)+ self.sf.error("Strange content encountered, size of "+ + str(len(ret['content'])), False)return Nonemeta = None@@ -110,8 +110,8 @@ class sfp_filemeta(SpiderFootPlugin):meta = str(data)self.sf.debug("Obtained meta data from " + eventData)except BaseException as e:- self.sf.error("Unable to parse meta data from: " +- eventData + "(" + str(e) + ")", False)+ self.sf.error("Unable to parse meta data from: "+ + eventData + "(" + str(e) + ")", False)return Noneif fileExt.lower() in ["docx"]:@@ -125,8 +125,8 @@ class sfp_filemeta(SpiderFootPlugin):data = [_f for _f in [a, c] if _f]meta = ", ".join(data)except BaseException as e:- self.sf.error("Unable to process file: " +- eventData + "(" + str(e) + ")", False)+ self.sf.error("Unable to process file: "+ + eventData + "(" + str(e) + ")", False)return Noneif fileExt.lower() in ["pptx"]:@@ -140,8 +140,8 @@ class sfp_filemeta(SpiderFootPlugin):data = [_f for _f in [a, c] if _f]meta = ", ".join(data)except BaseException as e:- self.sf.error("Unable to process file: " +- eventData + "(" + str(e) + ")", False)+ self.sf.error("Unable to process file: "+ + eventData + "(" + str(e) + ")", False)return Noneif fileExt.lower() in ["jpg", "jpeg", "tiff"]:@@ -152,8 +152,8 @@ class sfp_filemeta(SpiderFootPlugin):continuemeta = str(data)except BaseException as e:- self.sf.error("Unable to parse meta data from: " +- eventData + "(" + str(e) + ")", False)+ self.sf.error("Unable to parse meta data from: "+ + eventData + "(" + str(e) + ")", False)return Noneif meta is not None and data is not None:diff --git a/modules/sfp_greynoise.py b/modules/sfp_greynoise.pyindex 2f656027..4246b694 100644--- a/modules/sfp_greynoise.py+++ b/modules/sfp_greynoise.py@@ -148,9 +148,9 @@ class sfp_greynoise(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -158,9 +158,9 @@ class sfp_greynoise(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneif eventName == 'IP_ADDRESS' or eventName.startswith('NETBLOCK_'):diff --git a/modules/sfp_hackertarget.py b/modules/sfp_hackertarget.pyindex 57afdd2d..7bd0b2d7 100644--- a/modules/sfp_hackertarget.py+++ b/modules/sfp_hackertarget.py@@ -231,9 +231,9 @@ class sfp_hackertarget(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'DOMAIN_NAME_PARENT':diff --git a/modules/sfp_honeypot.py b/modules/sfp_honeypot.pyindex b393aa4b..4a67abf5 100644--- a/modules/sfp_honeypot.py+++ b/modules/sfp_honeypot.py@@ -137,20 +137,19 @@ class sfp_honeypot(SpiderFootPlugin):eventName = parentEvent.eventTypetry:- lookup = self.opts['api_key'] + f".{self.reverseAddr(qaddr)}.dnsbl.httpbl.org"+ lookup = f"{self.opts['api_key']}.{self.reverseAddr(qaddr)}.dnsbl.httpbl.org"self.sf.debug(f"Checking Honeypot: {lookup}")addrs = self.sf.resolveHost(lookup)if not addrs:return None- self.sf.debug("Addresses returned: " + str(addrs))++ self.sf.debug(f"Addresses returned: {addrs}")text = Nonefor addr in addrs:text = self.reportIP(addr)- if text is None:- continue- else:+ if text is not None:breakif text is not None:@@ -196,9 +195,9 @@ class sfp_honeypot(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -206,9 +205,9 @@ class sfp_honeypot(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneif eventName.startswith("NETBLOCK_"):diff --git a/modules/sfp_instagram.py b/modules/sfp_instagram.pyindex 4dbb269e..75ad3514 100644--- a/modules/sfp_instagram.py+++ b/modules/sfp_instagram.py@@ -95,8 +95,8 @@ class sfp_instagram(SpiderFootPlugin):network = eventData.split(": ")[0]url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")except BaseException as e:- self.sf.error("Unable to parse SOCIAL_MEDIA: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error("Unable to parse SOCIAL_MEDIA: "+ + eventData + " (" + str(e) + ")", False)return Noneif not network == 'Instagram':diff --git a/modules/sfp_maltiverse.py b/modules/sfp_maltiverse.pyindex 822a2432..84c24d53 100644--- a/modules/sfp_maltiverse.py+++ b/modules/sfp_maltiverse.py@@ -140,9 +140,9 @@ class sfp_maltiverse(SpiderFootPlugin):return Noneif IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -150,9 +150,9 @@ class sfp_maltiverse(SpiderFootPlugin):return Noneif IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneqrylist = list()diff --git a/modules/sfp_malwaredomainlist.py b/modules/sfp_malwaredomainlist.pyindex 9af3fdc0..d2d09813 100644--- a/modules/sfp_malwaredomainlist.py+++ b/modules/sfp_malwaredomainlist.py@@ -153,11 +153,11 @@ class sfp_malwaredomainlist(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(ip + " found within netblock/subnet "+ + target + " in " + check)return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_malwaredomains.py b/modules/sfp_malwaredomains.pyindex 2225d878..1cfc8ab1 100644--- a/modules/sfp_malwaredomains.py+++ b/modules/sfp_malwaredomains.py@@ -140,11 +140,10 @@ class sfp_malwaredomains(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_multiproxy.py b/modules/sfp_multiproxy.pyindex 3d475bbf..8c2fa1c1 100644--- a/modules/sfp_multiproxy.py+++ b/modules/sfp_multiproxy.py@@ -140,11 +140,10 @@ class sfp_multiproxy(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_myspace.py b/modules/sfp_myspace.pyindex 19d60fdb..44c2a115 100644--- a/modules/sfp_myspace.py+++ b/modules/sfp_myspace.py@@ -121,8 +121,8 @@ class sfp_myspace(SpiderFootPlugin):network = eventData.split(": ")[0]url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")except BaseException as e:- self.sf.error("Unable to parse SOCIAL_MEDIA: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error("Unable to parse SOCIAL_MEDIA: "+ + eventData + " (" + str(e) + ")", False)return Noneif network != "MySpace":diff --git a/modules/sfp_onioncity.py b/modules/sfp_onioncity.pyindex 85bc7f64..9a6c6b6d 100644--- a/modules/sfp_onioncity.py+++ b/modules/sfp_onioncity.py@@ -153,8 +153,8 @@ class sfp_onioncity(SpiderFootPlugin):continue# Sometimes onion city search results false positives- if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData) +- r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:+ if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData)+ + r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:self.sf.debug("Ignoring " + link + " as no mention of " + eventData)continuediff --git a/modules/sfp_pastebin.py b/modules/sfp_pastebin.pyindex cb561b80..94431c6e 100644--- a/modules/sfp_pastebin.py+++ b/modules/sfp_pastebin.py@@ -140,12 +140,12 @@ class sfp_pastebin(SpiderFootPlugin):useragent=self.opts['_useragent'])if res['content'] is None:- self.sf.debug("Ignoring " + link + " as no data returned")+ self.sf.debug(f"Ignoring {link} as no data returned")continue# Sometimes pastes search results false positives- if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData) +- r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:+ if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData)+ + r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:continuetry:diff --git a/modules/sfp_phishtank.py b/modules/sfp_phishtank.pyindex b4b34a71..4357942a 100644--- a/modules/sfp_phishtank.py+++ b/modules/sfp_phishtank.py@@ -135,11 +135,10 @@ class sfp_phishtank(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn Nonediff --git a/modules/sfp_portscan_tcp.py b/modules/sfp_portscan_tcp.pyindex 28cb05d6..123a9497 100644--- a/modules/sfp_portscan_tcp.py+++ b/modules/sfp_portscan_tcp.py@@ -194,8 +194,8 @@ class sfp_portscan_tcp(SpiderFootPlugin):else:scanIps.append(eventData)except BaseException as e:- self.sf.error("Strange netblock identified, unable to parse: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error("Strange netblock identified, unable to parse: "+ + eventData + " (" + str(e) + ")", False)return Nonefor ipAddr in scanIps:diff --git a/modules/sfp_psbdmp.py b/modules/sfp_psbdmp.pyindex 50538d8e..16e8860d 100644--- a/modules/sfp_psbdmp.py+++ b/modules/sfp_psbdmp.py@@ -136,8 +136,8 @@ class sfp_psbdmp(SpiderFootPlugin):continue# Sometimes pastes search results false positives- if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData) +- r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:+ if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData)+ + r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:continuetry:diff --git a/modules/sfp_pulsedive.py b/modules/sfp_pulsedive.pyindex 4e07d5ee..1225f648 100644--- a/modules/sfp_pulsedive.py+++ b/modules/sfp_pulsedive.py@@ -156,9 +156,9 @@ class sfp_pulsedive(SpiderFootPlugin):return Noneif IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -166,9 +166,9 @@ class sfp_pulsedive(SpiderFootPlugin):return Noneif IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneqrylist = list()diff --git a/modules/sfp_robtex.py b/modules/sfp_robtex.pyindex e2a9c0c5..ac39db14 100644--- a/modules/sfp_robtex.py+++ b/modules/sfp_robtex.py@@ -114,9 +114,9 @@ class sfp_robtex(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneif eventName == 'NETBLOCK_MEMBER':@@ -124,9 +124,9 @@ class sfp_robtex(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneqrylist = list()diff --git a/modules/sfp_shodan.py b/modules/sfp_shodan.pyindex 87667ed5..a4225bd7 100644--- a/modules/sfp_shodan.py+++ b/modules/sfp_shodan.py@@ -89,8 +89,8 @@ class sfp_shodan(SpiderFootPlugin):'RAW_RIR_DATA', 'GEOINFO', 'VULNERABILITY']def query(self, qry):- res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/" + qry +- "?key=" + self.opts['api_key'],+ res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/" + qry+ + "?key=" + self.opts['api_key'],timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")time.sleep(1)if res['content'] is None:@@ -106,8 +106,8 @@ class sfp_shodan(SpiderFootPlugin):return infodef searchHosts(self, qry):- res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/search?query=hostname:" + qry +- "&key=" + self.opts['api_key'],+ res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/search?query=hostname:" + qry+ + "&key=" + self.opts['api_key'],timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")time.sleep(1)if res['content'] is None:@@ -179,8 +179,7 @@ class sfp_shodan(SpiderFootPlugin):network = eventData.split(": ")[0]analytics_id = eventData.split(": ")[1]except BaseException as e:- self.sf.error("Unable to parse WEB_ANALYTICS_ID: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})", False)return Noneif network not in ['Google AdSense', 'Google Analytics', 'Google Site Verification']:@@ -201,9 +200,9 @@ class sfp_shodan(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxnetblock']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxnetblock']))return Noneqrylist = list()@@ -235,14 +234,14 @@ class sfp_shodan(SpiderFootPlugin):if rec.get('os') is not None:# Notify other modules of what you've found- evt = SpiderFootEvent("OPERATING_SYSTEM", rec.get('os') +- " (" + addr + ")", self.__name__, pevent)+ evt = SpiderFootEvent("OPERATING_SYSTEM", rec.get('os')+ + " (" + addr + ")", self.__name__, pevent)self.notifyListeners(evt)if rec.get('devtype') is not None:# Notify other modules of what you've found- evt = SpiderFootEvent("DEVICE_TYPE", rec.get('devtype') +- " (" + addr + ")", self.__name__, pevent)+ evt = SpiderFootEvent("DEVICE_TYPE", rec.get('devtype')+ + " (" + addr + ")", self.__name__, pevent)self.notifyListeners(evt)if rec.get('country_name') is not None:diff --git a/modules/sfp_slideshare.py b/modules/sfp_slideshare.pyindex e0eeac69..7cdacbac 100644--- a/modules/sfp_slideshare.py+++ b/modules/sfp_slideshare.py@@ -84,8 +84,8 @@ class sfp_slideshare(SpiderFootPlugin):network = eventData.split(": ")[0]url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")except BaseException as e:- self.sf.error("Unable to parse SOCIAL_MEDIA: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error("Unable to parse SOCIAL_MEDIA: "+ + eventData + " (" + str(e) + ")", False)return Noneif not network == "SlideShare":diff --git a/modules/sfp_sorbs.py b/modules/sfp_sorbs.pyindex 52be1b8f..316708cf 100644--- a/modules/sfp_sorbs.py+++ b/modules/sfp_sorbs.py@@ -176,9 +176,9 @@ class sfp_sorbs(SpiderFootPlugin):return Noneelse:if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:- self.sf.debug("Network size bigger than permitted: " +- str(IPNetwork(eventData).prefixlen) + " > " +- str(self.opts['maxsubnet']))+ self.sf.debug("Network size bigger than permitted: "+ + str(IPNetwork(eventData).prefixlen) + " > "+ + str(self.opts['maxsubnet']))return Noneif eventName.startswith("NETBLOCK_"):diff --git a/modules/sfp_spider.py b/modules/sfp_spider.pyindex 00cad55e..a9164e84 100644--- a/modules/sfp_spider.py+++ b/modules/sfp_spider.py@@ -362,8 +362,8 @@ class sfp_spider(SpiderFootPlugin):totalFetched += 1if totalFetched >= self.opts['maxpages']:- self.sf.info("Maximum number of pages (" + str(self.opts['maxpages']) +- ") reached.")+ self.sf.info("Maximum number of pages (" + str(self.opts['maxpages'])+ + ") reached.")keepSpidering = Falsebreakdiff --git a/modules/sfp_spyonweb.py b/modules/sfp_spyonweb.pyindex 5aeea5bd..42d2c67f 100644--- a/modules/sfp_spyonweb.py+++ b/modules/sfp_spyonweb.py@@ -199,8 +199,8 @@ class sfp_spyonweb(SpiderFootPlugin):if eventData in self.results:return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueself.sf.debug(f"Received event, {eventName}, from {srcModuleName}")@@ -216,21 +216,21 @@ class sfp_spyonweb(SpiderFootPlugin):data = self.querySummary(eventData, limit=self.opts['limit'])if data is None:- self.sf.info("No data found for " + eventData)+ self.sf.info(f"No data found for {eventData}")return Nonegoogle_adsense = data.get('adsense')if google_adsense:for r in list(google_adsense.keys()):- evt = SpiderFootEvent("WEB_ANALYTICS_ID", "Google AdSense: " + r, self.__name__, event)+ evt = SpiderFootEvent("WEB_ANALYTICS_ID", f"Google AdSense: {r}", self.__name__, event)self.notifyListeners(evt)google_analytics = data.get('analytics')if google_analytics:for r in list(google_analytics.keys()):- evt = SpiderFootEvent("WEB_ANALYTICS_ID", "Google Analytics: " + r, self.__name__, event)+ evt = SpiderFootEvent("WEB_ANALYTICS_ID", f"Google Analytics: {r}", self.__name__, event)self.notifyListeners(evt)# Find affiliate domains for the specified Google AdSense ID or Google Analytics ID@@ -239,8 +239,7 @@ class sfp_spyonweb(SpiderFootPlugin):network = eventData.split(": ")[0]analytics_id = eventData.split(": ")[1]except BaseException as e:- self.sf.error("Unable to parse WEB_ANALYTICS_ID: " +- eventData + " (" + str(e) + ")", False)+ self.sf.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})", False)return Nonedata = dict()@@ -287,7 +286,7 @@ class sfp_spyonweb(SpiderFootPlugin):continueif self.opts['verify'] and not self.sf.validateIP(co, eventData):- self.sf.debug("Host " + co + " no longer resolves to " + eventData)+ self.sf.debug(f"Host {co} no longer resolves to {eventData}")continueif not self.opts['cohostsamedomain']:diff --git a/modules/sfp_torexits.py b/modules/sfp_torexits.pyindex 914edde7..92fb9e4c 100644--- a/modules/sfp_torexits.py+++ b/modules/sfp_torexits.py@@ -129,10 +129,10 @@ class sfp_torexits(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " + target + " in " + check)+ self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")return urlexcept Exception as e:- self.sf.debug("Error encountered parsing: " + str(e))+ self.sf.debug(f"Error encountered parsing: {e}")continuereturn None