Skip to content

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

Remove modules' dependency on self.sf for logging (#1461)

TheTechromancera34d8a839887
diff --git a/modules/sfp__stor_db.py b/modules/sfp__stor_db.py
index cd2a1b14..b998aa29 100644
--- a/modules/sfp__stor_db.py
+++ b/modules/sfp__stor_db.py
@@ -53,11 +53,11 @@ class sfp__stor_db(SpiderFootPlugin):
if self.opts['maxstorage'] != 0:
if len(sfEvent.data) > self.opts['maxstorage']:
- self.sf.debug("Storing an event: " + sfEvent.eventType)
+ self.debug("Storing an event: " + sfEvent.eventType)
self.__sfdb__.scanEventStore(self.getScanId(), sfEvent, self.opts['maxstorage'])
return
- self.sf.debug("Storing an event: " + sfEvent.eventType)
+ self.debug("Storing an event: " + sfEvent.eventType)
self.__sfdb__.scanEventStore(self.getScanId(), sfEvent)
# End of sfp__stor_db class
diff --git a/modules/sfp_abstractapi.py b/modules/sfp_abstractapi.py
index 945bb261..e7664407 100644
--- a/modules/sfp_abstractapi.py
+++ b/modules/sfp_abstractapi.py
@@ -78,30 +78,30 @@ class sfp_abstractapi(SpiderFootPlugin):
return None
if res['code'] == '429':
- self.sf.error("You are being rate-limited by AbstractAPI.")
+ self.error("You are being rate-limited by AbstractAPI.")
return None
if res['code'] == '401':
- self.sf.error("Unauthorized. Invalid AbstractAPI API key.")
+ self.error("Unauthorized. Invalid AbstractAPI API key.")
self.errorState = True
return None
if res['code'] == '422':
- self.sf.error("Usage quota reached. Insufficient API credit.")
+ self.error("Usage quota reached. Insufficient API credit.")
self.errorState = True
return None
if res['code'] == '500' or res['code'] == '503':
- self.sf.error("Abstract API service is unavailable")
+ self.error("Abstract API service is unavailable")
self.errorState = True
return None
if res['code'] == '204':
- self.sf.debug("No response data for target")
+ self.debug("No response data for target")
return None
if res['code'] != '200':
- self.sf.error(f"Unexpected reply from AbstractAPI: {res['code']}")
+ self.error(f"Unexpected reply from AbstractAPI: {res['code']}")
return None
if res['content'] is None:
@@ -110,7 +110,7 @@ class sfp_abstractapi(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -141,7 +141,7 @@ class sfp_abstractapi(SpiderFootPlugin):
time.sleep(1)
if not res:
- self.sf.debug("No response from AbstractAPI Company Enrichment API endpoint")
+ self.debug("No response from AbstractAPI Company Enrichment API endpoint")
return None
return self.parseApiResponse(res)
@@ -173,7 +173,7 @@ class sfp_abstractapi(SpiderFootPlugin):
time.sleep(1)
if not res:
- self.sf.debug("No response from AbstractAPI Phone Validation API endpoint")
+ self.debug("No response from AbstractAPI Phone Validation API endpoint")
return None
return self.parseApiResponse(res)
@@ -205,7 +205,7 @@ class sfp_abstractapi(SpiderFootPlugin):
time.sleep(1)
if not res:
- self.sf.debug("No response from AbstractAPI Phone Validation API endpoint")
+ self.debug("No response from AbstractAPI Phone Validation API endpoint")
return None
return self.parseApiResponse(res)
@@ -215,16 +215,16 @@ class sfp_abstractapi(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
if self.opts["companyenrichment_api_key"] == "" and self.opts["phonevalidation_api_key"] == "" and self.opts["ipgeolocation_api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set any API keys!"
)
self.errorState = True
@@ -235,7 +235,7 @@ class sfp_abstractapi(SpiderFootPlugin):
if eventName == "DOMAIN_NAME":
if self.opts["companyenrichment_api_key"] == "":
- self.sf.info(
+ self.info(
f"No API key set for Company Enrichment API endpoint. Ignoring {eventData}"
)
return
@@ -277,7 +277,7 @@ class sfp_abstractapi(SpiderFootPlugin):
elif eventName == "PHONE_NUMBER":
if self.opts["phonevalidation_api_key"] == "":
- self.sf.info(
+ self.info(
f"No API key set for Phone Validation API endpoint. Ignoring {eventData}"
)
return
@@ -315,7 +315,7 @@ class sfp_abstractapi(SpiderFootPlugin):
elif eventName in ['IP_ADDRESS', 'IPV6_ADDRESS']:
if self.opts["ipgeolocation_api_key"] == "":
- self.sf.info(
+ self.info(
f"No API key set for IP Geolocation API endpoint. Ignoring {eventData}"
)
return
diff --git a/modules/sfp_abusech.py b/modules/sfp_abusech.py
index be3a123b..40692ebc 100644
--- a/modules/sfp_abusech.py
+++ b/modules/sfp_abusech.py
@@ -119,13 +119,13 @@ class sfp_abusech(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in Abuse.ch Feodo Tracker.")
+ self.debug(f"IP address {target} found in Abuse.ch Feodo Tracker.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch Feodo Tracker.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch Feodo Tracker.")
return True
return False
@@ -143,12 +143,12 @@ class sfp_abusech(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch Abuse.ch Feodo Tracker.")
+ self.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch Abuse.ch Feodo Tracker.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from Abuse.ch Feodo Tracker")
+ self.error("Received no content from Abuse.ch Feodo Tracker")
self.errorState = True
return None
@@ -190,13 +190,13 @@ class sfp_abusech(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in Abuse.ch SSL Blacklist.")
+ self.debug(f"IP address {target} found in Abuse.ch SSL Blacklist.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch SSL Blacklist.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch SSL Blacklist.")
return True
return False
@@ -214,12 +214,12 @@ class sfp_abusech(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch Abuse.ch Feodo Tracker.")
+ self.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch Abuse.ch Feodo Tracker.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from Abuse.ch Feodo Tracker")
+ self.error("Received no content from Abuse.ch Feodo Tracker")
self.errorState = True
return None
@@ -265,17 +265,17 @@ class sfp_abusech(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in Abuse.ch URL Haus Blacklist.")
+ self.debug(f"IP address {target} found in Abuse.ch URL Haus Blacklist.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch URL Haus Blacklist.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in Abuse.ch URL Haus Blacklist.")
return True
elif targetType == "domain":
if target.lower() in blacklist:
- self.sf.debug(f"Host name {target} found in Abuse.ch URL Haus Blacklist.")
+ self.debug(f"Host name {target} found in Abuse.ch URL Haus Blacklist.")
return True
return False
@@ -293,12 +293,12 @@ class sfp_abusech(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch URL Haus.")
+ self.error(f"Unexpected HTTP response code {res['code']} from Abuse.ch URL Haus.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from Abuse.ch URL Haus")
+ self.error("Received no content from Abuse.ch URL Haus")
self.errorState = True
return None
@@ -344,10 +344,10 @@ class sfp_abusech(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -390,14 +390,14 @@ class sfp_abusech(SpiderFootPlugin):
return
if targetType in ['ip', 'netblock']:
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch Feodo Tracker")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch Feodo Tracker")
if self.queryFeodoTrackerBlacklist(eventData, targetType):
url = "https://feodotracker.abuse.ch/downloads/ipblocklist.txt"
text = f"Abuse.ch Feodo Tracker [{eventData}]\n<SFURL>{url}</SFURL>"
evt = SpiderFootEvent(evtType, text, self.__name__, event)
self.notifyListeners(evt)
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch SSL Blacklist")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch SSL Blacklist")
if self.querySslBlacklist(eventData, targetType):
url = "https://sslbl.abuse.ch/blacklist/sslipblacklist.csv"
text = f"Abuse.ch SSL Blacklist [{eventData}]\n<SFURL>{url}</SFURL>"
@@ -405,7 +405,7 @@ class sfp_abusech(SpiderFootPlugin):
self.notifyListeners(evt)
if targetType in ['ip', 'domain']:
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch URL Haus")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with Abuse.ch URL Haus")
if self.queryUrlHausBlacklist(eventData, targetType):
url = "https://urlhaus.abuse.ch/downloads/csv_recent/"
text = f"Abuse.ch URL Haus Blacklist [{eventData}]\n<SFURL>{url}</SFURL>"
diff --git a/modules/sfp_abuseipdb.py b/modules/sfp_abuseipdb.py
index e1daa182..9bcd9d02 100644
--- a/modules/sfp_abuseipdb.py
+++ b/modules/sfp_abuseipdb.py
@@ -119,22 +119,22 @@ class sfp_abuseipdb(SpiderFootPlugin):
time.sleep(1)
if res['code'] == '429':
- self.sf.error("You are being rate-limited by AbuseIPDB")
+ self.error("You are being rate-limited by AbuseIPDB")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error(f"Error retrieving search results, code {res['code']}")
+ self.error(f"Error retrieving search results, code {res['code']}")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error("Error retrieving search results from AbuseIPDB")
+ self.error("Error retrieving search results from AbuseIPDB")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from AbuseIPDB")
+ self.error("Received no content from AbuseIPDB")
self.errorState = True
return None
@@ -198,24 +198,24 @@ class sfp_abuseipdb(SpiderFootPlugin):
time.sleep(1)
if res['code'] == '429':
- self.sf.error("You are being rate-limited by AbuseIPDB")
+ self.error("You are being rate-limited by AbuseIPDB")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error("Error retrieving search results from AbuseIPDB")
+ self.error("Error retrieving search results from AbuseIPDB")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from AbuseIPDB")
+ self.error("Received no content from AbuseIPDB")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
return None
@@ -252,24 +252,24 @@ class sfp_abuseipdb(SpiderFootPlugin):
time.sleep(1)
if res['code'] == '429':
- self.sf.error("You are being rate-limited by AbuseIPDB")
+ self.error("You are being rate-limited by AbuseIPDB")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error("Error retrieving search results from AbuseIPDB")
+ self.error("Error retrieving search results from AbuseIPDB")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from AbuseIPDB")
+ self.error("Received no content from AbuseIPDB")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -278,17 +278,17 @@ class sfp_abuseipdb(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -303,7 +303,7 @@ class sfp_abuseipdb(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of IP address {eventData} with AbuseIPDB")
+ self.debug(f"Checking maliciousness of IP address {eventData} with AbuseIPDB")
blacklist = self.queryBlacklist()
@@ -313,7 +313,7 @@ class sfp_abuseipdb(SpiderFootPlugin):
if eventData not in blacklist:
return
- self.sf.info(f"Malicious IP address {eventData} found in AbuseIPDB blacklist")
+ self.info(f"Malicious IP address {eventData} found in AbuseIPDB blacklist")
url = f"https://www.abuseipdb.com/check/{eventData}"
diff --git a/modules/sfp_accounts.py b/modules/sfp_accounts.py
index ea7d2d8a..9577fdba 100644
--- a/modules/sfp_accounts.py
+++ b/modules/sfp_accounts.py
@@ -78,7 +78,7 @@ class sfp_accounts(SpiderFootPlugin):
data = self.sf.fetchUrl(url, useragent="SpiderFoot")
if data['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return
@@ -88,7 +88,7 @@ class sfp_accounts(SpiderFootPlugin):
try:
self.sites = [site for site in json.loads(content)['sites'] if site['valid']]
except Exception as e:
- self.sf.error(f"Unable to parse social media accounts list: {e}")
+ self.error(f"Unable to parse social media accounts list: {e}")
self.errorState = True
return
@@ -130,7 +130,7 @@ class sfp_accounts(SpiderFootPlugin):
if self.opts['musthavename']:
if name.lower() not in res['content'].lower():
- self.sf.debug(f"Skipping {site['name']} as username not mentioned.")
+ self.debug(f"Skipping {site['name']} as username not mentioned.")
with self.lock:
self.siteResults[retname] = False
return
@@ -155,7 +155,7 @@ class sfp_accounts(SpiderFootPlugin):
try:
self.checkSite(username, site)
except Exception as e:
- self.sf.debug(f'Thread {threading.current_thread().name} exception: {e}')
+ self.debug(f'Thread {threading.current_thread().name} exception: {e}')
except QueueEmpty:
return
@@ -187,7 +187,7 @@ class sfp_accounts(SpiderFootPlugin):
duration = time.monotonic() - startTime
scanRate = len(sites) / duration
- self.sf.debug(f'Scan statistics: name={username}, count={len(self.siteResults)}, duration={duration:.2f}, rate={scanRate:.0f}')
+ self.debug(f'Scan statistics: name={username}, count={len(self.siteResults)}, duration={duration:.2f}, rate={scanRate:.0f}')
return [site for site, found in self.siteResults.items() if found]
@@ -200,11 +200,11 @@ class sfp_accounts(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Skip events coming from me unless they are USERNAME events
if eventName != "USERNAME" and srcModuleName == "sfp_accounts":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return
if eventData in list(self.results.keys()):
@@ -233,7 +233,7 @@ class sfp_accounts(SpiderFootPlugin):
delsites = list()
for site in res:
sitename = site.split(" (Category:")[0]
- self.sf.debug(f"Distrusting {sitename}")
+ self.debug(f"Distrusting {sitename}")
delsites.append(sitename)
self.sites = [d for d in self.sites if d['name'] not in delsites]
else:
@@ -264,15 +264,15 @@ class sfp_accounts(SpiderFootPlugin):
for user in set(users):
if user in self.opts['_genericusers'].split(","):
- self.sf.debug(f"{user} is a generic account name, skipping.")
+ self.debug(f"{user} is a generic account name, skipping.")
continue
if self.opts['ignorenamedict'] and user in self.commonNames:
- self.sf.debug(f"{user} is found in our name dictionary, skipping.")
+ self.debug(f"{user} is found in our name dictionary, skipping.")
continue
if self.opts['ignoreworddict'] and user in self.words:
- self.sf.debug(f"{user} is found in our word dictionary, skipping.")
+ self.debug(f"{user} is found in our word dictionary, skipping.")
continue
if user not in self.reportedUsers and eventData != user:
diff --git a/modules/sfp_adblock.py b/modules/sfp_adblock.py
index 08185863..019ae6f9 100644
--- a/modules/sfp_adblock.py
+++ b/modules/sfp_adblock.py
@@ -90,12 +90,12 @@ class sfp_adblock(SpiderFootPlugin):
res = self.sf.fetchUrl(blocklist_url, timeout=30)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} for {blocklist_url}")
+ self.error(f"Unexpected HTTP response code {res['code']} for {blocklist_url}")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error(f"Unable to download AdBlock Plus blocklist: {blocklist_url}")
+ self.error(f"Unable to download AdBlock Plus blocklist: {blocklist_url}")
self.errorState = True
return None
@@ -113,12 +113,12 @@ class sfp_adblock(SpiderFootPlugin):
return
lines = blocklist.split('\n')
- self.sf.debug(f"Retrieved {len(lines)} AdBlock blocklist rules")
+ self.debug(f"Retrieved {len(lines)} AdBlock blocklist rules")
try:
self.rules = adblockparser.AdblockRules(lines)
except adblockparser.AdblockParsingError as e:
self.errorState = True
- self.sf.error(f"Parsing error handling AdBlock list: {e}")
+ self.error(f"Parsing error handling AdBlock list: {e}")
# Handle events sent to this module
def handleEvent(self, event):
@@ -126,10 +126,10 @@ class sfp_adblock(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug("Already checked this URL for AdBlock matching, skipping.")
+ self.debug("Already checked this URL for AdBlock matching, skipping.")
return
self.results[eventData] = True
@@ -138,7 +138,7 @@ class sfp_adblock(SpiderFootPlugin):
return
if not self.opts["blocklist"]:
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set a blocklist URL!"
)
self.errorState = True
@@ -148,7 +148,7 @@ class sfp_adblock(SpiderFootPlugin):
self.retrieveBlocklist(self.opts['blocklist'])
if not self.rules:
- self.sf.error("No AdBlock Plus rules loaded")
+ self.error("No AdBlock Plus rules loaded")
self.errorState = True
return
@@ -169,7 +169,7 @@ class sfp_adblock(SpiderFootPlugin):
self.notifyListeners(evt)
except ValueError as e:
- self.sf.error(f"Parsing error handling AdBlock list: {e}")
+ self.error(f"Parsing error handling AdBlock list: {e}")
self.errorState = True
# End of sfp_adblock class
diff --git a/modules/sfp_ahmia.py b/modules/sfp_ahmia.py
index 45f2ad38..de97598b 100644
--- a/modules/sfp_ahmia.py
+++ b/modules/sfp_ahmia.py
@@ -83,14 +83,14 @@ class sfp_ahmia(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if not self.opts['fullnames'] and eventName == 'HUMAN_NAME':
- self.sf.debug(f"Skipping HUMAN_NAME: {eventData}")
+ self.debug(f"Skipping HUMAN_NAME: {eventData}")
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -106,13 +106,13 @@ class sfp_ahmia(SpiderFootPlugin):
)
if not data:
- self.sf.info(f"No results for {eventData} returned from Ahmia.fi.")
+ self.info(f"No results for {eventData} returned from Ahmia.fi.")
return
content = data.get('content')
if not content:
- self.sf.info(f"No results for {eventData} returned from Ahmia.fi.")
+ self.info(f"No results for {eventData} returned from Ahmia.fi.")
return
# We don't bother with pagination as Ahmia seems fairly limited in coverage
@@ -120,7 +120,7 @@ class sfp_ahmia(SpiderFootPlugin):
links = re.findall("redirect_url=(.[^\"]+)\"", content, re.IGNORECASE | re.DOTALL)
if not links:
- self.sf.info(f"No results for {eventData} returned from Ahmia.fi.")
+ self.info(f"No results for {eventData} returned from Ahmia.fi.")
return
reported = False
@@ -133,7 +133,7 @@ class sfp_ahmia(SpiderFootPlugin):
self.results[link] = True
- self.sf.debug(f"Found a darknet mention: {link}")
+ self.debug(f"Found a darknet mention: {link}")
if not self.sf.urlFQDN(link).endswith(".onion"):
continue
@@ -152,11 +152,11 @@ class sfp_ahmia(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.debug(f"Ignoring {link} as no data returned")
+ self.debug(f"Ignoring {link} as no data returned")
continue
if eventData not in res['content']:
- self.sf.debug(f"Ignoring {link} as no mention of {eventData}")
+ self.debug(f"Ignoring {link} as no mention of {eventData}")
continue
evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)
@@ -167,7 +167,7 @@ class sfp_ahmia(SpiderFootPlugin):
startIndex = res['content'].index(eventData) - 120
endIndex = startIndex + len(eventData) + 240
except Exception:
- self.sf.debug(f"String '{eventData}' not found in content.")
+ self.debug(f"String '{eventData}' not found in content.")
continue
wdata = res['content'][startIndex:endIndex]
diff --git a/modules/sfp_alienvault.py b/modules/sfp_alienvault.py
index e51431d2..b3c354d0 100644
--- a/modules/sfp_alienvault.py
+++ b/modules/sfp_alienvault.py
@@ -137,12 +137,12 @@ class sfp_alienvault(SpiderFootPlugin):
def parseAPIResponse(self, res):
# Future proofing - AlienVault OTX does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by AienVault OTX")
+ self.error("You are being rate-limited by AienVault OTX")
self.errorState = True
return None
if res['code'] == "403":
- self.sf.error("AlienVault OTX API key seems to have been rejected or you have exceeded usage limits for the month.")
+ self.error("AlienVault OTX API key seems to have been rejected or you have exceeded usage limits for the month.")
self.errorState = True
return None
@@ -152,7 +152,7 @@ class sfp_alienvault(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from AlienVault OTX: {e}")
+ self.error(f"Error processing JSON response from AlienVault OTX: {e}")
return None
@@ -162,7 +162,7 @@ class sfp_alienvault(SpiderFootPlugin):
elif self.sf.validIP(qry):
target_type = "IPv4"
else:
- self.sf.info(f"Could not determine target type for {qry}")
+ self.info(f"Could not determine target type for {qry}")
return None
headers = {
@@ -184,7 +184,7 @@ class sfp_alienvault(SpiderFootPlugin):
elif self.sf.validIP(qry):
target_type = "IPv4"
else:
- self.sf.info(f"Could not determine target type for {qry}")
+ self.info(f"Could not determine target type for {qry}")
return None
headers = {
@@ -245,15 +245,15 @@ class sfp_alienvault(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -304,7 +304,7 @@ class sfp_alienvault(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
net_size = IPNetwork(eventData).prefixlen
if net_size < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
return
if eventName == 'AFFILIATE_IPADDR' and not self.opts.get('checkaffiliates', False):
@@ -317,7 +317,7 @@ class sfp_alienvault(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
net_size = IPNetwork(eventData).prefixlen
if net_size < max_subnet:
- self.sf.debug(f"Network size {net_size} bigger than permitted: {max_subnet}")
+ self.debug(f"Network size {net_size} bigger than permitted: {max_subnet}")
return
qrylist = list()
@@ -333,11 +333,11 @@ class sfp_alienvault(SpiderFootPlugin):
ret = self.queryPassiveDns(eventData)
if ret is None:
- self.sf.info(f"No Passive DNS info for {eventData}")
+ self.info(f"No Passive DNS info for {eventData}")
else:
passive_dns = ret.get('passive_dns')
if passive_dns:
- self.sf.debug(f"Found passive DNS results for {eventData} in AlienVault OTX")
+ self.debug(f"Found passive DNS results for {eventData} in AlienVault OTX")
for rec in passive_dns:
host = rec.get('hostname')
@@ -359,13 +359,13 @@ class sfp_alienvault(SpiderFootPlugin):
last_ts = int(time.mktime(last_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['cohost_age_limit_days'])
if last_ts < age_limit_ts:
- self.sf.debug(f"Passive DNS record {host} found for {eventData} is too old, skipping.")
+ self.debug(f"Passive DNS record {host} found for {eventData} is too old, skipping.")
continue
except Exception:
- self.sf.info("Could not parse date from AlienVault data, so ignoring cohost_age_limit_days")
+ self.info("Could not parse date from AlienVault data, so ignoring cohost_age_limit_days")
if self.opts["verify"] and not self.sf.validateIP(host, eventData):
- self.sf.debug(f"Co-host {host} no longer resolves to {eventData}, skipping")
+ self.debug(f"Co-host {host} no longer resolves to {eventData}, skipping")
continue
if self.cohostcount < self.opts['maxcohost']:
@@ -373,14 +373,14 @@ class sfp_alienvault(SpiderFootPlugin):
self.notifyListeners(e)
self.cohostcount += 1
else:
- self.sf.info(f"Maximum co-host threshold exceeded ({self.opts['maxcohost']}), ignoring co-host {host}")
+ self.info(f"Maximum co-host threshold exceeded ({self.opts['maxcohost']}), ignoring co-host {host}")
if eventName in ['IP_ADDRESS', 'IPV6_ADDRESS'] or eventName.startswith('NETBLOCK_'):
evtType = 'MALICIOUS_IPADDR'
elif eventName == "AFFILIATE_IPADDR":
evtType = 'MALICIOUS_AFFILIATE_IPADDR'
else:
- self.sf.debug(f"Unexpected event type {eventName}, skipping")
+ self.debug(f"Unexpected event type {eventName}, skipping")
return
for addr in qrylist:
@@ -395,13 +395,13 @@ class sfp_alienvault(SpiderFootPlugin):
continue
if rec.get("reputation", None):
- self.sf.debug(f"Found reputation info for {addr} in AlienVault OTX")
+ self.debug(f"Found reputation info for {addr} in AlienVault OTX")
rec_history = rec['reputation'].get("activities", list())
threat_score = rec['reputation']['threat_score']
threat_score_min = self.opts['threat_score_min']
if threat_score < threat_score_min:
- self.sf.debug(f"Threat score {threat_score} smaller than {threat_score_min}, skipping.")
+ self.debug(f"Threat score {threat_score} smaller than {threat_score_min}, skipping.")
continue
descr = f"AlienVault Threat Score: {threat_score}"
@@ -421,10 +421,10 @@ class sfp_alienvault(SpiderFootPlugin):
created_ts = int(time.mktime(created_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['reputation_age_limit_days'])
if created_ts < age_limit_ts:
- self.sf.debug(f"Reputation record found for {addr} is too old, skipping.")
+ self.debug(f"Reputation record found for {addr} is too old, skipping.")
continue
except Exception:
- self.sf.info("Could not parse date from AlienVault data, so ignoring reputation_age_limit_days")
+ self.info("Could not parse date from AlienVault data, so ignoring reputation_age_limit_days")
# For netblocks, we need to create the IP address event so that
# the threat intel event is more meaningful.
diff --git a/modules/sfp_alienvaultiprep.py b/modules/sfp_alienvaultiprep.py
index 23fcf517..a52d4fe8 100644
--- a/modules/sfp_alienvaultiprep.py
+++ b/modules/sfp_alienvaultiprep.py
@@ -96,13 +96,13 @@ class sfp_alienvaultiprep(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in AlienVault IP Reputation Database blacklist.")
+ self.debug(f"IP address {target} found in AlienVault IP Reputation Database blacklist.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in AlienVault IP Reputation Database blacklist.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in AlienVault IP Reputation Database blacklist.")
return True
return False
@@ -120,12 +120,12 @@ class sfp_alienvaultiprep(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from AlienVault IP Reputation Database.")
+ self.error(f"Unexpected HTTP response code {res['code']} from AlienVault IP Reputation Database.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from AlienVault IP Reputation Database")
+ self.error("Received no content from AlienVault IP Reputation Database")
self.errorState = True
return None
@@ -163,10 +163,10 @@ class sfp_alienvaultiprep(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -195,7 +195,7 @@ class sfp_alienvaultiprep(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with AlienVault IP Reputation Database")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with AlienVault IP Reputation Database")
if self.queryBlacklist(eventData, targetType):
url = "https://reputation.alienvault.com/reputation.generic"
diff --git a/modules/sfp_apple_itunes.py b/modules/sfp_apple_itunes.py
index 4fe8063c..9f3f5a42 100644
--- a/modules/sfp_apple_itunes.py
+++ b/modules/sfp_apple_itunes.py
@@ -87,13 +87,13 @@ class sfp_apple_itunes(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from Apple iTunes: {e}")
+ self.debug(f"Error processing JSON response from Apple iTunes: {e}")
return None
results = data.get('results')
if not results:
- self.sf.debug(f"No results found for {qry}")
+ self.debug(f"No results found for {qry}")
return None
return results
@@ -103,10 +103,10 @@ class sfp_apple_itunes(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName not in self.watchedEvents():
@@ -118,7 +118,7 @@ class sfp_apple_itunes(SpiderFootPlugin):
data = self.query(domain_reversed)
if not data:
- self.sf.info(f"No results found for {eventData}")
+ self.info(f"No results found for {eventData}")
return
urls = list()
@@ -149,7 +149,7 @@ class sfp_apple_itunes(SpiderFootPlugin):
and not bundleId.lower().endswith(f".{domain_reversed}")
and f".{domain_reversed}." not in bundleId.lower()
):
- self.sf.debug(f"App {app_full_name} does not match {domain_reversed}, skipping")
+ self.debug(f"App {app_full_name} does not match {domain_reversed}, skipping")
continue
trackViewUrl = result.get('trackViewUrl')
diff --git a/modules/sfp_archiveorg.py b/modules/sfp_archiveorg.py
index 6935e255..24cc889d 100644
--- a/modules/sfp_archiveorg.py
+++ b/modules/sfp_archiveorg.py
@@ -113,7 +113,7 @@ class sfp_archiveorg(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "INTERESTING_FILE" and not self.opts['intfiles']:
return
@@ -143,7 +143,7 @@ class sfp_archiveorg(SpiderFootPlugin):
try:
newDate = datetime.datetime.now() - datetime.timedelta(days=int(daysback))
except Exception:
- self.sf.error("Unable to parse option for number of days back to search.")
+ self.error("Unable to parse option for number of days back to search.")
self.errorState = True
return
@@ -155,32 +155,32 @@ class sfp_archiveorg(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
continue
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from Archive.org: {e}")
+ self.debug(f"Error processing JSON response from Archive.org: {e}")
ret = None
if not ret:
- self.sf.debug(f"Empty response from archive.org for {eventData}")
+ self.debug(f"Empty response from archive.org for {eventData}")
continue
if len(ret['archived_snapshots']) < 1:
- self.sf.debug("No archived snapshots for " + eventData)
+ self.debug("No archived snapshots for " + eventData)
continue
wbmlink = ret['archived_snapshots']['closest']['url']
if wbmlink in self.foundDates:
- self.sf.debug("Snapshot already fetched.")
+ self.debug("Snapshot already fetched.")
continue
self.foundDates.append(wbmlink)
name = eventName + "_HISTORIC"
- self.sf.info("Found a historic file: " + wbmlink)
+ self.info("Found a historic file: " + wbmlink)
evt = SpiderFootEvent(name, wbmlink, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_arin.py b/modules/sfp_arin.py
index 5928b669..9e64a6ba 100644
--- a/modules/sfp_arin.py
+++ b/modules/sfp_arin.py
@@ -98,7 +98,7 @@ class sfp_arin(SpiderFootPlugin):
lname = t
url += "pocs;first=" + fname + ";last=" + lname
except Exception as e:
- self.sf.debug("Couldn't process name: " + value + " (" + str(e) + ")")
+ self.debug("Couldn't process name: " + value + " (" + str(e) + ")")
return None
if qtype == "contact":
@@ -106,13 +106,13 @@ class sfp_arin(SpiderFootPlugin):
res = self.fetchRir(url)
if not res:
- self.sf.debug("No info found/available for " + value + " at ARIN.")
+ self.debug("No info found/available for " + value + " at ARIN.")
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
evt = SpiderFootEvent("RAW_RIR_DATA", str(data), self.__name__, self.currentEventSrc)
@@ -126,11 +126,11 @@ class sfp_arin(SpiderFootPlugin):
eventData = event.data
self.currentEventSrc = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_azureblobstorage.py b/modules/sfp_azureblobstorage.py
index 0a86e9bf..0ca2a45e 100644
--- a/modules/sfp_azureblobstorage.py
+++ b/modules/sfp_azureblobstorage.py
@@ -83,7 +83,7 @@ class sfp_azureblobstorage(SpiderFootPlugin):
if self.checkForStop():
return None
- self.sf.info("Spawning thread to check bucket: " + site)
+ self.info("Spawning thread to check bucket: " + site)
tname = str(random.SystemRandom().randint(0, 999999999))
t.append(threading.Thread(name='thread_sfp_azureblobstorages_' + tname,
target=self.checkSite, args=(site,)))
@@ -138,7 +138,7 @@ class sfp_azureblobstorage(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "LINKED_URL_EXTERNAL":
if ".blob.core.windows.net" in eventData:
diff --git a/modules/sfp_badpackets.py b/modules/sfp_badpackets.py
index 829b8857..a83f7eca 100644
--- a/modules/sfp_badpackets.py
+++ b/modules/sfp_badpackets.py
@@ -118,25 +118,25 @@ class sfp_badpackets(SpiderFootPlugin):
# Parse API Response from Bad Packets
def parseAPIResponse(self, res):
if res['content'] is None:
- self.sf.info("No Bad Packets information found")
+ self.info("No Bad Packets information found")
return None
# Error codes as mentioned in Bad Packets Documentation
if res['code'] == '400':
- self.sf.error("Invalid IP Address")
+ self.error("Invalid IP Address")
return None
if res['code'] == '401':
- self.sf.error("Unauthorized API Key")
+ self.error("Unauthorized API Key")
return None
if res['code'] == '403':
- self.sf.error("Forbidden Request")
+ self.error("Forbidden Request")
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from Bad Packets")
+ self.error("Failed to retrieve content from Bad Packets")
return None
# Always always always process external data with try/except since we cannot
@@ -144,7 +144,7 @@ class sfp_badpackets(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Bad Packets: {e}")
+ self.error(f"Error processing JSON response from Bad Packets: {e}")
return None
return None
@@ -158,17 +158,17 @@ class sfp_badpackets(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Always check if the API key is set and complain if it isn't, then set
# self.errorState to avoid this being a continual complaint during the scan.
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_badpackets but did not set an API key!")
+ self.error("You enabled sfp_badpackets but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -178,7 +178,7 @@ class sfp_badpackets(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {self.opts['maxnetblock']}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {self.opts['maxnetblock']}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -186,7 +186,7 @@ class sfp_badpackets(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {self.opts['maxsubnet']}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {self.opts['maxsubnet']}")
return
qrylist = list()
@@ -241,7 +241,7 @@ class sfp_badpackets(SpiderFootPlugin):
maliciousIP = record.get('source_ip_address')
if maliciousIP != addr:
- self.sf.error("Reported address doesn't match requested, skipping.")
+ self.error("Reported address doesn't match requested, skipping.")
continue
if maliciousIP:
@@ -252,14 +252,14 @@ class sfp_badpackets(SpiderFootPlugin):
if category:
maliciousIPDesc += " - CATEGORY : " + str(category) + "\n"
except Exception:
- self.sf.debug("No category found for target")
+ self.debug("No category found for target")
try:
description = record.get('tags')[0].get('description')
if description:
maliciousIPDesc += " - DESCRIPTION : " + str(description) + "\n"
except Exception:
- self.sf.debug("No description found for target")
+ self.debug("No description found for target")
maliciousIPDescHash = self.sf.hashstring(maliciousIPDesc)
if maliciousIPDescHash in self.results:
diff --git a/modules/sfp_bambenek.py b/modules/sfp_bambenek.py
new file mode 100644
index 00000000..cab04f9c
--- /dev/null
+++ b/modules/sfp_bambenek.py
@@ -0,0 +1,263 @@
+# -*- coding: utf-8 -*-
+# -------------------------------------------------------------------------------
+# Name: sfp_bambenek
+# Purpose: Checks if an IP, hostname or domain is malicious.
+#
+#
+# Created: 07/09/2018
+# Copyright: (c) Steve Micallef, 2018
+# Licence: GPL
+# -------------------------------------------------------------------------------
+
+import re
+
+from netaddr import IPAddress, IPNetwork
+
+from spiderfoot import SpiderFootEvent, SpiderFootPlugin
+
+malchecks = {
+ 'Bambenek C&C IP List': {
+ 'id': 'bambip',
+ 'checks': ['ip', 'netblock'],
+ 'url': 'http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt',
+ 'regex': '^{0},.*'
+ },
+ 'Bambenek C&C Domain List': {
+ 'id': 'bambdom',
+ 'checks': ['domain'],
+ 'url': 'http://osint.bambenekconsulting.com/feeds/c2-dommasterlist.txt',
+ 'regex': '^{0},.*'
+ }
+}
+
+
+class sfp_bambenek(SpiderFootPlugin):
+
+ meta = {
+ 'name': "Bambenek C&C List",
+ 'summary': "Check if a host/domain or IP appears on Bambenek Consulting's C&C tracker lists.",
+ 'flags': [],
+ 'useCases': ["Investigate", "Passive"],
+ 'categories': ["Reputation Systems"],
+ 'dataSource': {
+ 'website': "http://www.bambenekconsulting.com/",
+ 'model': "FREE_NOAUTH_UNLIMITED",
+ 'references': [
+ "http://www.bambenekconsulting.com/free-osint-tools/",
+ "https://osint.bambenekconsulting.com/feeds/",
+ "https://osint.bambenekconsulting.com/feeds/license.txt"
+ ],
+ 'favIcon': "http://www.bambenekconsulting.com/wp-content/uploads/2013/04/mini-logo1.ico",
+ 'logo': "http://www.bambenekconsulting.com/wp-content/uploads/2013/04/logo_transparent21-300x84.png",
+ 'description': "Bambenek Consulting is an cybersecurity investigations and intelligence consulting firm "
+ "focusing on tackling major criminal threats. "
+ "Every day, there is another story about another company having their banking accounts drained, "
+ "someone having their identity stolen, or critical infrastructure being taken offline by hostile entities. "
+ "Led by IT security expert, John Bambenek, we have the resources to bring to your business so "
+ "you can be sure your organization and your customers’ data is safe.",
+ }
+ }
+
+ # Default options
+ opts = {
+ 'bambip': True,
+ 'bambdom': True,
+ 'checkaffiliates': True,
+ 'checkcohosts': True,
+ 'cacheperiod': 18,
+ 'checknetblocks': True,
+ 'checksubnets': True
+ }
+
+ # Option descriptions
+ optdescs = {
+ 'bambip': "Enable Bambenek IP check?",
+ 'bambdom': "Enable Bambenek Domains check?",
+ 'checkaffiliates': "Apply checks to affiliates?",
+ 'checkcohosts': "Apply checks to sites found to be co-hosted on the target's IP?",
+ 'cacheperiod': "Hours to cache list data before re-fetching.",
+ 'checknetblocks': "Report if any malicious IPs are found within owned netblocks?",
+ 'checksubnets': "Check if any malicious IPs are found within the same subnet of the target?"
+ }
+
+ # Be sure to completely clear any class variables in setup()
+ # or you run the risk of data persisting between scan runs.
+
+ results = None
+
+ def setup(self, sfc, userOpts=dict()):
+ self.sf = sfc
+ self.results = self.tempStorage()
+
+ # Clear / reset any other class member variables here
+ # or you risk them persisting between threads.
+
+ for opt in list(userOpts.keys()):
+ self.opts[opt] = userOpts[opt]
+
+ # What events is this module interested in for input
+ # * = be notified about all events.
+ def watchedEvents(self):
+ return ["INTERNET_NAME", "IP_ADDRESS",
+ "NETBLOCK_MEMBER", "AFFILIATE_INTERNET_NAME", "AFFILIATE_IPADDR",
+ "CO_HOSTED_SITE", "NETBLOCK_OWNER"]
+
+ # What events this module produces
+ # This is to support the end user in selecting modules based on events
+ # produced.
+ def producedEvents(self):
+ return ["MALICIOUS_IPADDR", "MALICIOUS_INTERNET_NAME",
+ "MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME",
+ "MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]
+
+ # Look up 'list' type resources
+ def resourceList(self, replaceme_id, target, targetType):
+ targetDom = ''
+ # Get the base domain if we're supplied a domain
+ if targetType == "domain":
+ targetDom = self.sf.hostDomain(target, self.opts['_internettlds'])
+ if not targetDom:
+ return None
+
+ for check in list(malchecks.keys()):
+ cid = malchecks[check]['id']
+ if replaceme_id == cid:
+ data = dict()
+ url = malchecks[check]['url']
+ data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
+ if data['content'] is None:
+ data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
+ if data['content'] is None:
+ self.error("Unable to fetch " + url)
+ return None
+ else:
+ self.sf.cachePut("sfmal_" + cid, data['content'])
+
+ # If we're looking at netblocks
+ if targetType == "netblock":
+ iplist = list()
+ # Get the regex, replace {0} with an IP address matcher to
+ # build a list of IP.
+ # Cycle through each IP and check if it's in the netblock.
+ if 'regex' in malchecks[check]:
+ rx = malchecks[check]['regex'].replace("{0}", r"(\d+\.\d+\.\d+\.\d+)")
+ pat = re.compile(rx, re.IGNORECASE)
+ self.debug("New regex for " + check + ": " + rx)
+ for line in data['content'].split('\n'):
+ grp = re.findall(pat, line)
+ if len(grp) > 0:
+ # self.debug("Adding " + grp[0] + " to list.")
+ iplist.append(grp[0])
+ else:
+ iplist = data['content'].split('\n')
+
+ for ip in iplist:
+ if len(ip) < 8 or ip.startswith("#"):
+ continue
+ ip = ip.strip()
+
+ try:
+ if IPAddress(ip) in IPNetwork(target):
+ self.debug(f"{ip} found within netblock/subnet {target} in {check}")
+ return url
+ except Exception as e:
+ self.debug(f"Error encountered parsing: {e}")
+ continue
+
+ return None
+
+ # If we're looking at hostnames/domains/IPs
+ if 'regex' not in malchecks[check]:
+ for line in data['content'].split('\n'):
+ if line == target or (targetType == "domain" and line == targetDom):
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
+ return url
+ else:
+ try:
+ # Check for the domain and the hostname
+ rxDom = str(malchecks[check]['regex']).format(targetDom)
+ rxTgt = str(malchecks[check]['regex']).format(target)
+ for line in data['content'].split('\n'):
+ if (targetType == "domain" and re.match(rxDom, line, re.IGNORECASE)) or \
+ re.match(rxTgt, line, re.IGNORECASE):
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
+ return url
+ except Exception as e:
+ self.debug("Error encountered parsing 2: " + str(e))
+ continue
+
+ return None
+
+ def lookupItem(self, resourceId, itemType, target):
+ for check in list(malchecks.keys()):
+ cid = malchecks[check]['id']
+ if cid == resourceId and itemType in malchecks[check]['checks']:
+ self.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)
+ return self.resourceList(cid, target, itemType)
+
+ return None
+
+ # Handle events sent to this module
+ def handleEvent(self, event):
+ eventName = event.eventType
+ srcModuleName = event.module
+ eventData = event.data
+
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
+
+ if eventData in self.results:
+ self.debug(f"Skipping {eventData}, already checked.")
+ return
+
+ self.results[eventData] = True
+
+ if eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):
+ return
+ if eventName == 'AFFILIATE_IPADDR' \
+ and not self.opts.get('checkaffiliates', False):
+ return
+ if eventName == 'NETBLOCK_OWNER' and not self.opts.get('checknetblocks', False):
+ return
+ if eventName == 'NETBLOCK_MEMBER' and not self.opts.get('checksubnets', False):
+ return
+
+ for check in list(malchecks.keys()):
+ cid = malchecks[check]['id']
+
+ if eventName in ['IP_ADDRESS', 'AFFILIATE_IPADDR']:
+ typeId = 'ip'
+ if eventName == 'IP_ADDRESS':
+ evtType = 'MALICIOUS_IPADDR'
+ else:
+ evtType = 'MALICIOUS_AFFILIATE_IPADDR'
+
+ if eventName in ['INTERNET_NAME', 'CO_HOSTED_SITE',
+ 'AFFILIATE_INTERNET_NAME']:
+ typeId = 'domain'
+ if eventName == "INTERNET_NAME":
+ evtType = "MALICIOUS_INTERNET_NAME"
+ if eventName == 'AFFILIATE_INTERNET_NAME':
+ evtType = 'MALICIOUS_AFFILIATE_INTERNET_NAME'
+ if eventName == 'CO_HOSTED_SITE':
+ evtType = 'MALICIOUS_COHOST'
+
+ if eventName == 'NETBLOCK_OWNER':
+ typeId = 'netblock'
+ evtType = 'MALICIOUS_NETBLOCK'
+ if eventName == 'NETBLOCK_MEMBER':
+ typeId = 'netblock'
+ evtType = 'MALICIOUS_SUBNET'
+
+ url = self.lookupItem(cid, typeId, eventData)
+
+ if self.checkForStop():
+ return
+
+ # Notify other modules of what you've found
+ if url is not None:
+ text = f"{check} [{eventData}]\n<SFURL>{url}</SFURL>"
+ evt = SpiderFootEvent(evtType, text, self.__name__, event)
+ self.notifyListeners(evt)
+
+# End of sfp_bambenek class
diff --git a/modules/sfp_base64.py b/modules/sfp_base64.py
index 1f1d1f59..5c87e1e3 100644
--- a/modules/sfp_base64.py
+++ b/modules/sfp_base64.py
@@ -57,7 +57,7 @@ class sfp_base64(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
decoded_data = urllib.parse.unquote(eventData)
@@ -83,12 +83,12 @@ class sfp_base64(SpiderFootPlugin):
else:
string = str(match)
- self.sf.info(f"Found Base64 string: {match}")
+ self.info(f"Found Base64 string: {match}")
try:
string += f" ({base64.b64decode(match).decode('utf-8')})"
except Exception as e:
- self.sf.debug(f"Unable to base64-decode string: {e}")
+ self.debug(f"Unable to base64-decode string: {e}")
continue
evt = SpiderFootEvent("BASE64_DATA", string, self.__name__, event)
diff --git a/modules/sfp_bgpview.py b/modules/sfp_bgpview.py
index 638b8384..169cc8f8 100644
--- a/modules/sfp_bgpview.py
+++ b/modules/sfp_bgpview.py
@@ -84,17 +84,17 @@ class sfp_bgpview(SpiderFootPlugin):
try:
json_data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from BGPView: {e}")
+ self.debug(f"Error processing JSON response from BGPView: {e}")
return None
if json_data.get('status') != 'ok':
- self.sf.debug("No results found for ASN " + qry)
+ self.debug("No results found for ASN " + qry)
return None
data = json_data.get('data')
if not data:
- self.sf.debug("No results found for ASN " + qry)
+ self.debug("No results found for ASN " + qry)
return None
return data
@@ -112,17 +112,17 @@ class sfp_bgpview(SpiderFootPlugin):
try:
json_data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from BGPView: {e}")
+ self.debug(f"Error processing JSON response from BGPView: {e}")
return None
if json_data.get('status') != 'ok':
- self.sf.debug("No results found for IP address " + qry)
+ self.debug("No results found for IP address " + qry)
return None
data = json_data.get('data')
if not data:
- self.sf.debug("No results found for IP address " + qry)
+ self.debug("No results found for IP address " + qry)
return None
return data
@@ -140,17 +140,17 @@ class sfp_bgpview(SpiderFootPlugin):
try:
json_data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from BGPView: {e}")
+ self.debug(f"Error processing JSON response from BGPView: {e}")
return None
if json_data.get('status') != 'ok':
- self.sf.debug("No results found for netblock " + qry)
+ self.debug("No results found for netblock " + qry)
return None
data = json_data.get('data')
if not data:
- self.sf.debug("No results found for netblock " + qry)
+ self.debug("No results found for netblock " + qry)
return None
return data
@@ -163,10 +163,10 @@ class sfp_bgpview(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -175,7 +175,7 @@ class sfp_bgpview(SpiderFootPlugin):
data = self.queryAsn(eventData)
if not data:
- self.sf.info("No results found for ASN " + eventData)
+ self.info("No results found for ASN " + eventData)
return
e = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -193,7 +193,7 @@ class sfp_bgpview(SpiderFootPlugin):
data = self.queryNetblock(eventData)
if not data:
- self.sf.info("No results found for netblock " + eventData)
+ self.info("No results found for netblock " + eventData)
return
e = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -211,7 +211,7 @@ class sfp_bgpview(SpiderFootPlugin):
data = self.queryIp(eventData)
if not data:
- self.sf.info("No results found for IP address " + eventData)
+ self.info("No results found for IP address " + eventData)
return
e = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -220,7 +220,7 @@ class sfp_bgpview(SpiderFootPlugin):
prefixes = data.get('prefixes')
if not prefixes:
- self.sf.info("No prefixes found for IP address " + eventData)
+ self.info("No prefixes found for IP address " + eventData)
return
for prefix in prefixes:
@@ -235,7 +235,7 @@ class sfp_bgpview(SpiderFootPlugin):
if not asn:
continue
- self.sf.info(f"Netblock found: {p} ({asn})")
+ self.info(f"Netblock found: {p} ({asn})")
evt = SpiderFootEvent("BGP_AS_MEMBER", str(asn), self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_binaryedge.py b/modules/sfp_binaryedge.py
index 7083e894..c22a4b19 100644
--- a/modules/sfp_binaryedge.py
+++ b/modules/sfp_binaryedge.py
@@ -137,7 +137,7 @@ class sfp_binaryedge(SpiderFootPlugin):
elif querytype == "passive":
queryurl = "domains/ip"
else:
- self.sf.error(f"Invalid query type: {querytype}")
+ self.error(f"Invalid query type: {querytype}")
return None
headers = {
@@ -152,24 +152,24 @@ class sfp_binaryedge(SpiderFootPlugin):
)
if res['code'] in ["429", "500"]:
- self.sf.error("BinaryEdge.io API key seems to have been rejected or you have exceeded usage limits for the month.")
+ self.error("BinaryEdge.io API key seems to have been rejected or you have exceeded usage limits for the month.")
self.errorState = True
return None
if not res['content']:
- self.sf.info(f"No BinaryEdge.io info found for {qry}")
+ self.info(f"No BinaryEdge.io info found for {qry}")
return None
try:
info = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from BinaryEdge.io: {e}")
+ self.error(f"Error processing JSON response from BinaryEdge.io: {e}")
return None
if info.get('page') and info['total'] > info.get('pagesize', 100) * info.get('page', 0):
page = info['page'] + 1
if page > self.opts['maxpages']:
- self.sf.error("Maximum number of pages reached.")
+ self.error("Maximum number of pages reached.")
return [info]
retarr.append(info)
e = self.query(qry, querytype, page)
@@ -188,17 +188,17 @@ class sfp_binaryedge(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["binaryedge_api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -206,7 +206,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if eventName == "EMAILADDR":
ret = self.query(eventData, "email")
if ret is None:
- self.sf.info(f"No leak info for {eventData}")
+ self.info(f"No leak info for {eventData}")
return
for rec in ret:
@@ -214,7 +214,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if not events:
continue
- self.sf.debug("Found compromised account results in BinaryEdge.io")
+ self.debug("Found compromised account results in BinaryEdge.io")
for leak in events:
e = SpiderFootEvent('EMAILADDR_COMPROMISED', f"{eventData} [{leak}]", self.__name__, event)
@@ -230,7 +230,7 @@ class sfp_binaryedge(SpiderFootPlugin):
net_size = IPNetwork(eventData).prefixlen
max_netblock = self.opts['maxnetblock']
if net_size < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -240,7 +240,7 @@ class sfp_binaryedge(SpiderFootPlugin):
net_size = IPNetwork(eventData).prefixlen
max_subnet = self.opts['maxsubnet']
if net_size < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {net_size} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {net_size} > {max_subnet}")
return
# For IP Addresses, do the additional passive DNS lookup
@@ -248,7 +248,7 @@ class sfp_binaryedge(SpiderFootPlugin):
evtType = "CO_HOSTED_SITE"
ret = self.query(eventData, "passive")
if ret is None:
- self.sf.info(f"No Passive DNS info for {eventData}")
+ self.info(f"No Passive DNS info for {eventData}")
return
for rec in ret:
@@ -256,7 +256,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if not events:
continue
- self.sf.debug("Found passive DNS results in BinaryEdge.io")
+ self.debug("Found passive DNS results in BinaryEdge.io")
for rec in events:
host = rec['domain']
if host == eventData:
@@ -284,7 +284,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if eventName == "DOMAIN_NAME":
ret = self.query(eventData, "subs")
if ret is None:
- self.sf.info(f"No hosts found for {eventData}")
+ self.info(f"No hosts found for {eventData}")
return
for rec in ret:
@@ -292,7 +292,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if not events:
continue
- self.sf.debug("Found host results in BinaryEdge.io")
+ self.debug("Found host results in BinaryEdge.io")
for rec in events:
if rec in self.reportedhosts:
continue
@@ -301,7 +301,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if self.opts['verify']:
if not self.sf.resolveHost(rec) and not self.sf.resolveHost6(rec):
- self.sf.debug(f"Couldn't resolve {rec}, so skipping.")
+ self.debug(f"Couldn't resolve {rec}, so skipping.")
continue
e = SpiderFootEvent('INTERNET_NAME', rec, self.__name__, event)
@@ -328,7 +328,7 @@ class sfp_binaryedge(SpiderFootPlugin):
ret = self.query(addr, "torrent")
if ret is None:
- self.sf.info(f"No torrent info for {addr}")
+ self.info(f"No torrent info for {addr}")
continue
for rec in ret:
@@ -336,14 +336,14 @@ class sfp_binaryedge(SpiderFootPlugin):
if not events:
continue
- self.sf.debug(f"Found torrent results for {addr} in BinaryEdge.io")
+ self.debug(f"Found torrent results for {addr} in BinaryEdge.io")
for rec in events:
created_ts = rec['origin'].get('ts') / 1000
age_limit_ts = int(time.time()) - (86400 * self.opts['torrent_age_limit_days'])
if self.opts['torrent_age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_ts}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
dat = "Torrent: " + rec.get("torrent", "???").get("name") + " @ " + rec.get('torrent').get("source", "???")
@@ -362,7 +362,7 @@ class sfp_binaryedge(SpiderFootPlugin):
ret = self.query(addr, "vuln")
if ret is None:
- self.sf.info(f"No vulnerability info for {addr}")
+ self.info(f"No vulnerability info for {addr}")
continue
for rec in ret:
@@ -374,13 +374,13 @@ class sfp_binaryedge(SpiderFootPlugin):
if not results:
continue
- self.sf.debug("Found vulnerability results in BinaryEdge.io")
+ self.debug("Found vulnerability results in BinaryEdge.io")
for rec in results:
created_ts = rec.get('ts') / 1000
age_limit_ts = int(time.time()) - (86400 * self.opts['cve_age_limit_days'])
if self.opts['cve_age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_ts}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
cves = rec.get('cves')
@@ -402,7 +402,7 @@ class sfp_binaryedge(SpiderFootPlugin):
ret = self.query(addr, "ip")
if ret is None:
- self.sf.info(f"No port/banner info for {addr}")
+ self.info(f"No port/banner info for {addr}")
return
for rec in ret:
@@ -410,7 +410,7 @@ class sfp_binaryedge(SpiderFootPlugin):
if not events:
continue
- self.sf.debug("Found port/banner results in BinaryEdge.io")
+ self.debug("Found port/banner results in BinaryEdge.io")
ports = list()
for res in events:
@@ -419,7 +419,7 @@ class sfp_binaryedge(SpiderFootPlugin):
age_limit_ts = int(time.time()) - (86400 * self.opts['port_age_limit_days'])
if self.opts['port_age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_ts}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
port = str(prec['target']['port'])
@@ -443,7 +443,7 @@ class sfp_binaryedge(SpiderFootPlugin):
banner = banner.split('\\r\\n\\r\\n')[0]
banner = banner.replace("\\r\\n", "\n")
except Exception:
- self.sf.debug("No banner information found.")
+ self.debug("No banner information found.")
continue
e = SpiderFootEvent(evtbtype, banner, self.__name__, ev)
diff --git a/modules/sfp_bingsearch.py b/modules/sfp_bingsearch.py
index 75240910..ba04dee2 100644
--- a/modules/sfp_bingsearch.py
+++ b/modules/sfp_bingsearch.py
@@ -80,15 +80,15 @@ class sfp_bingsearch(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_bingsearch but did not set a Bing API key!")
+ self.error("You enabled sfp_bingsearch but did not set a Bing API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug("Already did a search for " + eventData + ", skipping.")
+ self.debug("Already did a search for " + eventData + ", skipping.")
return
self.results[eventData] = True
@@ -119,7 +119,7 @@ class sfp_bingsearch(SpiderFootPlugin):
link for link in new_links if self.sf.urlFQDN(link).endswith(eventData)
]
for link in internal_links:
- self.sf.debug("Found a link: " + link)
+ self.debug("Found a link: " + link)
evt = SpiderFootEvent("LINKED_URL_INTERNAL", link, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_bingsharedip.py b/modules/sfp_bingsharedip.py
index 9bee4f59..5993e1d2 100644
--- a/modules/sfp_bingsharedip.py
+++ b/modules/sfp_bingsharedip.py
@@ -94,21 +94,21 @@ class sfp_bingsharedip(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "" and self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_bingsharedip but did not set a Bing API key!")
+ self.error("You enabled sfp_bingsharedip but did not set a Bing API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
# Ignore IP addresses from myself as they are just for creating
# a link from the netblock to the co-host.
if eventName == "IP_ADDRESS" and srcModuleName == "sfp_bingsharedip":
- self.sf.debug("Ignoring " + eventName + ", from self.")
+ self.debug("Ignoring " + eventName + ", from self.")
return
if self.cohostcount > self.opts["maxcohost"]:
@@ -146,17 +146,17 @@ class sfp_bingsharedip(SpiderFootPlugin):
urls = res["urls"]
for url in urls:
- self.sf.info("Found something on same IP: " + url)
+ self.info("Found something on same IP: " + url)
site = self.sf.urlFQDN(url.lower())
if site not in myres and site != ip:
if not self.opts["cohostsamedomain"]:
if self.getTarget().matches(site, includeParents=True):
- self.sf.debug(
+ self.debug(
f"Skipping {site} because it is on the same domain."
)
continue
if self.opts["verify"] and not self.sf.validateIP(site, ip):
- self.sf.debug(f"Host {site} no longer resolves to {ip}")
+ self.debug(f"Host {site} no longer resolves to {ip}")
continue
# Create an IP Address event stemming from the netblock as the
# link to the co-host.
diff --git a/modules/sfp_binstring.py b/modules/sfp_binstring.py
index 884756dc..f3442998 100644
--- a/modules/sfp_binstring.py
+++ b/modules/sfp_binstring.py
@@ -118,7 +118,7 @@ class sfp_binstring(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -138,7 +138,7 @@ class sfp_binstring(SpiderFootPlugin):
if not res:
continue
- self.sf.debug(f"Searching {eventData} for strings")
+ self.debug(f"Searching {eventData} for strings")
words = self.getStrings(res['content'])
if words:
diff --git a/modules/sfp_bitcoin.py b/modules/sfp_bitcoin.py
index 23a67a85..2cc5ac2a 100644
--- a/modules/sfp_bitcoin.py
+++ b/modules/sfp_bitcoin.py
@@ -78,12 +78,12 @@ class sfp_bitcoin(SpiderFootPlugin):
self.results[sourceData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# 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(f"Bitcoin potential match: {m}")
+ self.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_bitcoinabuse.py b/modules/sfp_bitcoinabuse.py
index 595b332b..1cec521f 100644
--- a/modules/sfp_bitcoinabuse.py
+++ b/modules/sfp_bitcoinabuse.py
@@ -78,17 +78,17 @@ class sfp_bitcoinabuse(SpiderFootPlugin):
useragent="SpiderFoot",
)
if res["code"] != "200":
- self.sf.info(f"Failed to get results for {address}, code {res['code']}")
+ self.info(f"Failed to get results for {address}, code {res['code']}")
return None
if res["content"] is None:
- self.sf.info(f"Failed to get results for {address}, empty content")
+ self.info(f"Failed to get results for {address}, empty content")
return None
try:
return json.loads(res["content"])
except Exception as e:
- self.sf.error(f"Error processing JSON response from BitcoinAbuse: {e}")
+ self.error(f"Error processing JSON response from BitcoinAbuse: {e}")
return None
@@ -100,15 +100,15 @@ class sfp_bitcoinabuse(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error("You enabled sfp_bitcoinabuse but did not set an API key!")
+ self.error("You enabled sfp_bitcoinabuse but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_bitcoinwhoswho.py b/modules/sfp_bitcoinwhoswho.py
index 937e8ab7..84492e1c 100644
--- a/modules/sfp_bitcoinwhoswho.py
+++ b/modules/sfp_bitcoinwhoswho.py
@@ -80,13 +80,13 @@ class sfp_bitcoinwhoswho(SpiderFootPlugin):
)
if res["content"] is None:
- self.sf.info(f"No {self.meta['name']} info found for {qry}")
+ self.info(f"No {self.meta['name']} info found for {qry}")
return None
try:
return json.loads(res["content"])
except Exception as e:
- self.sf.error(f"Error processing JSON response from {self.meta['name']}: {e}")
+ self.error(f"Error processing JSON response from {self.meta['name']}: {e}")
return None
@@ -111,15 +111,15 @@ class sfp_bitcoinwhoswho(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {event.eventType}, from {event.module}")
+ self.debug(f"Received event, {event.eventType}, from {event.module}")
if self.opts["api_key"] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
self.errorState = True
return
if event.data in self.results:
- self.sf.debug(f"Skipping {event.data}, already checked.")
+ self.debug(f"Skipping {event.data}, already checked.")
return
self.results[event.data] = True
diff --git a/modules/sfp_blockchain.py b/modules/sfp_blockchain.py
index 251879a0..2fddc967 100644
--- a/modules/sfp_blockchain.py
+++ b/modules/sfp_blockchain.py
@@ -71,10 +71,10 @@ class sfp_blockchain(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -83,13 +83,13 @@ class sfp_blockchain(SpiderFootPlugin):
res = self.sf.fetchUrl("https://blockchain.info/balance?active=" + eventData,
timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.info("No Blockchain info found for " + eventData)
+ self.info("No Blockchain info found for " + eventData)
return
try:
data = json.loads(res['content'])
balance = float(data[eventData]['final_balance']) / 100000000
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return
evt = SpiderFootEvent("BITCOIN_BALANCE", str(balance) + " BTC", self.__name__, event)
diff --git a/modules/sfp_blocklistde.py b/modules/sfp_blocklistde.py
index 18fd4bd9..4c0e7e49 100644
--- a/modules/sfp_blocklistde.py
+++ b/modules/sfp_blocklistde.py
@@ -102,13 +102,13 @@ class sfp_blocklistde(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in blocklist.de blacklist.")
+ self.debug(f"IP address {target} found in blocklist.de blacklist.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in blocklist.de blacklist.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in blocklist.de blacklist.")
return True
return False
@@ -126,12 +126,12 @@ class sfp_blocklistde(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from blocklist.de.")
+ self.error(f"Unexpected HTTP response code {res['code']} from blocklist.de.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from blocklist.de")
+ self.error("Received no content from blocklist.de")
self.errorState = True
return None
@@ -169,10 +169,10 @@ class sfp_blocklistde(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -201,7 +201,7 @@ class sfp_blocklistde(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with blocklist.de")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with blocklist.de")
if self.queryBlacklist(eventData, targetType):
url = "https://lists.blocklist.de/lists/all.txt"
diff --git a/modules/sfp_botscout.py b/modules/sfp_botscout.py
index 0904d951..49a65cd5 100644
--- a/modules/sfp_botscout.py
+++ b/modules/sfp_botscout.py
@@ -83,15 +83,15 @@ class sfp_botscout(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_botscout but did not set an API key!")
+ self.error("You enabled sfp_botscout but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData} as already searched.")
+ self.debug(f"Skipping {eventData} as already searched.")
return
self.results[eventData] = True
@@ -105,11 +105,11 @@ class sfp_botscout(SpiderFootPlugin):
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])
if res['content'] is None or "|" not in res['content']:
- self.sf.error("Error encountered processing " + eventData)
+ self.error("Error encountered processing " + eventData)
return
if res['content'].startswith("Y|"):
- self.sf.info("Found Botscout entry for " + eventData + ": " + res['content'])
+ self.info("Found Botscout entry for " + eventData + ": " + res['content'])
if eventName == "IP_ADDRESS":
t = "MALICIOUS_IPADDR"
else:
diff --git a/modules/sfp_botvrij.py b/modules/sfp_botvrij.py
index 204fd492..904365b0 100644
--- a/modules/sfp_botvrij.py
+++ b/modules/sfp_botvrij.py
@@ -80,7 +80,7 @@ class sfp_botvrij(SpiderFootPlugin):
return False
if target.lower() in blacklist:
- self.sf.debug(f"Host name {target} found in botvrij.eu blacklist.")
+ self.debug(f"Host name {target} found in botvrij.eu blacklist.")
return True
return False
@@ -98,12 +98,12 @@ class sfp_botvrij(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from botvrij.eu.")
+ self.error(f"Unexpected HTTP response code {res['code']} from botvrij.eu.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from botvrij.eu")
+ self.error("Received no content from botvrij.eu")
self.errorState = True
return None
@@ -144,10 +144,10 @@ class sfp_botvrij(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -168,7 +168,7 @@ class sfp_botvrij(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with botvrij.eu")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with botvrij.eu")
if self.queryBlacklist(eventData):
url = "https://www.botvrij.eu/data/blocklist/blocklist_full.csv"
diff --git a/modules/sfp_builtwith.py b/modules/sfp_builtwith.py
index 124b93c5..19aac190 100644
--- a/modules/sfp_builtwith.py
+++ b/modules/sfp_builtwith.py
@@ -102,7 +102,7 @@ class sfp_builtwith(SpiderFootPlugin):
try:
return json.loads(res['content'])['Relationships']
except Exception as e:
- self.sf.error(f"Error processing JSON response from builtwith.com: {e}")
+ self.error(f"Error processing JSON response from builtwith.com: {e}")
return None
@@ -120,7 +120,7 @@ class sfp_builtwith(SpiderFootPlugin):
try:
return json.loads(res['content'])['Results'][0]
except Exception as e:
- self.sf.error(f"Error processing JSON response from builtwith.com: {e}")
+ self.error(f"Error processing JSON response from builtwith.com: {e}")
return None
@@ -133,15 +133,15 @@ class sfp_builtwith(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_builtwith but did not set an API key!")
+ self.error("You enabled sfp_builtwith but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -203,7 +203,7 @@ class sfp_builtwith(SpiderFootPlugin):
src = event
agelimit = int(time.time() * 1000) - (86400000 * self.opts['maxage'])
if t.get("LastDetected", 0) < agelimit:
- self.sf.debug("Data found too old, skipping.")
+ self.debug("Data found too old, skipping.")
continue
e = SpiderFootEvent("WEBSERVER_TECHNOLOGY", t["Name"],
self.__name__, src)
@@ -217,20 +217,20 @@ class sfp_builtwith(SpiderFootPlugin):
for r in data:
if "Domain" not in r or "Identifiers" not in r:
- self.sf.debug("Data returned not in the format requested.")
+ self.debug("Data returned not in the format requested.")
continue
if r['Domain'] != eventData:
- self.sf.debug("Data returned doesn't match data requested, skipping.")
+ self.debug("Data returned doesn't match data requested, skipping.")
continue
for i in r['Identifiers']:
if "Last" not in i or "Type" not in i or "Value" not in i:
- self.sf.debug("Data returned not in the format requested.")
+ self.debug("Data returned not in the format requested.")
continue
if i['Last'] < agelimit:
- self.sf.debug("Data found too old, skipping.")
+ self.debug("Data found too old, skipping.")
continue
evttype = None
diff --git a/modules/sfp_c99.py b/modules/sfp_c99.py
index a201a073..fb0f0d23 100644
--- a/modules/sfp_c99.py
+++ b/modules/sfp_c99.py
@@ -103,24 +103,24 @@ class sfp_c99(SpiderFootPlugin):
)
if res["code"] == "429":
- self.sf.error("Reaching rate limit on C99 API")
+ self.error("Reaching rate limit on C99 API")
self.errorState = True
return None
if res["code"] == 400:
- self.sf.error("Invalid request or API key on C99 API")
+ self.error("Invalid request or API key on C99 API")
self.errorState = True
return None
if res["content"] is None:
- self.sf.info(f"No C99 info found for {queryData}")
+ self.info(f"No C99 info found for {queryData}")
return None
try:
info = json.loads(res["content"])
except Exception as e:
self.errorState = True
- self.sf.error(f"Error processing response from C99: {e}")
+ self.error(f"Error processing response from C99: {e}")
return None
if not info.get('success', False):
@@ -355,7 +355,7 @@ class sfp_c99(SpiderFootPlugin):
return
if self.opts["verify"] and not self.sf.resolveHost(data) and not self.sf.resolveHost6(data):
- self.sf.debug(f"Host {data} could not be resolved.")
+ self.debug(f"Host {data} could not be resolved.")
if self.getTarget().matches(data):
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", data, self.__name__, event)
self.notifyListeners(evt)
@@ -371,12 +371,12 @@ class sfp_c99(SpiderFootPlugin):
if self.cohostcount < self.opts['maxcohost']:
if self.opts["verify"] and not self.sf.validateIP(data, event.data):
- self.sf.debug("Host no longer resolves to our IP.")
+ self.debug("Host no longer resolves to our IP.")
return
if not self.opts["cohostsamedomain"]:
if self.getTarget().matches(data, includeParents=True):
- self.sf.debug(
+ self.debug(
f"Skipping {data} because it is on the same domain."
)
return
@@ -395,16 +395,16 @@ class sfp_c99(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error("You enabled sfp_c99, but did not set an API key!")
+ self.error("You enabled sfp_c99, but did not set an API key!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_callername.py b/modules/sfp_callername.py
index 1e290faf..b4aa7d29 100644
--- a/modules/sfp_callername.py
+++ b/modules/sfp_callername.py
@@ -82,18 +82,18 @@ class sfp_callername(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Only US numbers are supported (+1)
if not eventData.startswith('+1'):
- self.sf.debug('Unsupported phone number: ' + eventData)
+ self.debug('Unsupported phone number: ' + eventData)
return
# Strip country code (+1) and formatting
number = eventData.lstrip('+1').strip('(').strip(')').strip('-').strip(' ')
if not number.isdigit():
- self.sf.debug('Invalid phone number: ' + number)
+ self.debug('Invalid phone number: ' + number)
return
# Query CallerName.com for the specified phone number
@@ -103,11 +103,11 @@ class sfp_callername(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.debug('No response from CallerName.com')
+ self.debug('No response from CallerName.com')
return
if res['code'] != '200':
- self.sf.debug('No phone information found for ' + eventData)
+ self.debug('No phone information found for ' + eventData)
return
location_match = re.findall(r'<div class="callerid"><h4>.*?</h4><p>(.+?)</p></div>', str(res['content']), re.MULTILINE | re.DOTALL)
@@ -116,7 +116,7 @@ class sfp_callername(SpiderFootPlugin):
location = location_match[0]
if len(location) < 5 or len(location) > 100:
- self.sf.debug("Skipping likely invalid location.")
+ self.debug("Skipping likely invalid location.")
else:
evt = SpiderFootEvent('GEOINFO', location, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_censys.py b/modules/sfp_censys.py
index d2ea09e4..8f089c39 100644
--- a/modules/sfp_censys.py
+++ b/modules/sfp_censys.py
@@ -146,42 +146,42 @@ class sfp_censys(SpiderFootPlugin):
return None
if res['code'] == "400":
- self.sf.error("Invalid request.")
+ self.error("Invalid request.")
return None
if res['code'] == "404":
- self.sf.info('Censys.io returned no results')
+ self.info('Censys.io returned no results')
return None
if res['code'] == "403":
- self.sf.error("Invalid API key.")
+ self.error("Invalid API key.")
self.errorState = True
return None
if res['code'] == "429":
- self.sf.error("Request rate limit exceeded.")
+ self.error("Request rate limit exceeded.")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error(f"Unexpected HTTP response code {res['code']} from Censys API.")
+ self.error(f"Unexpected HTTP response code {res['code']} from Censys API.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info('Censys.io returned no results')
+ self.info('Censys.io returned no results')
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Censys.io: {e}")
+ self.error(f"Error processing JSON response from Censys.io: {e}")
return None
error_type = data.get('error_type')
if error_type:
- self.sf.error(f"Censys returned an unexpected error: {error_type}")
+ self.error(f"Censys returned an unexpected error: {error_type}")
return None
return data
@@ -194,15 +194,15 @@ class sfp_censys(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['censys_api_key_uid'] == "" or self.opts['censys_api_key_secret'] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set an API uid/secret!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set an API uid/secret!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -213,7 +213,7 @@ class sfp_censys(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
qrylist = list()
@@ -236,10 +236,10 @@ class sfp_censys(SpiderFootPlugin):
rec = data.get("result")
if not rec:
- self.sf.info(f"Censys.io returned no results for {addr}")
+ self.info(f"Censys.io returned no results for {addr}")
continue
- self.sf.debug(f"Found results for {addr} in Censys.io")
+ self.debug(f"Found results for {addr} in Censys.io")
# For netblocks, we need to create the IP address event so that
# the threat intel event is more meaningful.
@@ -259,10 +259,10 @@ class sfp_censys(SpiderFootPlugin):
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_dt}), skipping.")
+ self.debug(f"Record found but too old ({created_dt}), skipping.")
continue
except Exception as e:
- self.sf.error(f"Error encountered processing last_updated_at record for {eventData} ({e})")
+ self.error(f"Error encountered processing last_updated_at record for {eventData} ({e})")
try:
location = rec.get('location')
@@ -281,7 +281,7 @@ class sfp_censys(SpiderFootPlugin):
e = SpiderFootEvent("GEOINFO", geoinfo, self.__name__, pevent)
self.notifyListeners(e)
except Exception as e:
- self.sf.error(f"Error encountered processing location record for {eventData} ({e})")
+ self.error(f"Error encountered processing location record for {eventData} ({e})")
try:
services = rec.get('services')
@@ -304,7 +304,7 @@ class sfp_censys(SpiderFootPlugin):
e.actualSource = addr
self.notifyListeners(e)
except Exception as e:
- self.sf.error(f"Error encountered processing services record for {eventData} ({e})")
+ self.error(f"Error encountered processing services record for {eventData} ({e})")
try:
autonomous_system = rec.get('autonomous_system')
@@ -319,7 +319,7 @@ class sfp_censys(SpiderFootPlugin):
e = SpiderFootEvent("NETBLOCK_MEMBER", str(bgp_prefix), self.__name__, pevent)
self.notifyListeners(e)
except Exception as e:
- self.sf.error(f"Error encountered processing autonomous_system record for {eventData} ({e})")
+ self.error(f"Error encountered processing autonomous_system record for {eventData} ({e})")
try:
operating_system = rec.get('operating_system')
@@ -332,6 +332,6 @@ class sfp_censys(SpiderFootPlugin):
e = SpiderFootEvent("OPERATING_SYSTEM", os, self.__name__, pevent)
self.notifyListeners(e)
except Exception as e:
- self.sf.error(f"Error encountered processing operating_system record for {eventData} ({e})")
+ self.error(f"Error encountered processing operating_system record for {eventData} ({e})")
# End of sfp_censys class
diff --git a/modules/sfp_certspotter.py b/modules/sfp_certspotter.py
index f38bd3c7..2f06a1a1 100644
--- a/modules/sfp_certspotter.py
+++ b/modules/sfp_certspotter.py
@@ -118,23 +118,23 @@ class sfp_certspotter(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.debug('No response from CertSpotter API')
+ self.debug('No response from CertSpotter API')
return None
if res['code'] == '429':
- self.sf.error("You are being rate-limited by CertSpotter")
+ self.error("You are being rate-limited by CertSpotter")
self.errorState = True
return None
if res['code'] != '200':
- self.sf.error(f"Unexpected HTTP response code {res['code']} from CertSpotter")
+ self.error(f"Unexpected HTTP response code {res['code']} from CertSpotter")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -151,13 +151,13 @@ class sfp_certspotter(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
max_pages = int(self.opts['max_pages'])
page = 1
@@ -189,7 +189,7 @@ class sfp_certspotter(SpiderFootPlugin):
hosts.append(d.replace("*.", ""))
if result.get('cert') is None:
- self.sf.debug('Response data contains no certificate data')
+ self.debug('Response data contains no certificate data')
continue
try:
@@ -197,11 +197,11 @@ class sfp_certspotter(SpiderFootPlugin):
pemcert = self.sf.sslDerToPem(dercert)
cert = self.sf.parseCert(pemcert, eventData, self.opts['certexpiringdays'])
except Exception as e:
- self.sf.info(f"Error parsing certificate: {e}")
+ self.info(f"Error parsing certificate: {e}")
continue
if not cert.get('text'):
- self.sf.info("Failed to parse the SSL certificate")
+ self.info("Failed to parse the SSL certificate")
continue
evt = SpiderFootEvent('SSL_CERTIFICATE_RAW', cert['text'], self.__name__, event)
@@ -238,7 +238,7 @@ class sfp_certspotter(SpiderFootPlugin):
return
if self.opts['verify']:
- self.sf.info(f"Resolving {len(set(hosts))} hostnames ...")
+ self.info(f"Resolving {len(set(hosts))} hostnames ...")
for domain in set(hosts):
if self.checkForStop():
@@ -253,7 +253,7 @@ class sfp_certspotter(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, domain, self.__name__, event)
diff --git a/modules/sfp_cinsscore.py b/modules/sfp_cinsscore.py
index 128a80ed..56c2ae43 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(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.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(f"{ip} found within netblock/subnet {qry} in cinsscore.com list.")
+ self.debug(f"{ip} found within netblock/subnet {qry} in cinsscore.com list.")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug(f"{qry} found in cinsscore.com list.")
+ self.debug(f"{qry} found in cinsscore.com list.")
return url
return None
@@ -117,10 +117,10 @@ class sfp_cinsscore(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -149,7 +149,7 @@ class sfp_cinsscore(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} with cinsscore.com")
+ self.debug(f"Checking maliciousness of {eventData} with cinsscore.com")
url = self.query(eventData, targetType)
diff --git a/modules/sfp_circllu.py b/modules/sfp_circllu.py
index d7cef243..2e174c84 100644
--- a/modules/sfp_circllu.py
+++ b/modules/sfp_circllu.py
@@ -118,12 +118,12 @@ class sfp_circllu(SpiderFootPlugin):
useragent="SpiderFoot", headers=headers)
if res['code'] not in ["200", "201"]:
- self.sf.error("CIRCL.LU access seems to have been rejected or you have exceeded usage limits.")
+ self.error("CIRCL.LU access seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No CIRCL.LU info found for " + qry)
+ self.info("No CIRCL.LU info found for " + qry)
return None
return res['content']
@@ -138,20 +138,20 @@ class sfp_circllu(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Ignore messages from myself
if srcModuleName == "sfp_circllu":
- self.sf.debug("Ignoring " + eventName + ", from self.")
+ self.debug("Ignoring " + eventName + ", from self.")
return
if self.opts['api_key_login'] == "" or self.opts['api_key_password'] == "":
- self.sf.error("You enabled sfp_circllu but did not set an credentials!")
+ self.error("You enabled sfp_circllu but did not set an credentials!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -162,15 +162,15 @@ class sfp_circllu(SpiderFootPlugin):
if "/" in eventData:
addr, mask = eventData.split("/")
if int(mask) < 23:
- self.sf.debug("Network size bigger than permitted by CIRCL.LU.")
+ self.debug("Network size bigger than permitted by CIRCL.LU.")
else:
ret = self.query(eventData, "PSSL")
if not ret:
- self.sf.info("No CIRCL.LU passive SSL data found for " + eventData)
+ self.info("No CIRCL.LU passive SSL data found for " + eventData)
else:
ret = self.query(eventData, "PSSL")
if not ret:
- self.sf.info("No CIRCL.LU passive SSL data found for " + eventData)
+ self.info("No CIRCL.LU passive SSL data found for " + eventData)
if ret:
try:
@@ -189,12 +189,12 @@ class sfp_circllu(SpiderFootPlugin):
e = SpiderFootEvent("SSL_CERTIFICATE_ISSUED", r[0][0], self.__name__, ipe)
self.notifyListeners(e)
except Exception as e:
- self.sf.error("Invalid response returned from CIRCL.LU: " + str(e))
+ self.error("Invalid response returned from CIRCL.LU: " + str(e))
if eventName in ['IP_ADDRESS', 'INTERNET_NAME', 'DOMAIN_NAME']:
ret = self.query(eventData, "PDNS")
if not ret:
- self.sf.info("No CIRCL.LU passive DNS data found for " + eventData)
+ self.info("No CIRCL.LU passive DNS data found for " + eventData)
return
# CIRCL.LU doesn't return valid JSON - it's one JSON record per line
@@ -204,12 +204,12 @@ class sfp_circllu(SpiderFootPlugin):
try:
rec = json.loads(line)
except Exception as e:
- self.sf.error("Invalid response returned from CIRCL.LU: " + str(e))
+ self.error("Invalid response returned from CIRCL.LU: " + str(e))
continue
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and rec['time_last'] < age_limit_ts:
- self.sf.debug(f"Record found but too old ({rec['time_last']}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
cohosts = list()
@@ -229,12 +229,12 @@ class sfp_circllu(SpiderFootPlugin):
for co in cohosts:
if eventName == "IP_ADDRESS" and (self.opts['verify'] and not self.sf.validateIP(co, eventData)):
- self.sf.debug("Host no longer resolves to our IP.")
+ self.debug("Host no longer resolves to our IP.")
continue
if not self.opts['cohostsamedomain']:
if self.getTarget().matches(co, includeParents=True):
- self.sf.debug("Skipping " + co + " because it is on the same domain.")
+ self.debug("Skipping " + co + " because it is on the same domain.")
continue
if self.cohostcount < self.opts['maxcohost']:
diff --git a/modules/sfp_citadel.py b/modules/sfp_citadel.py
index d0f1d507..847ce4ce 100644
--- a/modules/sfp_citadel.py
+++ b/modules/sfp_citadel.py
@@ -110,13 +110,13 @@ class sfp_citadel(SpiderFootPlugin):
return self.queryEmail(email)
if res['content'] is None:
- self.sf.debug('No response from Leak-Lookup.com')
+ self.debug('No response from Leak-Lookup.com')
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -126,14 +126,14 @@ class sfp_citadel(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -147,7 +147,7 @@ class sfp_citadel(SpiderFootPlugin):
message = data.get('message')
if error == 'true':
- self.sf.error(f"Error encountered processing {eventData}: {message}")
+ self.error(f"Error encountered processing {eventData}: {message}")
if "MISSING API" in message:
self.errorState = True
return
@@ -157,7 +157,7 @@ class sfp_citadel(SpiderFootPlugin):
return
for site in message:
- self.sf.info(f"Found Leak-Lookup entry for {eventData}: {site}")
+ self.info(f"Found Leak-Lookup entry for {eventData}: {site}")
evt = SpiderFootEvent("EMAILADDR_COMPROMISED", f"{eventData} [{site}]", self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_cleanbrowsing.py b/modules/sfp_cleanbrowsing.py
index 219ff75d..fc096e4d 100644
--- a/modules/sfp_cleanbrowsing.py
+++ b/modules/sfp_cleanbrowsing.py
@@ -81,9 +81,9 @@ class sfp_cleanbrowsing(SpiderFootPlugin):
try:
addrs = res.resolve(qaddr)
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
except Exception:
- self.sf.debug(f"Unable to resolve {qaddr}")
+ self.debug(f"Unable to resolve {qaddr}")
return False
if addrs:
@@ -96,7 +96,7 @@ class sfp_cleanbrowsing(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_cleantalk.py b/modules/sfp_cleantalk.py
index bfbd7ec1..092774de 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(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.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(f"{ip} found within netblock/subnet {qry} in CleanTalk Spam List.")
+ self.debug(f"{ip} found within netblock/subnet {qry} in CleanTalk Spam List.")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug(f"{qry} found in CleanTalk Spam List.")
+ self.debug(f"{qry} found in CleanTalk Spam List.")
return url
return None
@@ -134,10 +134,10 @@ class sfp_cleantalk(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -166,7 +166,7 @@ class sfp_cleantalk(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} with CleanTalk Spam List")
+ self.debug(f"Checking maliciousness of {eventData} with CleanTalk Spam List")
url = self.query(eventData, targetType)
diff --git a/modules/sfp_clearbit.py b/modules/sfp_clearbit.py
index 4882d69e..feacd59c 100644
--- a/modules/sfp_clearbit.py
+++ b/modules/sfp_clearbit.py
@@ -99,13 +99,13 @@ class sfp_clearbit(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot", headers=headers)
if res['code'] != "200":
- self.sf.error("Return code indicates no results or potential API key failure or exceeded limits.")
+ self.error("Return code indicates no results or potential API key failure or exceeded limits.")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from clearbit.io: {e}")
+ self.error(f"Error processing JSON response from clearbit.io: {e}")
return None
@@ -119,14 +119,14 @@ class sfp_clearbit(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_clearbit but did not set an API key!")
+ self.error("You enabled sfp_clearbit but did not set an API key!")
self.errorState = True
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -143,7 +143,7 @@ class sfp_clearbit(SpiderFootPlugin):
self.__name__, event)
self.notifyListeners(evt)
except Exception:
- self.sf.debug("Unable to extract name from JSON.")
+ self.debug("Unable to extract name from JSON.")
pass
# Get the location of the person, also indicating
@@ -167,7 +167,7 @@ class sfp_clearbit(SpiderFootPlugin):
evt = SpiderFootEvent("PHYSICAL_ADDRESS", loc, self.__name__, event)
self.notifyListeners(evt)
except Exception:
- self.sf.debug("Unable to extract location from JSON.")
+ self.debug("Unable to extract location from JSON.")
pass
try:
@@ -212,7 +212,7 @@ class sfp_clearbit(SpiderFootPlugin):
evt = SpiderFootEvent("PHYSICAL_ADDRESS", loc, self.__name__, event)
self.notifyListeners(evt)
except Exception:
- self.sf.debug("Unable to company info from JSON.")
+ self.debug("Unable to company info from JSON.")
pass
# End of sfp_clearbit class
diff --git a/modules/sfp_cloudflaredns.py b/modules/sfp_cloudflaredns.py
index 7ab0ede3..a046730e 100644
--- a/modules/sfp_cloudflaredns.py
+++ b/modules/sfp_cloudflaredns.py
@@ -73,9 +73,9 @@ class sfp_cloudflaredns(SpiderFootPlugin):
try:
addrs = res.resolve(qaddr)
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
except Exception:
- self.sf.debug(f"Unable to resolve {qaddr}")
+ self.debug(f"Unable to resolve {qaddr}")
return False
if not addrs:
@@ -94,7 +94,7 @@ class sfp_cloudflaredns(SpiderFootPlugin):
parentEvent = event
resolved = False
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_coinblocker.py b/modules/sfp_coinblocker.py
index 301ac5bb..22afa3ad 100644
--- a/modules/sfp_coinblocker.py
+++ b/modules/sfp_coinblocker.py
@@ -127,7 +127,7 @@ class sfp_coinblocker(SpiderFootPlugin):
if data['content'] is None:
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data['content'] is None:
- self.sf.error("Unable to fetch " + url)
+ self.error("Unable to fetch " + url)
return None
self.sf.cachePut("sfmal_" + cid, data['content'])
@@ -140,11 +140,11 @@ class sfp_coinblocker(SpiderFootPlugin):
if 'regex' in malchecks[check]:
rx = malchecks[check]['regex'].replace("{0}", r"(\d+\.\d+\.\d+\.\d+)")
pat = re.compile(rx, re.IGNORECASE)
- self.sf.debug("New regex for " + check + ": " + rx)
+ self.debug("New regex for " + check + ": " + rx)
for line in data['content'].split('\n'):
grp = re.findall(pat, line)
if len(grp) > 0:
- # self.sf.debug("Adding " + grp[0] + " to list.")
+ # self.debug("Adding " + grp[0] + " to list.")
iplist.append(grp[0])
else:
iplist = data['content'].split('\n')
@@ -156,10 +156,10 @@ class sfp_coinblocker(SpiderFootPlugin):
try:
if IPAddress(ip) in IPNetwork(target):
- self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")
+ self.debug(f"{ip} found within netblock/subnet {target} in {check}")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
return None
@@ -168,7 +168,7 @@ class sfp_coinblocker(SpiderFootPlugin):
if 'regex' not in malchecks[check]:
for line in data['content'].split('\n'):
if line == target or (targetType == "domain" and line == targetDom):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
return url
else:
try:
@@ -178,10 +178,10 @@ class sfp_coinblocker(SpiderFootPlugin):
for line in data['content'].split('\n'):
if (targetType == "domain" and re.match(rxDom, line, re.IGNORECASE)) or \
re.match(rxTgt, line, re.IGNORECASE):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing 2: " + str(e))
+ self.debug("Error encountered parsing 2: " + str(e))
continue
return None
@@ -190,7 +190,7 @@ class sfp_coinblocker(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.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)
return self.resourceList(cid, target, itemType)
return None
@@ -201,10 +201,10 @@ class sfp_coinblocker(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_commoncrawl.py b/modules/sfp_commoncrawl.py
index 394a74d1..ad4b207c 100644
--- a/modules/sfp_commoncrawl.py
+++ b/modules/sfp_commoncrawl.py
@@ -73,12 +73,12 @@ class sfp_commoncrawl(SpiderFootPlugin):
useragent="SpiderFoot")
if res['code'] in ["400", "401", "402", "403", "404"]:
- self.sf.error("CommonCrawl search doesn't seem to be available.")
+ self.error("CommonCrawl search doesn't seem to be available.")
self.errorState = True
return None
if not res['content']:
- self.sf.error("CommonCrawl search doesn't seem to be available.")
+ self.error("CommonCrawl search doesn't seem to be available.")
self.errorState = True
return None
@@ -92,12 +92,12 @@ class sfp_commoncrawl(SpiderFootPlugin):
useragent="SpiderFoot")
if res['code'] in ["400", "401", "402", "403", "404"]:
- self.sf.error("CommonCrawl index collection doesn't seem to be available.")
+ self.error("CommonCrawl index collection doesn't seem to be available.")
self.errorState = True
return list()
if not res['content']:
- self.sf.error("CommonCrawl index collection doesn't seem to be available.")
+ self.error("CommonCrawl index collection doesn't seem to be available.")
self.errorState = True
return list()
@@ -110,14 +110,14 @@ class sfp_commoncrawl(SpiderFootPlugin):
topindexes = sorted(list(indexlist.keys()), reverse=True)[0:self.opts['indexes']]
if len(topindexes) < self.opts['indexes']:
- self.sf.error("Not able to find latest CommonCrawl indexes.")
+ self.error("Not able to find latest CommonCrawl indexes.")
self.errorState = True
return list()
retindex = list()
for i in topindexes:
retindex.append("CC-MAIN-" + str(i)[0:4] + "-" + str(i)[4:6])
- self.sf.debug("CommonCrawl indexes: " + str(retindex))
+ self.debug("CommonCrawl indexes: " + str(retindex))
return retindex
# What events is this module interested in for input
@@ -136,7 +136,7 @@ class sfp_commoncrawl(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
@@ -150,16 +150,16 @@ class sfp_commoncrawl(SpiderFootPlugin):
self.indexBase = self.getLatestIndexes()
if not self.indexBase:
- self.sf.error("Unable to fetch CommonCrawl index.")
+ self.error("Unable to fetch CommonCrawl index.")
return
if len(self.indexBase) == 0:
- self.sf.error("Unable to fetch CommonCrawl index.")
+ self.error("Unable to fetch CommonCrawl index.")
return
data = self.search(eventData)
if not data:
- self.sf.error("Unable to obtain content from CommonCrawl.")
+ self.error("Unable to obtain content from CommonCrawl.")
return
sent = list()
@@ -186,7 +186,7 @@ class sfp_commoncrawl(SpiderFootPlugin):
self.__name__, event)
self.notifyListeners(evt)
except Exception as e:
- self.sf.error("Malformed JSON from CommonCrawl.org: " + str(e))
+ self.error("Malformed JSON from CommonCrawl.org: " + str(e))
return
# End of sfp_commoncrawl class
diff --git a/modules/sfp_comodo.py b/modules/sfp_comodo.py
index 49b69d72..70a9d81f 100644
--- a/modules/sfp_comodo.py
+++ b/modules/sfp_comodo.py
@@ -76,9 +76,9 @@ class sfp_comodo(SpiderFootPlugin):
try:
addrs = res.resolve(qaddr)
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
except Exception:
- self.sf.debug(f"Unable to resolve {qaddr}")
+ self.debug(f"Unable to resolve {qaddr}")
return False
if addrs:
@@ -93,7 +93,7 @@ class sfp_comodo(SpiderFootPlugin):
parentEvent = event
resolved = False
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_company.py b/modules/sfp_company.py
index 6bf54f63..b1afa365 100644
--- a/modules/sfp_company.py
+++ b/modules/sfp_company.py
@@ -86,17 +86,17 @@ class sfp_company(SpiderFootPlugin):
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.")
+ self.debug("Ignoring web content from CSS/JS.")
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName} ({len(eventData)} bytes)")
+ self.debug(f"Received event, {eventName}, from {srcModuleName} ({len(eventData)} bytes)")
# Strip out everything before the O=
try:
if eventName == "SSL_CERTIFICATE_ISSUED":
eventData = eventData.split("O=")[1]
except Exception:
- self.sf.debug("Couldn't strip out 'O=' from certificate issuer, proceeding anyway...")
+ self.debug("Couldn't strip out 'O=' from certificate issuer, proceeding anyway...")
# Find chunks of text containing what might be a company name first.
# This is to avoid running very expensive regexps on large chunks of
@@ -139,10 +139,10 @@ class sfp_company(SpiderFootPlugin):
fullcompany = re.sub(r"\s+", " ", fullcompany.strip())
- self.sf.info("Found company name: " + fullcompany)
+ self.info("Found company name: " + fullcompany)
if fullcompany in myres:
- self.sf.debug("Already found from this source.")
+ self.debug("Already found from this source.")
continue
myres.append(fullcompany)
diff --git a/modules/sfp_cookie.py b/modules/sfp_cookie.py
index 66ff3a7f..98118669 100644
--- a/modules/sfp_cookie.py
+++ b/modules/sfp_cookie.py
@@ -53,7 +53,7 @@ class sfp_cookie(SpiderFootPlugin):
eventData = event.data
eventSource = event.actualSource
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventSource in self.results:
return
@@ -62,13 +62,13 @@ class sfp_cookie(SpiderFootPlugin):
fqdn = self.sf.urlFQDN(eventSource)
if not self.getTarget().matches(fqdn):
- self.sf.debug(f"Not collecting cookies from external sites. Ignoring HTTP headers from {fqdn}")
+ self.debug(f"Not collecting cookies from external sites. Ignoring HTTP headers from {fqdn}")
return
try:
data = json.loads(eventData)
except Exception:
- self.sf.error("Received HTTP headers from another module in an unexpected format.")
+ self.error("Received HTTP headers from another module in an unexpected format.")
return
cookie = data.get('cookie')
diff --git a/modules/sfp_countryname.py b/modules/sfp_countryname.py
index bd567517..92611905 100644
--- a/modules/sfp_countryname.py
+++ b/modules/sfp_countryname.py
@@ -71,13 +71,13 @@ class sfp_countryname(SpiderFootPlugin):
try:
phoneNumber = phonenumbers.parse(srcPhoneNumber)
except Exception:
- self.sf.debug(f"Skipped invalid phone number: {srcPhoneNumber}")
+ self.debug(f"Skipped invalid phone number: {srcPhoneNumber}")
return None
try:
countryCode = region_code_for_country_code(phoneNumber.country_code)
except Exception:
- self.sf.debug(f"Lookup of region code failed for phone number: {srcPhoneNumber}")
+ self.debug(f"Lookup of region code failed for phone number: {srcPhoneNumber}")
return None
if not countryCode:
@@ -187,12 +187,12 @@ class sfp_countryname(SpiderFootPlugin):
else:
moduleDataSource = "Unknown"
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
eventDataHash = self.sf.hashstring(eventData)
if eventDataHash in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventDataHash] = True
@@ -220,14 +220,14 @@ class sfp_countryname(SpiderFootPlugin):
countryNames.extend(self.detectCountryFromData(eventData))
if not countryNames:
- self.sf.debug(f"Found no country names associated with {eventName}: {eventData}")
+ self.debug(f"Found no country names associated with {eventName}: {eventData}")
return
for countryName in set(countryNames):
if not countryName:
continue
- self.sf.debug(f"Found country name: {countryName}")
+ self.debug(f"Found country name: {countryName}")
evt = SpiderFootEvent("COUNTRY_NAME", countryName, self.__name__, event)
evt.moduleDataSource = moduleDataSource
diff --git a/modules/sfp_creditcard.py b/modules/sfp_creditcard.py
index 7284c19e..4a59b2fb 100644
--- a/modules/sfp_creditcard.py
+++ b/modules/sfp_creditcard.py
@@ -56,12 +56,12 @@ class sfp_creditcard(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
creditCards = self.sf.parseCreditCards(eventData)
for creditCard in set(creditCards):
- self.sf.info(f"Found credit card number: {creditCard}")
+ self.info(f"Found credit card number: {creditCard}")
evt = SpiderFootEvent("CREDIT_CARD_NUMBER", creditCard, self.__name__, event)
if event.moduleDataSource:
evt.moduleDataSource = event.moduleDataSource
diff --git a/modules/sfp_crobat_api.py b/modules/sfp_crobat_api.py
index 983de5f7..70736ecc 100644
--- a/modules/sfp_crobat_api.py
+++ b/modules/sfp_crobat_api.py
@@ -87,13 +87,13 @@ class sfp_crobat_api(SpiderFootPlugin):
def parseAPIResponse(self, res):
# Future proofing - Crobat API does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by Crobat API")
+ self.error("You are being rate-limited by Crobat API")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from Crobat API")
+ self.error("Failed to retrieve content from Crobat API")
self.errorState = True
return None
@@ -107,11 +107,11 @@ class sfp_crobat_api(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if not isinstance(data, list):
- self.sf.error("Failed to retrieve content from Crobat API")
+ self.error("Failed to retrieve content from Crobat API")
return None
return data
@@ -129,7 +129,7 @@ class sfp_crobat_api(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName != "DOMAIN_NAME":
return
@@ -145,7 +145,7 @@ class sfp_crobat_api(SpiderFootPlugin):
data = self.queryDomain(eventData, page)
if not data:
- self.sf.debug(f"No information found for domain {eventData} (page: {page})")
+ self.debug(f"No information found for domain {eventData} (page: {page})")
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -161,7 +161,7 @@ class sfp_crobat_api(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.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_crossref.py b/modules/sfp_crossref.py
index c14b4c85..91d9045a 100644
--- a/modules/sfp_crossref.py
+++ b/modules/sfp_crossref.py
@@ -64,7 +64,7 @@ class sfp_crossref(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# SIMILARDOMAIN and CO_HOSTED_SITE events are domains, not URLs.
# Assume HTTP.
@@ -79,20 +79,20 @@ class sfp_crossref(SpiderFootPlugin):
# We are only interested in external sites for the crossref
if self.getTarget().matches(fqdn):
- self.sf.debug(f"Ignoring {url} as not external")
+ self.debug(f"Ignoring {url} as not external")
return
if eventData in self.fetched:
- self.sf.debug(f"Ignoring {url} as already tested")
+ self.debug(f"Ignoring {url} as already tested")
return
if not self.sf.resolveHost(fqdn) and not self.sf.resolveHost6(fqdn):
- self.sf.debug(f"Ignoring {url} as {fqdn} does not resolve")
+ self.debug(f"Ignoring {url} as {fqdn} does not resolve")
return
self.fetched[url] = True
- self.sf.debug(f"Testing URL for affiliation: {url}")
+ self.debug(f"Testing URL for affiliation: {url}")
res = self.sf.fetchUrl(
url,
@@ -103,7 +103,7 @@ class sfp_crossref(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.debug(f"Ignoring {url} as no data returned")
+ self.debug(f"Ignoring {url} as no data returned")
return
matched = False
@@ -156,7 +156,7 @@ class sfp_crossref(SpiderFootPlugin):
if not event.moduleDataSource:
event.moduleDataSource = "Unknown"
- self.sf.info(f"Found link to target from affiliate: {url}")
+ self.info(f"Found link to target from affiliate: {url}")
evt1 = SpiderFootEvent(
"AFFILIATE_INTERNET_NAME",
diff --git a/modules/sfp_crt.py b/modules/sfp_crt.py
index d79f9cb4..f15f693a 100644
--- a/modules/sfp_crt.py
+++ b/modules/sfp_crt.py
@@ -84,7 +84,7 @@ class sfp_crt(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
params = {
'q': '%.' + str(eventData),
@@ -96,13 +96,13 @@ class sfp_crt(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.info("No certificate transparency info found for " + eventData)
+ self.info("No certificate transparency info found for " + eventData)
return
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return
if data is None or len(data) == 0:
@@ -136,7 +136,7 @@ class sfp_crt(SpiderFootPlugin):
domains.append(domain.replace("*.", ""))
if self.opts['verify'] and len(domains) > 0:
- self.sf.info("Resolving " + str(len(set(domains))) + " domains ...")
+ self.info("Resolving " + str(len(set(domains))) + " domains ...")
for domain in set(domains):
if domain in self.results:
@@ -151,7 +151,7 @@ class sfp_crt(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, domain, self.__name__, event)
@@ -178,13 +178,13 @@ class sfp_crt(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.info("Error retrieving certificate with ID " + str(cert_id))
+ self.info("Error retrieving certificate with ID " + str(cert_id))
continue
try:
cert = self.sf.parseCert(str(res['content']))
except Exception as e:
- self.sf.info('Error parsing certificate: ' + str(e))
+ self.info('Error parsing certificate: ' + str(e))
continue
evt = SpiderFootEvent("SSL_CERTIFICATE_RAW", cert['text'], self.__name__, event)
diff --git a/modules/sfp_crxcavator.py b/modules/sfp_crxcavator.py
index d9e0ed6b..d44b442e 100644
--- a/modules/sfp_crxcavator.py
+++ b/modules/sfp_crxcavator.py
@@ -91,11 +91,11 @@ class sfp_crxcavator(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from CRXcavator: {e}")
+ self.debug(f"Error processing JSON response from CRXcavator: {e}")
return None
if not data:
- self.sf.debug(f"No results found for {qry}")
+ self.debug(f"No results found for {qry}")
return None
return data
@@ -115,11 +115,11 @@ class sfp_crxcavator(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from CRXcavator: {e}")
+ self.debug(f"Error processing JSON response from CRXcavator: {e}")
return None
if not data:
- self.sf.debug(f"No results found for extension {extension_id}")
+ self.debug(f"No results found for extension {extension_id}")
return None
return data
@@ -132,10 +132,10 @@ class sfp_crxcavator(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName not in self.watchedEvents():
@@ -147,7 +147,7 @@ class sfp_crxcavator(SpiderFootPlugin):
results = self.query(domain_keyword)
if not results:
- self.sf.info(f"No results found for {domain_keyword}")
+ self.info(f"No results found for {domain_keyword}")
return
evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(results), self.__name__, event)
@@ -219,7 +219,7 @@ class sfp_crxcavator(SpiderFootPlugin):
and not self.getTarget().matches(self.sf.urlFQDN(offered_by), includeChildren=True, includeParents=True)
and not self.getTarget().matches(self.sf.urlFQDN(support_site), includeChildren=True, includeParents=True)
):
- self.sf.debug(f"Extension {app_full_name} does not match {eventData}, skipping")
+ self.debug(f"Extension {app_full_name} does not match {eventData}, skipping")
continue
app_data = f"{name} {version}\n<SFURL>https://chrome.google.com/webstore/detail/{extension_id}</SFURL>"
@@ -269,7 +269,7 @@ class sfp_crxcavator(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, host, self.__name__, event)
diff --git a/modules/sfp_customfeed.py b/modules/sfp_customfeed.py
index f07eb9e8..849d8de2 100644
--- a/modules/sfp_customfeed.py
+++ b/modules/sfp_customfeed.py
@@ -101,7 +101,7 @@ class sfp_customfeed(SpiderFootPlugin):
if data['content'] is None:
data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if data['content'] is None:
- self.sf.error("Unable to fetch " + url)
+ self.error("Unable to fetch " + url)
return None
self.sf.cachePut("sfmal_" + cid, data['content'])
@@ -114,11 +114,11 @@ class sfp_customfeed(SpiderFootPlugin):
if 'regex' in malchecks[check]:
rx = malchecks[check]['regex'].replace("{0}", r"(\d+\.\d+\.\d+\.\d+)")
pat = re.compile(rx, re.IGNORECASE)
- self.sf.debug("New regex for " + check + ": " + rx)
+ self.debug("New regex for " + check + ": " + rx)
for line in data['content'].split('\n'):
grp = re.findall(pat, line)
if len(grp) > 0:
- # self.sf.debug("Adding " + grp[0] + " to list.")
+ # self.debug("Adding " + grp[0] + " to list.")
iplist.append(grp[0])
else:
iplist = data['content'].split('\n')
@@ -130,10 +130,10 @@ class sfp_customfeed(SpiderFootPlugin):
try:
if IPAddress(ip) in IPNetwork(target):
- self.sf.debug(f"{ip} found within netblock/subnet {target} in {check}")
+ self.debug(f"{ip} found within netblock/subnet {target} in {check}")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
return None
@@ -142,7 +142,7 @@ class sfp_customfeed(SpiderFootPlugin):
if 'regex' not in malchecks[check]:
for line in data['content'].split('\n'):
if line == target or (targetType == "domain" and line == targetDom):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
return url
else:
# Check for the domain and the hostname
@@ -152,10 +152,10 @@ class sfp_customfeed(SpiderFootPlugin):
for line in data['content'].split('\n'):
if (targetType == "domain" and re.match(rxDom, line, re.IGNORECASE)) or \
re.match(rxTgt, line, re.IGNORECASE):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
+ self.debug(target + "/" + targetDom + " found in " + check + " list.")
return url
except Exception as e:
- self.sf.debug("Error encountered parsing 2: " + str(e))
+ self.debug("Error encountered parsing 2: " + str(e))
continue
return None
@@ -164,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.debug("Checking maliciousness of " + target + " ("
+ + itemType + ") with: " + cid)
return self.resourceList(cid, target, itemType)
return None
@@ -176,18 +176,18 @@ class sfp_customfeed(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['url'] == "":
- self.sf.error("You enabled sfp_customfeed but defined no custom feed URL!")
+ self.error("You enabled sfp_customfeed but defined no custom feed URL!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_cybercrimetracker.py b/modules/sfp_cybercrimetracker.py
index 65eaca94..7f34b9e9 100644
--- a/modules/sfp_cybercrimetracker.py
+++ b/modules/sfp_cybercrimetracker.py
@@ -87,7 +87,7 @@ class sfp_cybercrimetracker(SpiderFootPlugin):
return False
if target.lower() in blacklist:
- self.sf.debug(f"Host name {target} found in cybercrime-tracker.net blacklist.")
+ self.debug(f"Host name {target} found in cybercrime-tracker.net blacklist.")
return True
return False
@@ -105,12 +105,12 @@ class sfp_cybercrimetracker(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from cybercrime-tracker.net.")
+ self.error(f"Unexpected HTTP response code {res['code']} from cybercrime-tracker.net.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from cybercrime-tracker.net")
+ self.error("Received no content from cybercrime-tracker.net")
self.errorState = True
return None
@@ -154,10 +154,10 @@ class sfp_cybercrimetracker(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -184,7 +184,7 @@ class sfp_cybercrimetracker(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with cybercrime-tracker.net")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with cybercrime-tracker.net")
if self.queryBlacklist(eventData):
url = "http://cybercrime-tracker.net/all.php"
diff --git a/modules/sfp_darksearch.py b/modules/sfp_darksearch.py
index 31a4c015..ba01f749 100644
--- a/modules/sfp_darksearch.py
+++ b/modules/sfp_darksearch.py
@@ -95,7 +95,7 @@ class sfp_darksearch(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -108,12 +108,12 @@ class sfp_darksearch(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
page = 1
pages = self.opts['max_pages']
@@ -159,7 +159,7 @@ class sfp_darksearch(SpiderFootPlugin):
continue
self.results[link] = True
- self.sf.debug("Found a darknet mention: " + link)
+ self.debug("Found a darknet mention: " + link)
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(link,
@@ -168,11 +168,11 @@ class sfp_darksearch(SpiderFootPlugin):
verify=False)
if res['content'] is None:
- self.sf.debug("Ignoring " + link + " as no data returned")
+ self.debug("Ignoring " + link + " as no data returned")
continue
if eventData not in res['content']:
- self.sf.debug("Ignoring " + link + " as no mention of " + eventData)
+ self.debug("Ignoring " + link + " as no mention of " + eventData)
continue
evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)
@@ -184,7 +184,7 @@ class sfp_darksearch(SpiderFootPlugin):
startIndex = res['content'].index(eventData) - 120
endIndex = startIndex + len(eventData) + 240
except Exception:
- self.sf.debug("String not found in content.")
+ self.debug("String not found in content.")
continue
data = res['content'][startIndex:endIndex]
@@ -200,7 +200,7 @@ class sfp_darksearch(SpiderFootPlugin):
found = True
if result.get('title') is None and result.get('description') is None:
- self.sf.debug("Ignoring " + link + " as no mention of " + eventData)
+ self.debug("Ignoring " + link + " as no mention of " + eventData)
continue
evt = SpiderFootEvent("DARKNET_MENTION_CONTENT",
diff --git a/modules/sfp_debounce.py b/modules/sfp_debounce.py
index 24eed127..8b919b66 100644
--- a/modules/sfp_debounce.py
+++ b/modules/sfp_debounce.py
@@ -74,13 +74,13 @@ class sfp_debounce(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.info(f"No Debounce info found for {qry}")
+ self.info(f"No Debounce info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Debounce: {e}")
+ self.error(f"Error processing JSON response from Debounce: {e}")
return None
@@ -93,7 +93,7 @@ class sfp_debounce(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
self.results[eventData] = True
diff --git a/modules/sfp_dehashed.py b/modules/sfp_dehashed.py
index 91d52701..0dfc3c8d 100644
--- a/modules/sfp_dehashed.py
+++ b/modules/sfp_dehashed.py
@@ -114,28 +114,28 @@ class sfp_dehashed(SpiderFootPlugin):
time.sleep(self.opts['pause'])
if res['code'] == "400":
- self.sf.error("Too many requests were performed in a small amount of time. Please wait a bit before querying the API.")
+ self.error("Too many requests were performed in a small amount of time. Please wait a bit before querying the API.")
time.sleep(5)
res = self.sf.fetchUrl(queryString, headers=headers, timeout=15, useragent=self.opts['_useragent'], verify=True)
if res['code'] == "401":
- self.sf.error("Invalid API credentials")
+ self.error("Invalid API credentials")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error("Unable to fetch data from Dehashed.")
+ self.error("Unable to fetch data from Dehashed.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.debug('No response from Dehashed')
+ self.debug('No response from Dehashed')
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
# Handle events sent to this module
@@ -155,10 +155,10 @@ class sfp_dehashed(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "" or self.opts['api_key_username'] == "":
- self.sf.error("You enabled sfp_dehashed but did not set an API key/API Key Username!")
+ self.error("You enabled sfp_dehashed but did not set an API key/API Key Username!")
self.errorState = True
return
diff --git a/modules/sfp_digitaloceanspace.py b/modules/sfp_digitaloceanspace.py
index 4030b380..844ef61d 100644
--- a/modules/sfp_digitaloceanspace.py
+++ b/modules/sfp_digitaloceanspace.py
@@ -76,7 +76,7 @@ class sfp_digitaloceanspace(SpiderFootPlugin):
return
if "NoSuchBucket" in res['content']:
- self.sf.debug(f"Not a valid bucket: {url}")
+ self.debug(f"Not a valid bucket: {url}")
return
# Bucket found
@@ -100,7 +100,7 @@ class sfp_digitaloceanspace(SpiderFootPlugin):
if self.checkForStop():
return None
- self.sf.info("Spawning thread to check bucket: " + site)
+ self.info("Spawning thread to check bucket: " + site)
tname = str(random.SystemRandom().randint(0, 999999999))
t.append(threading.Thread(name='thread_sfp_digitaloceanspaces_' + tname,
target=self.checkSite, args=(site,)))
@@ -156,7 +156,7 @@ class sfp_digitaloceanspace(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "LINKED_URL_EXTERNAL":
if ".digitaloceanspaces.com" in eventData:
diff --git a/modules/sfp_dnsbrute.py b/modules/sfp_dnsbrute.py
index 8710aefe..3172af32 100644
--- a/modules/sfp_dnsbrute.py
+++ b/modules/sfp_dnsbrute.py
@@ -110,7 +110,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
t = []
# Spawn threads for scanning
- self.sf.info("Spawning threads to check hosts: " + str(hostList))
+ self.info("Spawning threads to check hosts: " + str(hostList))
for name in hostList:
tn = 'thread_sfp_dnsbrute_' + str(random.SystemRandom().randint(1, 999999999))
t.append(threading.Thread(name=tn, target=self.tryHost, args=(name,)))
@@ -135,7 +135,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
# Store the result internally and notify listening modules
def sendEvent(self, source, result):
- self.sf.info("Found a brute-forced host: " + result)
+ self.info("Found a brute-forced host: " + result)
# Report the host
evt = SpiderFootEvent("INTERNET_NAME", result, self.__name__, source)
self.notifyListeners(evt)
@@ -147,7 +147,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
eventData = event.data
eventDataHash = self.sf.hashstring(eventData)
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == "sfp_dnsbrute":
return
@@ -168,7 +168,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
# Try resolving common names
wildcard = self.sf.checkDnsWildcard(dom)
if self.opts['skipcommonwildcard'] and wildcard:
- self.sf.debug("Wildcard DNS detected on " + dom + " so skipping host iteration.")
+ self.debug("Wildcard DNS detected on " + dom + " so skipping host iteration.")
return
dom = "." + dom
@@ -191,10 +191,10 @@ class sfp_dnsbrute(SpiderFootPlugin):
return
# Try resolving common names
- self.sf.debug("Iterating through possible sub-domains.")
+ self.debug("Iterating through possible sub-domains.")
wildcard = self.sf.checkDnsWildcard(eventData)
if self.opts['skipcommonwildcard'] and wildcard:
- self.sf.debug("Wildcard DNS detected.")
+ self.debug("Wildcard DNS detected.")
return
targetList = list()
diff --git a/modules/sfp_dnscommonsrv.py b/modules/sfp_dnscommonsrv.py
index bbb1d577..09ec4e88 100644
--- a/modules/sfp_dnscommonsrv.py
+++ b/modules/sfp_dnscommonsrv.py
@@ -92,10 +92,10 @@ class sfp_dnscommonsrv(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == "sfp_dnscommonsrv":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return
eventDataHash = self.sf.hashstring(eventData)
@@ -110,7 +110,7 @@ class sfp_dnscommonsrv(SpiderFootPlugin):
if self.opts.get('_dnsserver', "") != "":
res.nameservers = [self.opts['_dnsserver']]
- self.sf.debug("Iterating through possible SRV records.")
+ self.debug("Iterating through possible SRV records.")
# Try resolving common names
for srv in self.commonsrv:
diff --git a/modules/sfp_dnsdb.py b/modules/sfp_dnsdb.py
index 086608db..be0d5009 100644
--- a/modules/sfp_dnsdb.py
+++ b/modules/sfp_dnsdb.py
@@ -94,11 +94,11 @@ class sfp_dnsdb(SpiderFootPlugin):
def query(self, endpoint, queryType, query):
if endpoint not in ("rrset", "rdata"):
- self.sf.error(f"Endpoint MUST be rrset or rdata, you sent {endpoint}")
+ self.error(f"Endpoint MUST be rrset or rdata, you sent {endpoint}")
return None
if queryType not in ("name", "ip"):
- self.sf.error(f"Query type MUST be name or ip, you sent {queryType}")
+ self.error(f"Query type MUST be name or ip, you sent {queryType}")
return None
headers = {"Accept": "application/x-ndjson", "X-API-Key": self.opts["api_key"]}
@@ -111,21 +111,21 @@ class sfp_dnsdb(SpiderFootPlugin):
)
if res["code"] == "429":
- self.sf.error("You are being rate-limited by DNSDB")
+ self.error("You are being rate-limited by DNSDB")
self.errorState = True
return None
if res["content"] is None:
- self.sf.info(f"No DNSDB record found for {query}")
+ self.info(f"No DNSDB record found for {query}")
return None
splittedContent = res["content"].strip().split("\n")
if len(splittedContent) == 2:
- self.sf.info(f"No DNSDB record found for {query}")
+ self.info(f"No DNSDB record found for {query}")
return None
if len(splittedContent) < 2:
- self.sf.info(f"Unexpected DNSDB response {query}")
+ self.info(f"Unexpected DNSDB response {query}")
return None
try:
@@ -133,7 +133,7 @@ class sfp_dnsdb(SpiderFootPlugin):
for content in splittedContent:
records.append(json.loads(content))
except json.JSONDecodeError as e:
- self.sf.error(f"Error processing JSON response from DNSDB: {e}")
+ self.error(f"Error processing JSON response from DNSDB: {e}")
return None
return records[1:-1]
@@ -141,7 +141,7 @@ class sfp_dnsdb(SpiderFootPlugin):
def isTooOld(self, lastSeen):
ageLimitTs = int(time.time()) - (86400 * self.opts["age_limit_days"])
if self.opts["age_limit_days"] > 0 and lastSeen < ageLimitTs:
- self.sf.debug(f"Record found but too old ({lastSeen}), skipping.")
+ self.debug("Record found but too old, skipping.")
return True
return False
@@ -153,15 +153,15 @@ class sfp_dnsdb(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error("You enabled sfp_dnsdb but did not set an API key!")
+ self.error("You enabled sfp_dnsdb but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -202,13 +202,13 @@ class sfp_dnsdb(SpiderFootPlugin):
if record.get("rrtype") == "A":
if not self.sf.validIP(data):
- self.sf.debug(f"Skipping invalid IP address {data}")
+ self.debug(f"Skipping invalid IP address {data}")
continue
if self.opts["verify"] and not self.sf.validateIP(
eventData, data
):
- self.sf.debug(
+ self.debug(
f"Host {eventData} no longer resolves to {data}"
)
continue
@@ -223,13 +223,13 @@ class sfp_dnsdb(SpiderFootPlugin):
continue
if not self.sf.validIP6(data):
- self.sf.debug("Skipping invalid IPv6 address " + data)
+ self.debug("Skipping invalid IPv6 address " + data)
continue
if self.opts["verify"] and not self.sf.validateIP(
eventData, data
):
- self.sf.debug(
+ self.debug(
"Host " + eventData + " no longer resolves to " + data
)
continue
@@ -305,7 +305,7 @@ class sfp_dnsdb(SpiderFootPlugin):
continue
if self.opts["verify"] and not self.sf.resolveHost(data) and not self.sf.resolveHost6(data):
- self.sf.debug(f"Host {data} could not be resolved")
+ self.debug(f"Host {data} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", data, self.__name__, event)
else:
evt = SpiderFootEvent("INTERNET_NAME", data, self.__name__, event)
@@ -315,12 +315,12 @@ class sfp_dnsdb(SpiderFootPlugin):
if eventName == "IP_ADDRESS" and (
self.opts["verify"] and not self.sf.validateIP(co, eventData)
):
- self.sf.debug("Host no longer resolves to our IP.")
+ self.debug("Host no longer resolves to our IP.")
continue
if not self.opts["cohostsamedomain"]:
if self.getTarget().matches(co, includeParents=True):
- self.sf.debug(
+ self.debug(
"Skipping " + co + " because it is on the same domain."
)
continue
diff --git a/modules/sfp_dnsdumpster.py b/modules/sfp_dnsdumpster.py
index f67a0eff..91618f88 100644
--- a/modules/sfp_dnsdumpster.py
+++ b/modules/sfp_dnsdumpster.py
@@ -40,7 +40,7 @@ class sfp_dnsdumpster(SpiderFootPlugin):
def setup(self, sfc, userOpts=dict()):
self.sf = sfc
- self.sf.debug("Setting up sfp_dnsdumpster")
+ self.debug("Setting up sfp_dnsdumpster")
self.results = self.tempStorage()
self.opts.update(userOpts)
@@ -59,9 +59,9 @@ class sfp_dnsdumpster(SpiderFootPlugin):
useragent=self.opts.get("_useragent", "Spiderfoot")
)
if res1["code"] not in ["200"]:
- self.sf.error(f"Bad response code \"{res1['code']}\" from DNSDumpster")
+ self.error(f"Bad response code \"{res1['code']}\" from DNSDumpster")
else:
- self.sf.debug(f"Valid response code \"{res1['code']}\" from DNSDumpster")
+ self.debug(f"Valid response code \"{res1['code']}\" from DNSDumpster")
html = BeautifulSoup(str(res1["content"]), features="lxml")
csrftoken = None
csrfmiddlewaretoken = None
@@ -76,11 +76,11 @@ class sfp_dnsdumpster(SpiderFootPlugin):
# Abort if we didn't get the tokens
if not csrftoken or not csrfmiddlewaretoken:
- self.sf.error("Error obtaining CSRF tokens")
+ self.error("Error obtaining CSRF tokens")
self.errorState = True
return ret
else:
- self.sf.debug("Successfully obtained CSRF tokens")
+ self.debug("Successfully obtained CSRF tokens")
# Otherwise, do the needful
url = "https://dnsdumpster.com/"
@@ -102,7 +102,7 @@ class sfp_dnsdumpster(SpiderFootPlugin):
useragent=self.opts.get("_useragent", "Spiderfoot")
)
if res2["code"] not in ["200"]:
- self.sf.error(f"Bad response code \"{res2['code']}\" from DNSDumpster")
+ self.error(f"Bad response code \"{res2['code']}\" from DNSDumpster")
return ret
html = BeautifulSoup(str(res2["content"]), features="lxml")
@@ -123,7 +123,7 @@ class sfp_dnsdumpster(SpiderFootPlugin):
def handleEvent(self, event):
query = str(event.data).lower()
- self.sf.debug(f"Received event, {event.eventType}, from {event.module}")
+ self.debug(f"Received event, {event.eventType}, from {event.module}")
# skip if we've already processed this event (or its parent domain/subdomain)
target = self.getTarget()
@@ -131,7 +131,7 @@ class sfp_dnsdumpster(SpiderFootPlugin):
if eventDataHash in self.results or \
(target.matches(query, includeParents=True) and not
target.matches(query, includeChildren=False)):
- self.sf.debug(f"Skipping already-processed event, {event.eventType}, from {event.module}")
+ self.debug(f"Skipping already-processed event, {event.eventType}, from {event.module}")
return
self.results[eventDataHash] = True
@@ -140,4 +140,4 @@ class sfp_dnsdumpster(SpiderFootPlugin):
target.matches(hostname, includeChildren=False):
self.sendEvent(event, hostname)
else:
- self.sf.debug(f"Invalid subdomain: {hostname}")
+ self.debug(f"Invalid subdomain: {hostname}")
diff --git a/modules/sfp_dnsgrep.py b/modules/sfp_dnsgrep.py
index a3014c65..8796a4bc 100644
--- a/modules/sfp_dnsgrep.py
+++ b/modules/sfp_dnsgrep.py
@@ -92,17 +92,17 @@ class sfp_dnsgrep(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.info("No results found for " + qry)
+ self.info("No results found for " + qry)
return None
if res['code'] != '200':
- self.sf.debug("Error retrieving search results for " + qry)
+ self.debug("Error retrieving search results for " + qry)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from DNSGrep: {e}")
+ self.error(f"Error processing JSON response from DNSGrep: {e}")
return None
@@ -116,12 +116,12 @@ class sfp_dnsgrep(SpiderFootPlugin):
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.query(eventData)
if data is None:
- self.sf.info("No DNS records found for " + eventData)
+ self.info("No DNS records found for " + eventData)
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -161,7 +161,7 @@ class sfp_dnsgrep(SpiderFootPlugin):
evt_type = "INTERNET_NAME"
if self.opts["dns_resolve"] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += "_UNRESOLVED"
evt = SpiderFootEvent(evt_type, domain, self.__name__, event)
diff --git a/modules/sfp_dnsneighbor.py b/modules/sfp_dnsneighbor.py
index 1e69465f..58696d18 100644
--- a/modules/sfp_dnsneighbor.py
+++ b/modules/sfp_dnsneighbor.py
@@ -71,7 +71,7 @@ class sfp_dnsneighbor(SpiderFootPlugin):
addrs = None
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventDataHash in self.events:
return
@@ -83,14 +83,14 @@ class sfp_dnsneighbor(SpiderFootPlugin):
netmask = address.max_prefixlen - min(address.max_prefixlen, max(1, int(self.opts.get("lookasidebits"))))
network = ipaddress.ip_network(f"{eventData}/{netmask}", strict=False)
except ValueError:
- self.sf.error(f"Invalid IP address received: {eventData}")
+ self.error(f"Invalid IP address received: {eventData}")
return
- self.sf.debug(f"Lookaside max: {network.network_address}, min: {network.broadcast_address}")
+ self.debug(f"Lookaside max: {network.network_address}, min: {network.broadcast_address}")
for ip in network:
sip = str(ip)
- self.sf.debug("Attempting look-aside lookup of: " + sip)
+ self.debug("Attempting look-aside lookup of: " + sip)
if self.checkForStop():
return
@@ -99,7 +99,7 @@ class sfp_dnsneighbor(SpiderFootPlugin):
addrs = self.sf.resolveIP(sip)
if not addrs:
- self.sf.debug("Look-aside resolve for " + sip + " failed.")
+ self.debug("Look-aside resolve for " + sip + " failed.")
continue
# Report addresses that resolve to hostnames on the same
@@ -147,11 +147,11 @@ class sfp_dnsneighbor(SpiderFootPlugin):
self.hostresults[host] = [parentHash]
else:
if parentHash in self.hostresults[host] or parentEvent.data == host:
- self.sf.debug("Skipping host, " + host + ", already processed.")
+ self.debug("Skipping host, " + host + ", already processed.")
return None
self.hostresults[host] = self.hostresults[host] + [parentHash]
- self.sf.debug("Found host: " + host)
+ self.debug("Found host: " + host)
# If the returned hostname is aliased to our
# target in some way, flag it as an affiliate
if affiliate is None:
diff --git a/modules/sfp_dnsraw.py b/modules/sfp_dnsraw.py
index fac1bfbb..0e78e895 100644
--- a/modules/sfp_dnsraw.py
+++ b/modules/sfp_dnsraw.py
@@ -72,15 +72,15 @@ class sfp_dnsraw(SpiderFootPlugin):
eventDataHash = self.sf.hashstring(eventData)
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventDataHash in self.events:
- self.sf.debug("Skipping duplicate event for " + eventData)
+ self.debug("Skipping duplicate event for " + eventData)
return
self.events[eventDataHash] = True
- self.sf.debug("Gathering DNS records for " + eventData)
+ self.debug("Gathering DNS records for " + eventData)
domains = list()
@@ -110,7 +110,7 @@ class sfp_dnsraw(SpiderFootPlugin):
if not len(res.answer):
continue
except Exception as e:
- self.sf.error(f"Failed to obtain DNS response for {eventData} ({e})")
+ self.error(f"Failed to obtain DNS response for {eventData} ({e})")
continue
# Iterate through DNS answers
@@ -124,7 +124,7 @@ class sfp_dnsraw(SpiderFootPlugin):
self.notifyListeners(evt)
for rx in list(recs.keys()):
- self.sf.debug("Checking " + str(x) + " + against " + recs[rx])
+ self.debug("Checking " + str(x) + " + against " + recs[rx])
pat = re.compile(recs[rx], re.IGNORECASE | re.DOTALL)
grps = re.findall(pat, str(x))
@@ -132,7 +132,7 @@ class sfp_dnsraw(SpiderFootPlugin):
continue
for m in grps:
- self.sf.debug("Matched: " + m)
+ self.debug("Matched: " + m)
strdata = str(m)
if rx == "CNAME":
@@ -170,7 +170,7 @@ class sfp_dnsraw(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, domain, self.__name__, parentEvent)
diff --git a/modules/sfp_dnsresolve.py b/modules/sfp_dnsresolve.py
index 3af31456..2ba1c9e0 100644
--- a/modules/sfp_dnsresolve.py
+++ b/modules/sfp_dnsresolve.py
@@ -64,13 +64,13 @@ class sfp_dnsresolve(SpiderFootPlugin):
def enrichTarget(self, target):
ret = list()
# If it's an IP, get the hostname it reverse resolves to
- self.sf.info("Identifying aliases for specified target(s)")
+ self.info("Identifying aliases for specified target(s)")
ret = self.resolveTargets(target, self.opts['validatereverse'])
if not ret:
return target
for host in ret:
- self.sf.debug("Found an alias: " + host)
+ self.debug("Found an alias: " + host)
if self.sf.validIP(host):
target.setAlias(host, "IP_ADDRESS")
elif self.sf.validIP6(host):
@@ -88,7 +88,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
# dom = self.sf.hostDomain(host, self.opts['_internettlds'])
# target.setAlias(dom, "INTERNET_NAME")
- self.sf.info(f"Target aliases identified: {target.targetAliases}")
+ self.info(f"Target aliases identified: {target.targetAliases}")
return target
@@ -124,7 +124,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
if t == "NETBLOCK_OWNER":
max_netblock = self.opts['maxnetblock']
if IPNetwork(v).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(v).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(v).prefixlen} > {max_netblock}")
return list(set(ret))
for addr in IPNetwork(v):
@@ -156,7 +156,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
if t == "NETBLOCKV6_OWNER":
max_netblock = self.opts['maxv6netblock']
if IPNetwork(v).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(v).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(v).prefixlen} > {max_netblock}")
return list(set(ret))
for addr in IPNetwork(v):
@@ -218,10 +218,10 @@ class sfp_dnsresolve(SpiderFootPlugin):
if srcModuleName in ["sfp_dnsresolve"] and "_NAME" in eventName:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventDataHash in self.events:
- self.sf.debug("Skipping duplicate event.")
+ self.debug("Skipping duplicate event.")
return
self.events[eventDataHash] = True
@@ -328,10 +328,10 @@ class sfp_dnsresolve(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
- self.sf.debug(f"Looking up IPs in owned netblock: {eventData}")
+ self.debug(f"Looking up IPs in owned netblock: {eventData}")
for ip in IPNetwork(eventData):
if self.checkForStop():
return
@@ -349,7 +349,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
if not addrs:
continue
- self.sf.debug(f"Found {len(addrs)} reversed hostnames from {ipaddr} ({addrs})")
+ self.debug(f"Found {len(addrs)} reversed hostnames from {ipaddr} ({addrs})")
for addr in addrs:
if self.checkForStop():
return
@@ -399,7 +399,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
try:
matches = re.findall(pat, chunkhost)
except Exception as e:
- self.sf.error(f"Error applying regex to data ({e})")
+ self.error(f"Error applying regex to data ({e})")
if matches:
for match in matches:
@@ -417,13 +417,13 @@ class sfp_dnsresolve(SpiderFootPlugin):
parentHash = self.sf.hashstring(parentEvent.data)
if host in self.hostresults:
if parentHash in self.hostresults[host] or parentEvent.data == host:
- self.sf.debug(f"Skipping host, {host}, already processed.")
+ self.debug(f"Skipping host, {host}, already processed.")
return
self.hostresults[host] = self.hostresults[host] + [parentHash]
else:
self.hostresults[host] = [parentHash]
- self.sf.debug(f"Found host: {host}")
+ self.debug(f"Found host: {host}")
# If the returned hostname is aliased to our
# target in some way, flag it as an affiliate
@@ -496,7 +496,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
self.hostresults[ip6] = [parentHash]
else:
if parentHash in self.hostresults[ip6] or evt.data == ip6:
- self.sf.debug(f"Skipping host, {ip6}, already processed.")
+ self.debug(f"Skipping host, {ip6}, already processed.")
continue
self.hostresults[ip6] = self.hostresults[ip6] + [parentHash]
@@ -513,7 +513,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
def processDomain(self, domainName, parentEvent, affil=False, host=None) -> None:
if domainName in self.domresults:
- self.sf.debug(f"Skipping domain, {domainName}, already processed.")
+ self.debug(f"Skipping domain, {domainName}, already processed.")
return
self.domresults[domainName] = True
diff --git a/modules/sfp_dnszonexfer.py b/modules/sfp_dnszonexfer.py
index d6269ea0..8c793fd6 100644
--- a/modules/sfp_dnszonexfer.py
+++ b/modules/sfp_dnszonexfer.py
@@ -57,14 +57,14 @@ class sfp_dnszonexfer(SpiderFootPlugin):
eventDataHash = self.sf.hashstring(eventData)
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == "sfp_dnszonexfer":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return
if eventDataHash in self.events:
- self.sf.debug("Skipping duplicate event for " + eventData)
+ self.debug("Skipping duplicate event for " + eventData)
return
self.events[eventDataHash] = True
@@ -82,7 +82,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
return
if not nsips:
- self.sf.error("Couldn't resolve the name server, so not attempting zone transfer.")
+ self.error("Couldn't resolve the name server, so not attempting zone transfer.")
return
for n in nsips:
@@ -93,7 +93,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
nsip = eventData
for name in self.getTarget().getNames():
- self.sf.debug("Trying for name: " + name)
+ self.debug("Trying for name: " + name)
try:
ret = list()
z = dns.zone.from_xfr(dns.query.xfr(nsip, name))
@@ -110,7 +110,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
grps = re.findall(pat, row)
if len(grps) > 0:
for strdata in grps:
- self.sf.debug("Matched: " + strdata)
+ self.debug("Matched: " + strdata)
if strdata.endswith("."):
strdata = strdata[:-1]
else:
@@ -120,6 +120,6 @@ class sfp_dnszonexfer(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.info(f"Unable to perform DNS zone transfer for {eventData} ({name}): {e}")
+ self.info(f"Unable to perform DNS zone transfer for {eventData} ({name}): {e}")
# End of sfp_dnszonexfer class
diff --git a/modules/sfp_dronebl.py b/modules/sfp_dronebl.py
index fd954d3f..912cc844 100644
--- a/modules/sfp_dronebl.py
+++ b/modules/sfp_dronebl.py
@@ -111,13 +111,13 @@ class sfp_dronebl(SpiderFootPlugin):
try:
lookup = self.reverseAddr(qaddr) + "." + domain
- self.sf.debug(f"Checking Blacklist: {lookup}")
+ self.debug(f"Checking Blacklist: {lookup}")
addrs = self.sf.resolveHost(lookup)
if not addrs:
continue
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
text = None
for addr in addrs:
@@ -130,7 +130,7 @@ class sfp_dronebl(SpiderFootPlugin):
text = self.checks[domain][k] + " (" + qaddr + ")"
break
- self.sf.debug("Return code not found in list: " + str(addr))
+ self.debug("Return code not found in list: " + str(addr))
if text is not None:
if eventName == "AFFILIATE_IPADDR":
@@ -146,7 +146,7 @@ class sfp_dronebl(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
# Handle events sent to this module
def handleEvent(self, event):
@@ -155,7 +155,7 @@ class sfp_dronebl(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -168,7 +168,7 @@ class sfp_dronebl(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -177,7 +177,7 @@ class sfp_dronebl(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_duckduckgo.py b/modules/sfp_duckduckgo.py
index ba1ddc7d..6c7c4fea 100644
--- a/modules/sfp_duckduckgo.py
+++ b/modules/sfp_duckduckgo.py
@@ -80,7 +80,7 @@ class sfp_duckduckgo(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -90,17 +90,17 @@ class sfp_duckduckgo(SpiderFootPlugin):
useragent="SpiderFoot")
if res['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
return
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from DuckDuckGo: {e}")
+ self.error(f"Error processing JSON response from DuckDuckGo: {e}")
return
if not ret['Heading']:
- self.sf.debug(f"No DuckDuckGo information for {eventData}")
+ self.debug(f"No DuckDuckGo information for {eventData}")
return
# Submit the DuckDuckGo results for analysis
@@ -127,13 +127,13 @@ class sfp_duckduckgo(SpiderFootPlugin):
for topic in related_topics:
if not isinstance(topic, dict):
- self.sf.debug("No category text found from DuckDuckGo.")
+ self.debug("No category text found from DuckDuckGo.")
continue
category = topic.get('Text')
if not category:
- self.sf.debug("No category text found from DuckDuckGo.")
+ self.debug("No category text found from DuckDuckGo.")
continue
evt = SpiderFootEvent(event_type, category, self.__name__, event)
diff --git a/modules/sfp_email.py b/modules/sfp_email.py
index 3e3365a5..9ae73919 100644
--- a/modules/sfp_email.py
+++ b/modules/sfp_email.py
@@ -54,7 +54,7 @@ class sfp_email(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
emails = self.sf.parseEmails(eventData)
for email in set(emails):
@@ -64,11 +64,11 @@ class sfp_email(SpiderFootPlugin):
# Get the domain and strip potential ending .
mailDom = email.split('@')[1].strip('.')
if not self.sf.validHost(mailDom, self.opts['_internettlds']):
- self.sf.debug(f"Skipping {email} as not a valid e-mail.")
+ self.debug(f"Skipping {email} as not a valid e-mail.")
continue
if not self.getTarget().matches(mailDom, includeChildren=True, includeParents=True) and not self.getTarget().matches(email):
- self.sf.debug("External domain, so possible affiliate e-mail")
+ self.debug("External domain, so possible affiliate e-mail")
evttype = "AFFILIATE_EMAILADDR"
if eventName.startswith("AFFILIATE_"):
@@ -77,7 +77,7 @@ class sfp_email(SpiderFootPlugin):
if not evttype.startswith("AFFILIATE_") and email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
- self.sf.info(f"Found e-mail address: {email}")
+ self.info(f"Found e-mail address: {email}")
mail = email.strip('.')
evt = SpiderFootEvent(evttype, mail, self.__name__, event)
diff --git a/modules/sfp_emailcrawlr.py b/modules/sfp_emailcrawlr.py
index b6054ec4..6a85fcf7 100644
--- a/modules/sfp_emailcrawlr.py
+++ b/modules/sfp_emailcrawlr.py
@@ -108,27 +108,27 @@ class sfp_emailcrawlr(SpiderFootPlugin):
# Parse API response
def parseAPIResponse(self, res):
if res['code'] == '404':
- self.sf.debug("No results for query")
+ self.debug("No results for query")
return None
if res['code'] == "401":
- self.sf.error("Invalid EmailCrawlr API key.")
+ self.error("Invalid EmailCrawlr API key.")
self.errorState = True
return None
if res['code'] == '429':
- self.sf.error("You are being rate-limited by EmailCrawlr")
+ self.error("You are being rate-limited by EmailCrawlr")
self.errorState = True
return None
if res['code'] == '503':
- self.sf.error("EmailCrawlr service unavailable")
+ self.error("EmailCrawlr service unavailable")
self.errorState = True
return None
# Catch all other non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from EmailCrawlr")
+ self.error("Failed to retrieve content from EmailCrawlr")
self.errorState = True
return None
@@ -138,7 +138,7 @@ class sfp_emailcrawlr(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -155,19 +155,19 @@ class sfp_emailcrawlr(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_emailcrawlr but did not set an API key!")
+ self.error("You enabled sfp_emailcrawlr but did not set an API key!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName in ["DOMAIN_NAME"]:
data = self.queryDomain(eventData)
if data is None:
- self.sf.debug(f"No information found for domain {eventData}")
+ self.debug(f"No information found for domain {eventData}")
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -176,7 +176,7 @@ class sfp_emailcrawlr(SpiderFootPlugin):
emails = data.get("emails")
if not emails:
- self.sf.info(f"No emails found for domain {eventData}")
+ self.info(f"No emails found for domain {eventData}")
return
for res in emails:
diff --git a/modules/sfp_emailformat.py b/modules/sfp_emailformat.py
index cfd0d94a..64758355 100644
--- a/modules/sfp_emailformat.py
+++ b/modules/sfp_emailformat.py
@@ -71,7 +71,7 @@ class sfp_emailformat(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Get e-mail addresses on this domain
res = self.sf.fetchUrl(f"https://www.email-format.com/d/{eventData}/", timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
@@ -95,15 +95,15 @@ class sfp_emailformat(SpiderFootPlugin):
# Skip unrelated emails
mailDom = email.lower().split('@')[1]
if not self.getTarget().matches(mailDom):
- self.sf.debug(f"Skipped address: {email}")
+ self.debug(f"Skipped address: {email}")
continue
# Skip masked emails
if re.match(r"^[0-9a-f]{8}\.[0-9]{7}@", email):
- self.sf.debug(f"Skipped address: {email}")
+ self.debug(f"Skipped address: {email}")
continue
- self.sf.info(f"Found e-mail address: {email}")
+ self.info(f"Found e-mail address: {email}")
if email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
else:
diff --git a/modules/sfp_emailrep.py b/modules/sfp_emailrep.py
index 5600a362..803494b6 100644
--- a/modules/sfp_emailrep.py
+++ b/modules/sfp_emailrep.py
@@ -93,29 +93,29 @@ class sfp_emailrep(SpiderFootPlugin):
return None
if res['code'] == '400':
- self.sf.error('API error: Bad request')
+ self.error('API error: Bad request')
self.errorState = True
return None
if res['code'] == '401':
- self.sf.error('API error: Invalid API key')
+ self.error('API error: Invalid API key')
self.errorState = True
return None
if res['code'] == '429':
- self.sf.error('API error: Too Many Requests')
+ self.error('API error: Too Many Requests')
self.errorState = True
return None
if res['code'] != '200':
- self.sf.error('Unexpected reply from EmailRep.io: ' + res['code'])
+ self.error('Unexpected reply from EmailRep.io: ' + res['code'])
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -129,10 +129,10 @@ class sfp_emailrep(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == '':
- self.sf.error("Warning: You enabled sfp_emailrep but did not set an API key! Queries will be rate limited.")
+ self.error("Warning: You enabled sfp_emailrep but did not set an API key! Queries will be rate limited.")
res = self.query(eventData)
diff --git a/modules/sfp_emergingthreats.py b/modules/sfp_emergingthreats.py
index 048715b9..0d743f81 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(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.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(f"{ip} found within netblock/subnet {qry} in emergingthreats.net list.")
+ self.debug(f"{ip} found within netblock/subnet {qry} in emergingthreats.net list.")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug(f"{qry} found in emergingthreats.net list.")
+ self.debug(f"{qry} found in emergingthreats.net list.")
return url
return None
@@ -124,10 +124,10 @@ class sfp_emergingthreats(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -156,7 +156,7 @@ class sfp_emergingthreats(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} with emergingthreats.net")
+ self.debug(f"Checking maliciousness of {eventData} with emergingthreats.net")
url = self.query(eventData, targetType)
diff --git a/modules/sfp_errors.py b/modules/sfp_errors.py
index cc3fa915..4aae1c45 100644
--- a/modules/sfp_errors.py
+++ b/modules/sfp_errors.py
@@ -81,14 +81,14 @@ class sfp_errors(SpiderFootPlugin):
eventSource = event.actualSource
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventSource not in list(self.results.keys()):
self.results[eventSource] = list()
# We only want web content for pages on the target site
if not self.getTarget().matches(self.sf.urlFQDN(eventSource)):
- self.sf.debug("Not collecting web content information for external sites.")
+ self.debug("Not collecting web content information for external sites.")
return
for regexpGrp in list(regexps.keys()):
@@ -99,7 +99,7 @@ class sfp_errors(SpiderFootPlugin):
pat = re.compile(regex, re.IGNORECASE)
matches = re.findall(pat, eventData)
if len(matches) > 0 and regexpGrp not in self.results[eventSource]:
- self.sf.info("Matched " + regexpGrp + " in content from " + eventSource)
+ self.info("Matched " + regexpGrp + " in content from " + eventSource)
self.results[eventSource] = self.results[eventSource] + [regexpGrp]
evt = SpiderFootEvent("ERROR_MESSAGE", regexpGrp,
self.__name__, event)
diff --git a/modules/sfp_ethereum.py b/modules/sfp_ethereum.py
index 66fc628f..283fe40b 100644
--- a/modules/sfp_ethereum.py
+++ b/modules/sfp_ethereum.py
@@ -61,12 +61,12 @@ class sfp_ethereum(SpiderFootPlugin):
self.results[sourceData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# thanks to https://stackoverflow.com/questions/21683680/regex-to-match-ethereum-addresses
matches = re.findall(r"[\s:=\>](0x[a-fA-F0-9]{40})", eventData)
for m in matches:
- self.sf.debug("Ethereum address match: " + m)
+ self.debug("Ethereum address match: " + m)
evt = SpiderFootEvent("ETHEREUM_ADDRESS", m, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_etherscan.py b/modules/sfp_etherscan.py
index 3eeb225c..cc854c96 100644
--- a/modules/sfp_etherscan.py
+++ b/modules/sfp_etherscan.py
@@ -91,13 +91,13 @@ class sfp_etherscan(SpiderFootPlugin):
time.sleep(self.opts['pause'])
if res['content'] is None:
- self.sf.info(f"No Etherscan data found for {qry}")
+ self.info(f"No Etherscan data found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -107,25 +107,25 @@ class sfp_etherscan(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_etherscan but did not set an API key!")
+ self.error("You enabled sfp_etherscan but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
data = self.query(eventData)
if data is None:
- self.sf.info(f"No Etherscan data found for {eventData}")
+ self.info(f"No Etherscan data found for {eventData}")
return
# Value returned by etherscan was too large in comparison to actual wallet balance
diff --git a/modules/sfp_filemeta.py b/modules/sfp_filemeta.py
index 4a634c68..a54e3678 100644
--- a/modules/sfp_filemeta.py
+++ b/modules/sfp_filemeta.py
@@ -73,7 +73,7 @@ class sfp_filemeta(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -92,11 +92,11 @@ class sfp_filemeta(SpiderFootPlugin):
sizeLimit=10000000,
verify=False)
if ret['content'] is None:
- self.sf.error(f"Unable to fetch file for meta analysis: {eventData}")
+ self.error(f"Unable to fetch file for meta analysis: {eventData}")
return
if len(ret['content']) < 512:
- self.sf.error(f"Strange content encountered, size of {len(ret['content'])}")
+ self.error(f"Strange content encountered, size of {len(ret['content'])}")
return
meta = None
@@ -109,9 +109,9 @@ class sfp_filemeta(SpiderFootPlugin):
pdf = PyPDF2.PdfFileReader(raw, strict=False)
data = pdf.getDocumentInfo()
meta = str(data)
- self.sf.debug("Obtained meta data from " + eventData)
+ self.debug("Obtained meta data from " + eventData)
except Exception as e:
- self.sf.error(f"Unable to parse meta data from: {eventData} ({e})")
+ self.error(f"Unable to parse meta data from: {eventData} ({e})")
return
if fileExt.lower() in ["docx"]:
@@ -119,13 +119,13 @@ class sfp_filemeta(SpiderFootPlugin):
c = io.BytesIO(ret['content'])
doc = docx.Document(c)
mtype = mimetypes.guess_type(eventData)[0]
- self.sf.debug("Office type: " + str(mtype))
+ self.debug("Office type: " + str(mtype))
a = doc.core_properties.author
c = doc.core_properties.comments
data = [_f for _f in [a, c] if _f]
meta = ", ".join(data)
except Exception as e:
- self.sf.error(f"Unable to process file: {eventData} ({e})")
+ self.error(f"Unable to process file: {eventData} ({e})")
return
if fileExt.lower() in ["pptx"]:
@@ -133,13 +133,13 @@ class sfp_filemeta(SpiderFootPlugin):
c = io.BytesIO(ret['content'])
doc = pptx.Presentation(c)
mtype = mimetypes.guess_type(eventData)[0]
- self.sf.debug("Office type: " + str(mtype))
+ self.debug("Office type: " + str(mtype))
a = doc.core_properties.author
c = doc.core_properties.comments
data = [_f for _f in [a, c] if _f]
meta = ", ".join(data)
except Exception as e:
- self.sf.error(f"Unable to process file: {eventData} ({e})")
+ self.error(f"Unable to process file: {eventData} ({e})")
return
if fileExt.lower() in ["jpg", "jpeg", "tiff"]:
@@ -150,7 +150,7 @@ class sfp_filemeta(SpiderFootPlugin):
continue
meta = str(data)
except Exception as e:
- self.sf.error(f"Unable to parse meta data from: {eventData} ({e})")
+ self.error(f"Unable to parse meta data from: {eventData} ({e})")
return
if meta is not None and data is not None:
@@ -172,12 +172,12 @@ class sfp_filemeta(SpiderFootPlugin):
if "Image Software" in data:
val.append(str(data['Image Software']))
except Exception as e:
- self.sf.error("Failed to parse PDF, " + eventData + ": " + str(e))
+ self.error("Failed to parse PDF, " + eventData + ": " + str(e))
return
for v in val:
if v and not isinstance(v, PyPDF2.generic.NullObject):
- self.sf.debug("VAL: " + str(val))
+ self.debug("VAL: " + str(val))
# Strip non-ASCII
v = ''.join([i if ord(i) < 128 else ' ' for i in v])
evt = SpiderFootEvent("SOFTWARE_USED", v, self.__name__, event)
diff --git a/modules/sfp_flickr.py b/modules/sfp_flickr.py
index cd541c84..d2a8b2ba 100644
--- a/modules/sfp_flickr.py
+++ b/modules/sfp_flickr.py
@@ -129,7 +129,7 @@ class sfp_flickr(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -140,25 +140,25 @@ class sfp_flickr(SpiderFootPlugin):
eventData = event.data
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked")
+ self.debug(f"Skipping {eventData}, already checked")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == 'sfp_flickr':
- self.sf.debug(f"Ignoring {eventData}, from self.")
+ self.debug(f"Ignoring {eventData}, from self.")
return
# Retrieve API key
api_key = self.retrieveApiKey()
if not api_key:
- self.sf.error("Failed to obtain API key")
+ self.error("Failed to obtain API key")
return
- self.sf.debug(f"Retrieved API key: {api_key}")
+ self.debug(f"Retrieved API key: {api_key}")
# Query API for event data
hosts = list()
@@ -179,13 +179,13 @@ class sfp_flickr(SpiderFootPlugin):
# Check the response is ok
if data.get('stat') != "ok":
- self.sf.debug("Error retrieving search results.")
+ self.debug("Error retrieving search results.")
return
photos = data.get('photos')
if not photos:
- self.sf.debug("No search results.")
+ self.debug("No search results.")
return
# Calculate number of pages to retrieve
@@ -199,7 +199,7 @@ class sfp_flickr(SpiderFootPlugin):
if pages > allowed_pages:
pages = allowed_pages
- self.sf.info(f"Parsing page {page} of {pages}")
+ self.info(f"Parsing page {page} of {pages}")
# Extract data
for photo in photos.get('photo', list()):
@@ -211,10 +211,10 @@ class sfp_flickr(SpiderFootPlugin):
mail_domain = email.lower().split('@')[1]
if not self.getTarget().matches(mail_domain, includeChildren=True, includeParents=True):
- self.sf.debug(f"Skipped unrelated address: {email}")
+ self.debug(f"Skipped unrelated address: {email}")
continue
- self.sf.info("Found e-mail address: " + email)
+ self.info("Found e-mail address: " + email)
if email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
else:
@@ -232,12 +232,12 @@ class sfp_flickr(SpiderFootPlugin):
host = self.sf.urlFQDN(link)
if not self.getTarget().matches(host, includeChildren=True, includeParents=True):
- self.sf.debug(f"Skipped unrelated URL: {link}")
+ self.debug(f"Skipped unrelated URL: {link}")
continue
hosts.append(host)
- self.sf.debug(f"Found a URL: {link}")
+ self.debug(f"Found a URL: {link}")
evt = SpiderFootEvent('LINKED_URL_INTERNAL', link, self.__name__, event)
self.notifyListeners(evt)
self.results[link] = True
@@ -252,7 +252,7 @@ class sfp_flickr(SpiderFootPlugin):
return
if self.opts['dns_resolve'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", host, self.__name__, event)
self.notifyListeners(evt)
continue
diff --git a/modules/sfp_fortinet.py b/modules/sfp_fortinet.py
index 684f6f39..cfc54204 100644
--- a/modules/sfp_fortinet.py
+++ b/modules/sfp_fortinet.py
@@ -73,12 +73,12 @@ class sfp_fortinet(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from FortiGuard Antispam.")
+ self.error(f"Unexpected HTTP response code {res['code']} from FortiGuard Antispam.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from FortiGuard Antispam")
+ self.error("Received no content from FortiGuard Antispam")
self.errorState = True
return None
@@ -90,10 +90,10 @@ class sfp_fortinet(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
diff --git a/modules/sfp_fraudguard.py b/modules/sfp_fraudguard.py
index 712ca864..f2db3279 100644
--- a/modules/sfp_fraudguard.py
+++ b/modules/sfp_fraudguard.py
@@ -110,18 +110,18 @@ class sfp_fraudguard(SpiderFootPlugin):
useragent="SpiderFoot", headers=headers)
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("Fraudguard.io API key seems to have been rejected or you have exceeded usage limits for the month.")
+ self.error("Fraudguard.io API key seems to have been rejected or you have exceeded usage limits for the month.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No Fraudguard.io info found for " + qry)
+ self.info("No Fraudguard.io info found for " + qry)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Fraudguard.io: {e}")
+ self.error(f"Error processing JSON response from Fraudguard.io: {e}")
return None
@@ -134,16 +134,16 @@ class sfp_fraudguard(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['fraudguard_api_key_account'] == "" or self.opts['fraudguard_api_key_password'] == "":
- self.sf.error("You enabled sfp_fraudguard but did not set an API username/password!")
+ self.error("You enabled sfp_fraudguard but did not set an API username/password!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -152,9 +152,9 @@ class sfp_fraudguard(SpiderFootPlugin):
if not self.opts['netblocklookup']:
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
qrylist = list()
@@ -174,13 +174,13 @@ class sfp_fraudguard(SpiderFootPlugin):
rec = self.query(addr)
if rec is not None:
- self.sf.debug("Found results in Fraudguard.io")
+ self.debug("Found results in Fraudguard.io")
# 2016-12-24T07:25:35+00:00'
created_dt = datetime.strptime(rec.get('discover_date'), '%Y-%m-%d %H:%M:%S')
created_ts = int(time.mktime(created_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_dt}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
# For netblocks, we need to create the IP address event so that
diff --git a/modules/sfp_fsecure_riddler.py b/modules/sfp_fsecure_riddler.py
index 08bb93d2..5b617bea 100644
--- a/modules/sfp_fsecure_riddler.py
+++ b/modules/sfp_fsecure_riddler.py
@@ -102,18 +102,18 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from F-Secure Riddler: {e}")
+ self.debug(f"Error processing JSON response from F-Secure Riddler: {e}")
return
try:
token = data.get('response').get('user').get('authentication_token')
except Exception:
- self.sf.error('Login failed')
+ self.error('Login failed')
self.errorState = True
return
if not token:
- self.sf.error('Login failed')
+ self.error('Login failed')
self.errorState = True
return
@@ -138,7 +138,7 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
time.sleep(1)
if res['code'] in ["400", "401", "402", "403"]:
- self.sf.error('Unexpected HTTP response code: ' + res['code'])
+ self.error('Unexpected HTTP response code: ' + res['code'])
self.errorState = True
return None
@@ -148,11 +148,11 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from F-Secure Riddler: {e}")
+ self.debug(f"Error processing JSON response from F-Secure Riddler: {e}")
return None
if not data:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
return data
@@ -165,18 +165,18 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == 'sfp_fsecure_riddler':
- self.sf.debug("Ignoring " + eventData + ", from self.")
+ self.debug("Ignoring " + eventData + ", from self.")
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.opts['username'] == '' or self.opts['password'] == '':
- self.sf.error('You enabled sfp_fsecure_riddler but did not set an API username/password!')
+ self.error('You enabled sfp_fsecure_riddler but did not set an API username/password!')
self.errorState = True
return
@@ -193,7 +193,7 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
data = self.query("ip:" + eventData)
if not data:
- self.sf.info("No results found for " + eventData)
+ self.info("No results found for " + eventData)
return
e = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -225,7 +225,7 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
coords.append(str(coord[0]) + ', ' + str(coord[1]))
if self.opts['verify'] and len(hosts) > 0:
- self.sf.info("Resolving " + str(len(set(hosts))) + " domains ...")
+ self.info("Resolving " + str(len(set(hosts))) + " domains ...")
for host in set(hosts):
if self.getTarget().matches(host, includeChildren=True, includeParents=True):
@@ -234,7 +234,7 @@ class sfp_fsecure_riddler(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, host, self.__name__, event)
diff --git a/modules/sfp_fullcontact.py b/modules/sfp_fullcontact.py
index cc68ebed..8246b627 100644
--- a/modules/sfp_fullcontact.py
+++ b/modules/sfp_fullcontact.py
@@ -101,13 +101,13 @@ class sfp_fullcontact(SpiderFootPlugin):
)
if res['code'] in ["401", "400"]:
- self.sf.error("API key rejected by FullContact")
+ self.error("API key rejected by FullContact")
self.errorState = True
return None
if res['code'] == "403":
if failcount == 3:
- self.sf.error("Throttled or other blocking by FullContact")
+ self.error("Throttled or other blocking by FullContact")
return None
time.sleep(2)
@@ -115,13 +115,13 @@ class sfp_fullcontact(SpiderFootPlugin):
return self.query(url, data, failcount)
if not res['content']:
- self.sf.error("No content returned from FullContact")
+ self.error("No content returned from FullContact")
return None
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from FullContact: {e}")
+ self.error(f"Error processing JSON response from FullContact: {e}")
return None
if "updated" in ret and int(self.opts['max_age_days']) > 0:
@@ -130,7 +130,7 @@ class sfp_fullcontact(SpiderFootPlugin):
age_limit_ts = int(time.time()) - (86400 * int(self.opts['max_age_days']))
if last_ts < age_limit_ts:
- self.sf.debug("FullContact record found but too old.")
+ self.debug("FullContact record found but too old.")
return None
return ret
@@ -168,16 +168,16 @@ class sfp_fullcontact(SpiderFootPlugin):
return
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_github.py b/modules/sfp_github.py
index 746e2e3a..5abfb1e8 100644
--- a/modules/sfp_github.py
+++ b/modules/sfp_github.py
@@ -69,17 +69,17 @@ class sfp_github(SpiderFootPlugin):
# Get repos matching the name
name = item.get('name')
if name is None:
- self.sf.debug("Incomplete Github information found (name).")
+ self.debug("Incomplete Github information found (name).")
return None
html_url = item.get('html_url')
if html_url is None:
- self.sf.debug("Incomplete Github information found (url).")
+ self.debug("Incomplete Github information found (url).")
return None
description = item.get('description')
if description is None:
- self.sf.debug("Incomplete Github information found (description).")
+ self.debug("Incomplete Github information found (description).")
return None
return "\n".join([f"Name: {name}", f"URL: {html_url}", f"Description: {description}"])
@@ -89,10 +89,10 @@ class sfp_github(SpiderFootPlugin):
eventData = event.data
srcModuleName = event.module
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Already did a search for {eventData}, skipping.")
+ self.debug(f"Already did a search for {eventData}, skipping.")
return
self.results[eventData] = True
@@ -103,18 +103,18 @@ class sfp_github(SpiderFootPlugin):
network = eventData.split(": ")[0]
url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")
except Exception as e:
- self.sf.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
+ self.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
return
if network != "Github":
- self.sf.debug(f"Skipping social network profile, {url}, as not a GitHub profile")
+ self.debug(f"Skipping social network profile, {url}, as not a GitHub profile")
return
try:
urlParts = url.split("/")
username = urlParts[len(urlParts) - 1]
except Exception:
- self.sf.debug(f"Couldn't get a username out of {url}")
+ self.debug(f"Couldn't get a username out of {url}")
return
res = self.sf.fetchUrl(
@@ -129,17 +129,17 @@ class sfp_github(SpiderFootPlugin):
try:
json_data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return
if not json_data.get('login'):
- self.sf.debug(f"{username} is not a valid GitHub profile")
+ self.debug(f"{username} is not a valid GitHub profile")
return
full_name = json_data.get('name')
if not full_name:
- self.sf.debug(f"{username} is not a valid GitHub profile")
+ self.debug(f"{username} is not a valid GitHub profile")
return
e = SpiderFootEvent("RAW_RIR_DATA", f"Possible full name: {full_name}", self.__name__, event)
@@ -151,7 +151,7 @@ class sfp_github(SpiderFootPlugin):
return
if len(location) < 3 or len(location) > 100:
- self.sf.debug(f"Skipping likely invalid location: {location}")
+ self.debug(f"Skipping likely invalid location: {location}")
return
e = SpiderFootEvent("GEOINFO", location, self.__name__, event)
@@ -167,7 +167,7 @@ class sfp_github(SpiderFootPlugin):
if eventName == "USERNAME":
username = eventData
- self.sf.debug(f"Looking at {username}")
+ self.debug(f"Looking at {username}")
failed = False
# Get all the repositories based on direct matches with the
@@ -180,23 +180,23 @@ class sfp_github(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
failed = True
if not failed:
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from GitHub: {e}")
+ self.debug(f"Error processing JSON response from GitHub: {e}")
ret = None
if ret is None:
- self.sf.error(f"Unable to process empty response from Github for: {username}")
+ self.error(f"Unable to process empty response from Github for: {username}")
failed = True
if not failed:
if ret.get('total_count', "0") == "0" or len(ret['items']) == 0:
- self.sf.debug(f"No Github information for {username}")
+ self.debug(f"No Github information for {username}")
failed = True
if not failed:
@@ -219,29 +219,29 @@ class sfp_github(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
failed = True
if not failed:
try:
ret = json.loads(res['content'])
if ret is None:
- self.sf.error(f"Unable to process empty response from Github for: {username}")
+ self.error(f"Unable to process empty response from Github for: {username}")
failed = True
except Exception:
- self.sf.error(f"Unable to process invalid response from Github for: {username}")
+ self.error(f"Unable to process invalid response from Github for: {username}")
failed = True
if not failed:
if ret.get('total_count', "0") == "0" or len(ret['items']) == 0:
- self.sf.debug("No Github information for " + username)
+ self.debug("No Github information for " + username)
failed = True
if not failed:
# For each user matching the username, get their repos
for item in ret['items']:
if item.get('repos_url') is None:
- self.sf.debug("Incomplete Github information found (repos_url).")
+ self.debug("Incomplete Github information found (repos_url).")
continue
url = item['repos_url']
@@ -249,22 +249,22 @@ class sfp_github(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
continue
try:
repret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Invalid JSON returned from Github: {e}")
+ self.error(f"Invalid JSON returned from Github: {e}")
continue
if repret is None:
- self.sf.error(f"Unable to process empty response from Github for: {username}")
+ self.error(f"Unable to process empty response from Github for: {username}")
continue
for item in repret:
if type(item) != dict:
- self.sf.debug("Encountered an unexpected or empty response from Github.")
+ self.debug("Encountered an unexpected or empty response from Github.")
continue
repo_info = self.buildRepoInfo(item)
diff --git a/modules/sfp_gleif.py b/modules/sfp_gleif.py
index 746d96fa..8eac023f 100644
--- a/modules/sfp_gleif.py
+++ b/modules/sfp_gleif.py
@@ -87,13 +87,13 @@ class sfp_gleif(SpiderFootPlugin):
)
if res['code'] == "429":
- self.sf.error("You are being rate-limited by GLEIF.")
+ self.error("You are being rate-limited by GLEIF.")
return None
try:
results = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
data = results.get('data')
@@ -131,13 +131,13 @@ class sfp_gleif(SpiderFootPlugin):
)
if res['code'] == "429":
- self.sf.error("You are being rate-limited by GLEIF.")
+ self.error("You are being rate-limited by GLEIF.")
return None
try:
results = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
data = results.get('data')
@@ -161,17 +161,17 @@ class sfp_gleif(SpiderFootPlugin):
)
if res['code'] == "404":
- self.sf.error(f"No record for LEI: {lei}")
+ self.error(f"No record for LEI: {lei}")
return None
if res['code'] == "429":
- self.sf.error("You are being rate-limited by GLEIF.")
+ self.error("You are being rate-limited by GLEIF.")
return None
try:
results = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
data = results.get('data')
@@ -189,12 +189,12 @@ class sfp_gleif(SpiderFootPlugin):
eventData = event.data
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
leis = list()
@@ -204,7 +204,7 @@ class sfp_gleif(SpiderFootPlugin):
res = self.searchAutocompletions(eventData)
if res is None:
- self.sf.debug(f"Found no results for {eventData}")
+ self.debug(f"Found no results for {eventData}")
return
e = SpiderFootEvent("RAW_RIR_DATA", str(res), self.__name__, event)
@@ -229,7 +229,7 @@ class sfp_gleif(SpiderFootPlugin):
leis.append(lei)
- self.sf.info(f"Found {len(leis)} LEIs matching {eventData}")
+ self.info(f"Found {len(leis)} LEIs matching {eventData}")
for lei in set(leis):
if lei in self.results:
@@ -245,7 +245,7 @@ class sfp_gleif(SpiderFootPlugin):
res = self.retrieveRecord(lei)
if not res:
- self.sf.debug(f"Found no results for {eventData}")
+ self.debug(f"Found no results for {eventData}")
return
attributes = res.get('attributes')
diff --git a/modules/sfp_googlemaps.py b/modules/sfp_googlemaps.py
index 36c218df..9e7a0e7d 100644
--- a/modules/sfp_googlemaps.py
+++ b/modules/sfp_googlemaps.py
@@ -86,7 +86,7 @@ class sfp_googlemaps(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.info(f"No location info found for {address}")
+ self.info(f"No location info found for {address}")
return None
return res
@@ -100,15 +100,15 @@ class sfp_googlemaps(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
@@ -117,7 +117,7 @@ class sfp_googlemaps(SpiderFootPlugin):
res = self.query(eventData)
if not res:
- self.sf.debug(f"No information found for {eventData}")
+ self.debug(f"No information found for {eventData}")
return
evt = SpiderFootEvent(
@@ -131,7 +131,7 @@ class sfp_googlemaps(SpiderFootPlugin):
try:
data = json.loads(res['content'])['results'][0]
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return
if srcModuleName == "sfp_googlemaps":
diff --git a/modules/sfp_googleobjectstorage.py b/modules/sfp_googleobjectstorage.py
index d7c84041..a90bfed1 100644
--- a/modules/sfp_googleobjectstorage.py
+++ b/modules/sfp_googleobjectstorage.py
@@ -74,7 +74,7 @@ class sfp_googleobjectstorage(SpiderFootPlugin):
return
if "NoSuchBucket" in res['content']:
- self.sf.debug(f"Not a valid bucket: {url}")
+ self.debug(f"Not a valid bucket: {url}")
return
# Bucket found
@@ -98,7 +98,7 @@ class sfp_googleobjectstorage(SpiderFootPlugin):
if self.checkForStop():
return None
- self.sf.info("Spawning thread to check bucket: " + site)
+ self.info("Spawning thread to check bucket: " + site)
tname = str(random.SystemRandom().randint(0, 999999999))
t.append(threading.Thread(name='thread_sfp_googleobjectstorage_' + tname,
target=self.checkSite, args=(site,)))
@@ -154,7 +154,7 @@ class sfp_googleobjectstorage(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "LINKED_URL_EXTERNAL":
if ".storage.googleapis.com" in eventData:
diff --git a/modules/sfp_googlesafebrowsing.py b/modules/sfp_googlesafebrowsing.py
index da1f853c..e8b6e0ab 100644
--- a/modules/sfp_googlesafebrowsing.py
+++ b/modules/sfp_googlesafebrowsing.py
@@ -130,24 +130,24 @@ class sfp_googlesafebrowsing(SpiderFootPlugin):
)
if res["code"] == "400":
- self.sf.error("Invalid request payload on Google Safe Browsing API")
+ self.error("Invalid request payload on Google Safe Browsing API")
self.errorState = True
return None
if res["code"] == "429":
- self.sf.error("Reaching rate limit on Google Safe Browsing API")
+ self.error("Reaching rate limit on Google Safe Browsing API")
self.errorState = True
return None
if res["code"] == "403":
- self.sf.error(
+ self.error(
"Permission denied, invalid API key on Google Safe Browsing API"
)
self.errorState = True
return None
if res["code"] in ["500", "503", "504"]:
- self.sf.error(
+ self.error(
"Google Safe Browsing API is having some troubles or unavailable."
)
self.errorState = True
@@ -156,11 +156,11 @@ class sfp_googlesafebrowsing(SpiderFootPlugin):
try:
info = json.loads(res["content"])
if info == {}:
- self.sf.info("No Google Safe Browsing matches found for " + qry)
+ self.info("No Google Safe Browsing matches found for " + qry)
return None
except Exception as e:
- self.sf.error(f"Error processing JSON response from SHODAN: {e}")
+ self.error(f"Error processing JSON response from SHODAN: {e}")
return None
return info
@@ -173,17 +173,17 @@ class sfp_googlesafebrowsing(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
"You enabled sfp_googlesafebrowsing but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_googlesearch.py b/modules/sfp_googlesearch.py
index 6441ad30..9a8d6cd5 100644
--- a/modules/sfp_googlesearch.py
+++ b/modules/sfp_googlesearch.py
@@ -87,15 +87,15 @@ class sfp_googlesearch(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_googlesearch but did not set a Google API key!")
+ self.error("You enabled sfp_googlesearch but did not set a Google API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug("Already did a search for " + eventData + ", skipping.")
+ self.debug("Already did a search for " + eventData + ", skipping.")
return
self.results[eventData] = True
@@ -125,7 +125,7 @@ class sfp_googlesearch(SpiderFootPlugin):
link for link in new_links if self.sf.urlFQDN(link).endswith(eventData)
]
for link in internal_links:
- self.sf.debug("Found a link: " + link)
+ self.debug("Found a link: " + link)
evt = SpiderFootEvent("LINKED_URL_INTERNAL", link, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_gravatar.py b/modules/sfp_gravatar.py
index fb91b6f2..bd176b49 100644
--- a/modules/sfp_gravatar.py
+++ b/modules/sfp_gravatar.py
@@ -84,7 +84,7 @@ class sfp_gravatar(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.debug('No response from gravatar.com')
+ self.debug('No response from gravatar.com')
return None
if res['code'] != '200':
@@ -93,7 +93,7 @@ class sfp_gravatar(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if data.get('entry') is None or len(data.get('entry')) == 0:
@@ -112,12 +112,12 @@ class sfp_gravatar(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.query(eventData)
if data is None:
- self.sf.debug("No user information found for " + eventData)
+ self.debug("No user information found for " + eventData)
return
evt = SpiderFootEvent("RAW_RIR_DATA", str(data), self.__name__, event)
@@ -147,7 +147,7 @@ class sfp_gravatar(SpiderFootPlugin):
# if data.get('currentLocation') is not None:
# location = data.get('currentLocation')
# if len(location) < 3 or len(location) > 100:
- # self.sf.debug("Skipping likely invalid location.")
+ # self.debug("Skipping likely invalid location.")
# else:
# evt = SpiderFootEvent("GEOINFO", location, self.__name__, event)
# self.notifyListeners(evt)
diff --git a/modules/sfp_grayhatwarfare.py b/modules/sfp_grayhatwarfare.py
index 575f355e..18327f70 100644
--- a/modules/sfp_grayhatwarfare.py
+++ b/modules/sfp_grayhatwarfare.py
@@ -106,18 +106,18 @@ class sfp_grayhatwarfare(SpiderFootPlugin):
time.sleep(self.opts['pause'])
if res['code'] != "200":
- self.sf.error("Unable to fetch data from Grayhat Warfare API.")
+ self.error("Unable to fetch data from Grayhat Warfare API.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.debug('No response from Grayhat Warfare API.')
+ self.debug('No response from Grayhat Warfare API.')
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
# Handle events sent to this module
@@ -134,10 +134,10 @@ class sfp_grayhatwarfare(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_grayhatwarfare but did not set an API key!")
+ self.error("You enabled sfp_grayhatwarfare but did not set an API key!")
self.errorState = True
return
@@ -164,7 +164,7 @@ class sfp_grayhatwarfare(SpiderFootPlugin):
for row in data.get('buckets'):
bucketName = row.get('bucket')
bucketKeyword = bucketName.split('.')[0]
- self.sf.debug(bucketKeyword)
+ self.debug(bucketKeyword)
if bucketKeyword.startswith(keyword) or bucketKeyword.endswith(keyword):
evt = SpiderFootEvent('CLOUD_STORAGE_BUCKET', bucketName, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_greensnow.py b/modules/sfp_greensnow.py
index 5d7aa200..ac993333 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(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return None
if data["content"] is None:
- self.sf.error(f"Unable to fetch {url}")
+ self.error(f"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(f"{ip} found within netblock/subnet {qry} in greensnow.co list.")
+ self.debug(f"{ip} found within netblock/subnet {qry} in greensnow.co list.")
return url
except Exception as e:
- self.sf.debug(f"Error encountered parsing: {e}")
+ self.debug(f"Error encountered parsing: {e}")
continue
if targetType == "ip":
if qry.lower() == ip:
- self.sf.debug(f"{qry} found in greensnow.co list.")
+ self.debug(f"{qry} found in greensnow.co list.")
return url
return None
@@ -123,10 +123,10 @@ class sfp_greensnow(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -155,7 +155,7 @@ class sfp_greensnow(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} with greensnow.co")
+ self.debug(f"Checking maliciousness of {eventData} with greensnow.co")
url = self.query(eventData, targetType)
diff --git a/modules/sfp_grep_app.py b/modules/sfp_grep_app.py
index 601bb4f8..e6e9b2eb 100644
--- a/modules/sfp_grep_app.py
+++ b/modules/sfp_grep_app.py
@@ -90,7 +90,7 @@ class sfp_grep_app(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -104,10 +104,10 @@ class sfp_grep_app(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == 'sfp_grep_app':
- self.sf.debug("Ignoring " + eventData + ", from self.")
+ self.debug("Ignoring " + eventData + ", from self.")
return
hosts = list()
@@ -144,7 +144,7 @@ class sfp_grep_app(SpiderFootPlugin):
if last_page < pages:
pages = last_page
- self.sf.info("Parsing page " + str(page) + " of " + str(pages))
+ self.info("Parsing page " + str(page) + " of " + str(pages))
page += 1
hits = res.get('hits')
@@ -188,10 +188,10 @@ class sfp_grep_app(SpiderFootPlugin):
hosts.append(host)
if not self.getTarget().matches(self.sf.urlFQDN(link), includeChildren=True, includeParents=True):
- self.sf.debug("Skipped unrelated link: " + link)
+ self.debug("Skipped unrelated link: " + link)
continue
- self.sf.debug('Found a link: ' + link)
+ self.debug('Found a link: ' + link)
evt = SpiderFootEvent('LINKED_URL_INTERNAL', link, self.__name__, event)
self.notifyListeners(evt)
self.results[link] = True
@@ -204,10 +204,10 @@ class sfp_grep_app(SpiderFootPlugin):
mail_domain = email.lower().split('@')[1]
if not self.getTarget().matches(mail_domain, includeChildren=True, includeParents=True):
- self.sf.debug("Skipped unrelated email address: " + email)
+ self.debug("Skipped unrelated email address: " + email)
continue
- self.sf.info("Found e-mail address: " + email)
+ self.info("Found e-mail address: " + email)
if email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
else:
@@ -225,7 +225,7 @@ class sfp_grep_app(SpiderFootPlugin):
return
if self.opts['dns_resolve'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", host, self.__name__, event)
self.notifyListeners(evt)
continue
diff --git a/modules/sfp_greynoise.py b/modules/sfp_greynoise.py
index a756514d..9bb2395e 100644
--- a/modules/sfp_greynoise.py
+++ b/modules/sfp_greynoise.py
@@ -108,14 +108,14 @@ class sfp_greynoise(SpiderFootPlugin):
useragent="SpiderFoot", headers=header)
if res['code'] not in ["200"]:
- self.sf.error("Greynoise API key seems to have been rejected or you have exceeded usage limits.")
+ self.error("Greynoise API key seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Greynoise: {e}")
+ self.error(f"Error processing JSON response from Greynoise: {e}")
return None
@@ -128,15 +128,15 @@ class sfp_greynoise(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_greynoise but did not set an API key!")
+ self.error("You enabled sfp_greynoise but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -146,9 +146,9 @@ class sfp_greynoise(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -156,9 +156,9 @@ class sfp_greynoise(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
if eventName == 'IP_ADDRESS' or eventName.startswith('NETBLOCK_'):
@@ -177,13 +177,13 @@ class sfp_greynoise(SpiderFootPlugin):
if len(ret["data"]) > 0:
for rec in ret["data"]:
if rec.get("seen", None):
- self.sf.debug("Found threat info in Greynoise")
+ self.debug("Found threat info in Greynoise")
lastseen = rec.get("last_seen", "1970-01-01")
lastseen_dt = datetime.strptime(lastseen, '%Y-%m-%d')
lastseen_ts = int(time.mktime(lastseen_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and lastseen_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({lastseen_dt}), skipping.")
+ self.debug("Record found but too old, skipping.")
return
# Only report meta data about the target, not affiliates
diff --git a/modules/sfp_h1nobbdde.py b/modules/sfp_h1nobbdde.py
index 9cca1c40..00773183 100644
--- a/modules/sfp_h1nobbdde.py
+++ b/modules/sfp_h1nobbdde.py
@@ -72,7 +72,7 @@ class sfp_h1nobbdde(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=30, useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug("No content returned from h1.nobbd.de")
+ self.debug("No content returned from h1.nobbd.de")
return None
try:
@@ -82,7 +82,7 @@ class sfp_h1nobbdde(SpiderFootPlugin):
if qry in m[1]:
ret.append(m[1] + "\n<SFURL>" + m[0] + "</SFURL>")
except Exception as e:
- self.sf.error(f"Error processing response from h1.nobbd.de: {e}")
+ self.error(f"Error processing response from h1.nobbd.de: {e}")
return None
return ret
@@ -93,10 +93,10 @@ class sfp_h1nobbdde(SpiderFootPlugin):
eventData = event.data
data = list()
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_hackertarget.py b/modules/sfp_hackertarget.py
index d14ee72a..4888e094 100644
--- a/modules/sfp_hackertarget.py
+++ b/modules/sfp_hackertarget.py
@@ -118,11 +118,11 @@ class sfp_hackertarget(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.error(f"Unable to fetch HTTP headers for {ip} from HackerTarget.com.")
+ self.error(f"Unable to fetch HTTP headers for {ip} from HackerTarget.com.")
return None
if not res['content'].startswith('HTTP/'):
- self.sf.debug(f"Found no HTTP headers for {ip}")
+ self.debug(f"Found no HTTP headers for {ip}")
return None
headers = dict()
@@ -156,7 +156,7 @@ class sfp_hackertarget(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.error(f"Unable to fetch DNS zone for {ip} from HackerTarget.com.")
+ self.error(f"Unable to fetch DNS zone for {ip} from HackerTarget.com.")
return None
records = list()
@@ -190,7 +190,7 @@ class sfp_hackertarget(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.error("Unable to fetch hackertarget.com content.")
+ self.error("Unable to fetch hackertarget.com content.")
return None
if "No records" in res['content']:
@@ -198,7 +198,7 @@ class sfp_hackertarget(SpiderFootPlugin):
hosts = res['content'].split('\n')
- self.sf.debug(f"Found {len(hosts)} on {ip}")
+ self.debug(f"Found {len(hosts)} on {ip}")
return hosts
@@ -208,14 +208,14 @@ class sfp_hackertarget(SpiderFootPlugin):
eventData = event.data
self.currentEventSrc = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if srcModuleName == "sfp_hackertarget" and eventName == "IP_ADDRESS":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName == 'NETBLOCK_OWNER':
@@ -225,7 +225,7 @@ class sfp_hackertarget(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
net_size = IPNetwork(eventData).prefixlen
if net_size < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {net_size} > {max_netblock}")
return
if eventName == 'DOMAIN_NAME_PARENT':
@@ -248,7 +248,7 @@ class sfp_hackertarget(SpiderFootPlugin):
hosts = list()
for strdata in grps:
- self.sf.debug("Matched: " + strdata)
+ self.debug("Matched: " + strdata)
if strdata.endswith("."):
hosts.append(strdata[:-1])
else:
@@ -261,7 +261,7 @@ class sfp_hackertarget(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, host, self.__name__, event)
@@ -301,16 +301,16 @@ class sfp_hackertarget(SpiderFootPlugin):
if " " in h:
continue
- self.sf.info(f"Found something on same IP: {h}")
+ self.info(f"Found something on same IP: {h}")
if not self.opts['cohostsamedomain']:
if self.getTarget().matches(h, includeParents=True):
- self.sf.debug(f"Skipping {h} because it is on the same domain.")
+ self.debug(f"Skipping {h} because it is on the same domain.")
continue
if h not in myres and h != ip:
if self.opts['verify'] and not self.sf.validateIP(h, ip):
- self.sf.debug(f"Host {h} no longer resolves to {ip}")
+ self.debug(f"Host {h} no longer resolves to {ip}")
continue
if self.cohostcount < self.opts['maxcohost']:
diff --git a/modules/sfp_hashes.py b/modules/sfp_hashes.py
index 6cd27190..406adc6f 100644
--- a/modules/sfp_hashes.py
+++ b/modules/sfp_hashes.py
@@ -57,7 +57,7 @@ class sfp_hashes(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
hashes = self.sf.parseHashes(eventData)
for hashtup in hashes:
diff --git a/modules/sfp_haveibeenpwned.py b/modules/sfp_haveibeenpwned.py
index 6b5d3dcf..1cccbea6 100644
--- a/modules/sfp_haveibeenpwned.py
+++ b/modules/sfp_haveibeenpwned.py
@@ -108,14 +108,14 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
retry += 1
if res['code'] == "401":
- self.sf.error("Failed to authenticate key with HaveIBeenPwned.com.")
+ self.error("Failed to authenticate key with HaveIBeenPwned.com.")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from HaveIBeenPwned?: {e}")
+ self.error(f"Error processing JSON response from HaveIBeenPwned?: {e}")
return None
@@ -146,14 +146,14 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
retry += 1
if res['code'] == "401":
- self.sf.error("Failed to authenticate key with HaveIBeenPwned.com.")
+ self.error("Failed to authenticate key with HaveIBeenPwned.com.")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from HaveIBeenPwned?: {e}")
+ self.error(f"Error processing JSON response from HaveIBeenPwned?: {e}")
return None
@@ -167,14 +167,14 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_haveibeenpwned but did not set an API key!")
+ self.error("You enabled sfp_haveibeenpwned but did not set an API key!")
self.errorState = True
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -185,7 +185,7 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
try:
site = n["Name"]
except Exception as e:
- self.sf.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
+ self.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
continue
# Notify other modules of what you've found
@@ -221,12 +221,12 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
links.add(site)
except Exception as e:
- self.sf.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
+ self.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
continue
for link in links:
try:
- self.sf.debug("Found a link: " + link)
+ self.debug("Found a link: " + link)
if self.checkForStop():
return
@@ -234,7 +234,7 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
res = self.sf.fetchUrl(link, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug(f"Ignoring {link} as no data returned")
+ self.debug(f"Ignoring {link} as no data returned")
continue
if re.search(r"[^a-zA-Z\-\_0-9]" + re.escape(eventData) + r"[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:
@@ -247,7 +247,7 @@ class sfp_haveibeenpwned(SpiderFootPlugin):
self.notifyListeners(evt2)
except Exception as e:
- self.sf.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
+ self.debug(f"Unable to parse result from HaveIBeenPwned?: {e}")
continue
# End of sfp_haveibeenpwned class
diff --git a/modules/sfp_honeypot.py b/modules/sfp_honeypot.py
index 0d45bec3..de4e5414 100644
--- a/modules/sfp_honeypot.py
+++ b/modules/sfp_honeypot.py
@@ -138,12 +138,12 @@ class sfp_honeypot(SpiderFootPlugin):
try:
lookup = f"{self.opts['api_key']}.{self.reverseAddr(qaddr)}.dnsbl.httpbl.org"
- self.sf.debug(f"Checking Honeypot: {lookup}")
+ self.debug(f"Checking Honeypot: {lookup}")
addrs = self.sf.resolveHost(lookup)
if not addrs:
return
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
text = None
for addr in addrs:
@@ -164,7 +164,7 @@ class sfp_honeypot(SpiderFootPlugin):
evt = SpiderFootEvent(e, text.format(qaddr), self.__name__, parentEvent)
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
# Handle events sent to this module
def handleEvent(self, event):
@@ -176,10 +176,10 @@ class sfp_honeypot(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_honeypot but did not set an API key!")
+ self.error("You enabled sfp_honeypot but did not set an API key!")
self.errorState = True
return
@@ -192,9 +192,9 @@ class sfp_honeypot(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -202,9 +202,9 @@ class sfp_honeypot(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_hosting.py b/modules/sfp_hosting.py
index 537c4846..0c1c6ccc 100644
--- a/modules/sfp_hosting.py
+++ b/modules/sfp_hosting.py
@@ -63,7 +63,7 @@ class sfp_hosting(SpiderFootPlugin):
if data['content'] is None:
data = self.sf.fetchUrl(url, useragent=self.opts['_useragent'])
if data['content'] is None:
- self.sf.error("Unable to fetch " + url)
+ self.error("Unable to fetch " + url)
return None
else:
self.sf.cachePut("sfipcat", data['content'])
@@ -80,7 +80,7 @@ class sfp_hosting(SpiderFootPlugin):
if IPAddress(qaddr) > IPAddress(start) and IPAddress(qaddr) < IPAddress(end):
return [title, url]
except Exception as e:
- self.sf.debug("Encountered an issue processing an IP: " + str(e))
+ self.debug("Encountered an issue processing an IP: " + str(e))
continue
return None
@@ -91,7 +91,7 @@ class sfp_hosting(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_hostio.py b/modules/sfp_hostio.py
index d8887e4b..a10da4c2 100644
--- a/modules/sfp_hostio.py
+++ b/modules/sfp_hostio.py
@@ -91,7 +91,7 @@ class sfp_hostio(SpiderFootPlugin):
error_str = f", message {error_message}"
else:
error_str = ""
- self.sf.info(f"Failed to get results for {qry}, code {res['code']}{error_str}")
+ self.info(f"Failed to get results for {qry}, code {res['code']}{error_str}")
def query(self, qry):
res = self.sf.fetchUrl(
@@ -105,13 +105,13 @@ class sfp_hostio(SpiderFootPlugin):
return None
if res["content"] is None:
- self.sf.info(f"No Host.io info found for {qry}")
+ self.info(f"No Host.io info found for {qry}")
return None
try:
return json.loads(res["content"])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Host.io: {e}")
+ self.error(f"Error processing JSON response from Host.io: {e}")
return None
@@ -123,24 +123,24 @@ class sfp_hostio(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData} as already mapped.")
+ self.debug(f"Skipping {eventData} as already mapped.")
return
self.results[eventData] = True
data = self.query(event.data)
if not data:
- self.sf.error(f"No data received for {event.data}")
+ self.error(f"No data received for {event.data}")
return
found = False
diff --git a/modules/sfp_hunter.py b/modules/sfp_hunter.py
index 41a0bdfa..d0893bc9 100644
--- a/modules/sfp_hunter.py
+++ b/modules/sfp_hunter.py
@@ -103,7 +103,7 @@ class sfp_hunter(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from hunter.io: {e}")
+ self.error(f"Error processing JSON response from hunter.io: {e}")
return None
@@ -116,16 +116,16 @@ class sfp_hunter(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_hunter but did not set an API key!")
+ self.error("You enabled sfp_hunter but did not set an API key!")
self.errorState = True
return
diff --git a/modules/sfp_hybrid_analysis.py b/modules/sfp_hybrid_analysis.py
index 89b2d8b0..06f70b86 100644
--- a/modules/sfp_hybrid_analysis.py
+++ b/modules/sfp_hybrid_analysis.py
@@ -174,19 +174,19 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
"""
if res['code'] == '400':
- self.sf.error("Failed to retrieve content from Hybrid Analysis: Invalid request")
- self.sf.debug(f"API response: {res['content']}")
+ self.error("Failed to retrieve content from Hybrid Analysis: Invalid request")
+ self.debug(f"API response: {res['content']}")
return None
# Future proofing - Hybrid Analysis does not implement rate limiting
if res['code'] == '429':
- self.sf.error("Failed to retrieve content from Hybrid Analysis: rate limit exceeded")
+ self.error("Failed to retrieve content from Hybrid Analysis: rate limit exceeded")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error(f"Failed to retrieve content from Hybrid Analysis: Unexpected response status {res['code']}")
+ self.error(f"Failed to retrieve content from Hybrid Analysis: Unexpected response status {res['code']}")
self.errorState = True
return None
@@ -196,7 +196,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -213,7 +213,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName not in ["IP_ADDRESS", "DOMAIN_NAME"]:
return
@@ -226,7 +226,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
return
if data is None:
- self.sf.debug(f"No information found for{eventData}")
+ self.debug(f"No information found for{eventData}")
return
results = data.get("result")
@@ -244,7 +244,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
if not hashes:
return
- self.sf.info(f"Found {len(hashes)} results for {eventData}")
+ self.info(f"Found {len(hashes)} results for {eventData}")
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
self.notifyListeners(evt)
@@ -256,7 +256,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
results = self.queryHash(file_hash)
if not results:
- self.sf.debug(f"No information found for hash {file_hash}")
+ self.debug(f"No information found for hash {file_hash}")
continue
evt = SpiderFootEvent('RAW_RIR_DATA', str(results), self.__name__, event)
@@ -300,7 +300,7 @@ class sfp_hybrid_analysis(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.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_iban.py b/modules/sfp_iban.py
index 3bc4a667..72bf3ade 100644
--- a/modules/sfp_iban.py
+++ b/modules/sfp_iban.py
@@ -57,11 +57,11 @@ class sfp_iban(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
ibanNumbers = self.sf.parseIBANNumbers(eventData)
for ibanNumber in set(ibanNumbers):
- self.sf.info(f"Found IBAN number: {ibanNumber}")
+ self.info(f"Found IBAN number: {ibanNumber}")
evt = SpiderFootEvent("IBAN_NUMBER", ibanNumber, self.__name__, event)
if event.moduleDataSource:
evt.moduleDataSource = event.moduleDataSource
diff --git a/modules/sfp_iknowwhatyoudownload.py b/modules/sfp_iknowwhatyoudownload.py
index 30c19b99..2ffe0009 100644
--- a/modules/sfp_iknowwhatyoudownload.py
+++ b/modules/sfp_iknowwhatyoudownload.py
@@ -91,19 +91,19 @@ class sfp_iknowwhatyoudownload(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")
if res['code'] in ["403", "500"]:
- self.sf.info("Unable to fetch data from iknowwhatyoudownload.com right now.")
+ self.info("Unable to fetch data from iknowwhatyoudownload.com right now.")
return None
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from iknowwhatyoudownload.com: {e}")
+ self.error(f"Error processing JSON response from iknowwhatyoudownload.com: {e}")
return None
if 'error' in ret:
if ret['error'] == "INVALID_DAYS":
self.errorState = True
- self.sf.error("The number of days you have configured is not accepted. If you have the demo key, try 30 days or less.")
+ self.error("The number of days you have configured is not accepted. If you have the demo key, try 30 days or less.")
return None
if 'contents' not in ret:
@@ -124,19 +124,19 @@ class sfp_iknowwhatyoudownload(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_iknowwhatyoudownload but did not set an API key!")
+ self.error("You enabled sfp_iknowwhatyoudownload but did not set an API key!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_instagram.py b/modules/sfp_instagram.py
index 16b54336..bc9831fe 100644
--- a/modules/sfp_instagram.py
+++ b/modules/sfp_instagram.py
@@ -67,7 +67,7 @@ class sfp_instagram(SpiderFootPlugin):
try:
return json.loads(json_data[0])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -81,18 +81,18 @@ class sfp_instagram(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Parse profile URL
try:
network = eventData.split(": ")[0]
url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")
except Exception as e:
- self.sf.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
+ self.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
return
if network != 'Instagram':
- self.sf.debug(f"Skipping social network profile, {url}, as not an Instagram profile")
+ self.debug(f"Skipping social network profile, {url}, as not an Instagram profile")
return
# Retrieve profile
@@ -103,14 +103,14 @@ class sfp_instagram(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.debug('No response from Instagram.com')
+ self.debug('No response from Instagram.com')
return
# Check if the profile is valid and extract profile data as JSON
json_data = self.extractJson(res['content'])
if not json_data:
- self.sf.debug(f"{url} is not a valid Instagram profile")
+ self.debug(f"{url} is not a valid Instagram profile")
return
e = SpiderFootEvent('RAW_RIR_DATA', str(json_data), self.__name__, event)
diff --git a/modules/sfp_intelx.py b/modules/sfp_intelx.py
index ef890984..2ffeda4d 100644
--- a/modules/sfp_intelx.py
+++ b/modules/sfp_intelx.py
@@ -132,18 +132,18 @@ class sfp_intelx(SpiderFootPlugin):
headers=headers, timeout=self.opts['_fetchtimeout'])
if res['content'] is None:
- self.sf.info("No IntelligenceX info found for " + qry)
+ self.info("No IntelligenceX info found for " + qry)
return None
if res['code'] == "402":
- self.sf.info("IntelligenceX credits expired.")
+ self.info("IntelligenceX credits expired.")
self.errorState = True
return None
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from IntelligenceX: {e}")
+ self.error(f"Error processing JSON response from IntelligenceX: {e}")
self.errorState = True
return None
@@ -159,18 +159,18 @@ class sfp_intelx(SpiderFootPlugin):
res = self.sf.fetchUrl(resulturl, headers=headers)
if res['content'] is None:
- self.sf.info("No IntelligenceX info found for results from " + qry)
+ self.info("No IntelligenceX info found for results from " + qry)
return None
if res['code'] == "402":
- self.sf.info("IntelligenceX credits expired.")
+ self.info("IntelligenceX credits expired.")
self.errorState = True
return None
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error("Error processing JSON response from IntelligenceX: " + str(e))
+ self.error("Error processing JSON response from IntelligenceX: " + str(e))
return None
status = ret['status']
@@ -196,14 +196,14 @@ class sfp_intelx(SpiderFootPlugin):
return
if self.opts['api_key'] == "" or self.opts['base_url'] == "":
- self.sf.error("You enabled sfp_intelx but did not set an API key and/or base URL!")
+ self.error("You enabled sfp_intelx but did not set an API key and/or base URL!")
self.errorState = True
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -218,14 +218,14 @@ class sfp_intelx(SpiderFootPlugin):
if data is None:
return
- self.sf.info("Found IntelligenceX leak data for " + eventData)
+ self.info("Found IntelligenceX leak data for " + eventData)
agelimit = int(time.time() * 1000) - (86400000 * self.opts['maxage'])
for info in data:
for rec in info.get("records", dict()):
try:
last_seen = int(datetime.datetime.strptime(rec['added'].split(".")[0], '%Y-%m-%dT%H:%M:%S').strftime('%s')) * 1000
if last_seen < agelimit:
- self.sf.debug(f"Record found but too old ({last_seen}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
val = None
@@ -238,10 +238,10 @@ class sfp_intelx(SpiderFootPlugin):
val = rec['name']
if not val or not evt:
- self.sf.debug(f"Unexpected record, skipping ({rec['bucket']})")
+ self.debug(f"Unexpected record, skipping ({rec['bucket']})")
continue
except Exception as e:
- self.sf.error(f"Error processing content from IntelX: {e}")
+ self.error(f"Error processing content from IntelX: {e}")
continue
# Notify other modules of what you've found
@@ -255,7 +255,7 @@ class sfp_intelx(SpiderFootPlugin):
if data is None:
return
- self.sf.info(f"Found IntelligenceX host and email data for {eventData}")
+ self.info(f"Found IntelligenceX host and email data for {eventData}")
for info in data:
for rec in info.get("selectors", dict()):
try:
@@ -273,10 +273,10 @@ class sfp_intelx(SpiderFootPlugin):
evt = "LINKED_URL_INTERNAL"
if not val or not evt:
- self.sf.debug("Unexpected record, skipping.")
+ self.debug("Unexpected record, skipping.")
continue
except Exception as e:
- self.sf.error(f"Error processing content from IntelX: {e}")
+ self.error(f"Error processing content from IntelX: {e}")
continue
# Notify other modules of what you've found
diff --git a/modules/sfp_intfiles.py b/modules/sfp_intfiles.py
index d88d4baa..d3a4a0df 100644
--- a/modules/sfp_intfiles.py
+++ b/modules/sfp_intfiles.py
@@ -59,7 +59,7 @@ class sfp_intfiles(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_ipapico.py b/modules/sfp_ipapico.py
index c2d7d03b..fbdede8f 100644
--- a/modules/sfp_ipapico.py
+++ b/modules/sfp_ipapico.py
@@ -80,13 +80,13 @@ class sfp_ipapico(SpiderFootPlugin):
time.sleep(1.5)
if res['content'] is None:
- self.sf.info(f"No ipapi.co data found for {qry}")
+ self.info(f"No ipapi.co data found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -96,11 +96,11 @@ class sfp_ipapico(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -108,7 +108,7 @@ class sfp_ipapico(SpiderFootPlugin):
data = self.query(eventData)
if data is None:
- self.sf.info("No results returned from ipapi.co")
+ self.info("No results returned from ipapi.co")
return
if data.get('country'):
diff --git a/modules/sfp_ipapicom.py b/modules/sfp_ipapicom.py
index cc024553..b028bc39 100644
--- a/modules/sfp_ipapicom.py
+++ b/modules/sfp_ipapicom.py
@@ -90,16 +90,16 @@ class sfp_ipapicom(SpiderFootPlugin):
time.sleep(1.5)
if res['code'] == "429":
- self.sf.error("You are being rate-limited by IP-API.com.")
+ self.error("You are being rate-limited by IP-API.com.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info(f"No ipapi.com data found for {qry}")
+ self.info(f"No ipapi.com data found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
# Handle events sent to this module
@@ -108,18 +108,18 @@ class sfp_ipapicom(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_ipapicom but did not set an API key!")
+ self.error("You enabled sfp_ipapicom but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_ipinfo.py b/modules/sfp_ipinfo.py
index 1f1d49e2..d77b7a1a 100644
--- a/modules/sfp_ipinfo.py
+++ b/modules/sfp_ipinfo.py
@@ -84,18 +84,18 @@ class sfp_ipinfo(SpiderFootPlugin):
headers=headers)
if res['code'] == "429":
- self.sf.error("You are being rate-limited by ipinfo.io.")
+ self.error("You are being rate-limited by ipinfo.io.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No GeoIP info found for " + ip)
+ self.info("No GeoIP info found for " + ip)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -108,15 +108,15 @@ class sfp_ipinfo(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_ipinfo but did not set an API key!")
+ self.error("You enabled sfp_ipinfo but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -130,7 +130,7 @@ class sfp_ipinfo(SpiderFootPlugin):
return
location = ', '.join([_f for _f in [data.get('city'), data.get('region'), data.get('country')] if _f])
- self.sf.info("Found GeoIP for " + eventData + ": " + location)
+ self.info("Found GeoIP for " + eventData + ": " + location)
evt = SpiderFootEvent("GEOINFO", location, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_ipqualityscore.py b/modules/sfp_ipqualityscore.py
index ea785f96..7b7b625d 100644
--- a/modules/sfp_ipqualityscore.py
+++ b/modules/sfp_ipqualityscore.py
@@ -99,7 +99,7 @@ class sfp_ipqualityscore(SpiderFootPlugin):
error_str = f", message {error_message}"
else:
error_str = ""
- self.sf.error(f"Failed to get results for {qry}, code {res['code']}{error_str}")
+ self.error(f"Failed to get results for {qry}, code {res['code']}{error_str}")
def query(self, qry, eventName):
queryString = ""
@@ -117,7 +117,7 @@ class sfp_ipqualityscore(SpiderFootPlugin):
)
if not res['content']:
- self.sf.info(f"No IPQualityScore info found for {qry}")
+ self.info(f"No IPQualityScore info found for {qry}")
return None
try:
@@ -127,7 +127,7 @@ class sfp_ipqualityscore(SpiderFootPlugin):
return None
return r
except Exception as e:
- self.sf.error(f"Error processing JSON response from IPQualityScore: {e}")
+ self.error(f"Error processing JSON response from IPQualityScore: {e}")
return None
@@ -160,17 +160,17 @@ class sfp_ipqualityscore(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API Key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData} as already mapped.")
+ self.debug(f"Skipping {eventData} as already mapped.")
return
self.results[eventData] = True
diff --git a/modules/sfp_ipregistry.py b/modules/sfp_ipregistry.py
index c8cfe3ae..2be1dfff 100644
--- a/modules/sfp_ipregistry.py
+++ b/modules/sfp_ipregistry.py
@@ -76,13 +76,13 @@ class sfp_ipregistry(SpiderFootPlugin):
)
if res["content"] is None:
- self.sf.info(f"No {self.meta['name']} info found for {qry}")
+ self.info(f"No {self.meta['name']} info found for {qry}")
return None
try:
return json.loads(res["content"])
except Exception as e:
- self.sf.error(
+ self.error(
f"Error processing JSON response from {self.meta['name']}: {e}"
)
@@ -147,15 +147,15 @@ class sfp_ipregistry(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {event.eventType}, from {event.module}")
+ self.debug(f"Received event, {event.eventType}, from {event.module}")
if self.opts["api_key"] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set an API key!")
self.errorState = True
return
if event.data in self.results:
- self.sf.debug(f"Skipping {event.data}, already checked.")
+ self.debug(f"Skipping {event.data}, already checked.")
return
self.results[event.data] = True
diff --git a/modules/sfp_ipstack.py b/modules/sfp_ipstack.py
index 7a141e5a..37621157 100644
--- a/modules/sfp_ipstack.py
+++ b/modules/sfp_ipstack.py
@@ -79,19 +79,19 @@ class sfp_ipstack(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_ipstack but did not set an API key!")
+ self.error("You enabled sfp_ipstack but did not set an API key!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -99,21 +99,21 @@ class sfp_ipstack(SpiderFootPlugin):
res = self.sf.fetchUrl("http://api.ipstack.com/" + eventData + "?access_key=" + self.opts['api_key'],
timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.info("No GeoIP info found for " + eventData)
+ self.info("No GeoIP info found for " + eventData)
try:
hostip = json.loads(res['content'])
if 'success' in hostip and hostip['success'] is False:
- self.sf.error("Invalid ipstack.com API key or usage limits exceeded.")
+ self.error("Invalid ipstack.com API key or usage limits exceeded.")
self.errorState = True
return
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return
geoinfo = hostip.get('country_name')
if geoinfo:
- self.sf.info(f"Found GeoIP for {eventData}: {geoinfo}")
+ self.info(f"Found GeoIP for {eventData}: {geoinfo}")
evt = SpiderFootEvent("GEOINFO", geoinfo, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_isc.py b/modules/sfp_isc.py
index 85be3c76..ea8d027b 100644
--- a/modules/sfp_isc.py
+++ b/modules/sfp_isc.py
@@ -88,12 +88,12 @@ class sfp_isc(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from ISC.")
+ self.error(f"Unexpected HTTP response code {res['code']} from ISC.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from ISC")
+ self.error("Received no content from ISC")
self.errorState = True
return None
@@ -105,10 +105,10 @@ class sfp_isc(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
diff --git a/modules/sfp_jsonwhoiscom.py b/modules/sfp_jsonwhoiscom.py
index 79a1146f..fcd7f80a 100644
--- a/modules/sfp_jsonwhoiscom.py
+++ b/modules/sfp_jsonwhoiscom.py
@@ -107,32 +107,32 @@ class sfp_jsonwhoiscom(SpiderFootPlugin):
# Parse API response
def parseAPIResponse(self, res):
if res['code'] == '404':
- self.sf.debug("No results for query")
+ self.debug("No results for query")
return None
# Sometimes JsonWHOIS.com returns HTTP 500 errors rather than 404
if res['code'] == '500' and res['content'] == '{"error":"Call failed"}':
- self.sf.debug("No results for query")
+ self.debug("No results for query")
return None
if res['code'] == "401":
- self.sf.error("Invalid JsonWHOIS.com API key.")
+ self.error("Invalid JsonWHOIS.com API key.")
self.errorState = True
return None
if res['code'] == '429':
- self.sf.error("You are being rate-limited by JsonWHOIS.com")
+ self.error("You are being rate-limited by JsonWHOIS.com")
self.errorState = True
return None
if res['code'] == '503':
- self.sf.error("JsonWHOIS.com service unavailable")
+ self.error("JsonWHOIS.com service unavailable")
self.errorState = True
return None
# Catch all other non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from JsonWHOIS.com")
+ self.error("Failed to retrieve content from JsonWHOIS.com")
self.errorState = True
return None
@@ -142,7 +142,7 @@ class sfp_jsonwhoiscom(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -159,18 +159,18 @@ class sfp_jsonwhoiscom(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_jsonwhoiscom but did not set an API key!")
+ self.error("You enabled sfp_jsonwhoiscom but did not set an API key!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
res = self.queryDomain(eventData)
if res is None:
- self.sf.debug(f"No information found for domain {eventData}")
+ self.debug(f"No information found for domain {eventData}")
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(res), self.__name__, event)
diff --git a/modules/sfp_junkfiles.py b/modules/sfp_junkfiles.py
index 535b3d5c..aae03876 100644
--- a/modules/sfp_junkfiles.py
+++ b/modules/sfp_junkfiles.py
@@ -88,7 +88,7 @@ class sfp_junkfiles(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -98,13 +98,13 @@ class sfp_junkfiles(SpiderFootPlugin):
host = self.sf.urlBaseUrl(eventData)
if host in self.skiphosts:
- self.sf.debug("Skipping " + host + " because it doesn't return 404s.")
+ self.debug("Skipping " + host + " because it doesn't return 404s.")
return
# http://www/blah/abc.php -> try http://www/blah/abc.php.[fileexts]
for ext in self.opts['urlextstry']:
if host in self.skiphosts:
- self.sf.debug("Skipping " + host + " because it doesn't return 404s.")
+ self.debug("Skipping " + host + " because it doesn't return 404s.")
return
if "." + ext + "?" in eventData or "." + ext + "#" in eventData or \
@@ -114,10 +114,10 @@ class sfp_junkfiles(SpiderFootPlugin):
if self.checkForStop():
return
- self.sf.debug("Trying " + x + " against " + eventData)
+ self.debug("Trying " + x + " against " + eventData)
fetch = bits[0] + "." + x
if fetch in self.results:
- self.sf.debug("Skipping, already fetched.")
+ self.debug("Skipping, already fetched.")
continue
self.results[fetch] = True
@@ -128,7 +128,7 @@ class sfp_junkfiles(SpiderFootPlugin):
sizeLimit=10000000,
verify=False)
if res['realurl'] != fetch:
- self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
+ self.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
if res['code'] == "200":
if not self.checkValidity(fetch):
@@ -149,13 +149,13 @@ class sfp_junkfiles(SpiderFootPlugin):
return
if host in self.skiphosts:
- self.sf.debug("Skipping " + host + " because it doesn't return 404s.")
+ self.debug("Skipping " + host + " because it doesn't return 404s.")
return
- self.sf.debug("Trying " + f + " against " + eventData)
+ self.debug("Trying " + f + " against " + eventData)
fetch = base + f
if fetch in self.results:
- self.sf.debug("Skipping, already fetched.")
+ self.debug("Skipping, already fetched.")
continue
self.results[fetch] = True
@@ -165,7 +165,7 @@ class sfp_junkfiles(SpiderFootPlugin):
useragent=self.opts['_useragent'],
verify=False)
if res['realurl'] != fetch:
- self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
+ self.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
if res['code'] == "200":
if not self.checkValidity(fetch):
@@ -175,7 +175,7 @@ class sfp_junkfiles(SpiderFootPlugin):
self.notifyListeners(evt)
# don't do anything with the root directory of a site
- self.sf.debug(f"Base: {base}, event: {eventData}")
+ self.debug(f"Base: {base}, event: {eventData}")
if base in [eventData, eventData + "/"]:
return
@@ -185,17 +185,17 @@ class sfp_junkfiles(SpiderFootPlugin):
return
if host in self.skiphosts:
- self.sf.debug("Skipping " + host + " because it doesn't return 404s.")
+ self.debug("Skipping " + host + " because it doesn't return 404s.")
return
if base.count('/') == 3:
- self.sf.debug("Skipping base url.")
+ self.debug("Skipping base url.")
continue
- self.sf.debug("Trying " + dirfile + " against " + eventData)
+ self.debug("Trying " + dirfile + " against " + eventData)
fetch = base[0:len(base) - 1] + "." + dirfile
if fetch in self.results:
- self.sf.debug("Skipping, already fetched.")
+ self.debug("Skipping, already fetched.")
continue
self.results[fetch] = True
@@ -205,7 +205,7 @@ class sfp_junkfiles(SpiderFootPlugin):
useragent=self.opts['_useragent'],
verify=False)
if res['realurl'] != fetch:
- self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
+ self.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)
continue
if res['code'] == "200":
if not self.checkValidity(fetch):
diff --git a/modules/sfp_keybase.py b/modules/sfp_keybase.py
index 49606880..db49d705 100644
--- a/modules/sfp_keybase.py
+++ b/modules/sfp_keybase.py
@@ -101,13 +101,13 @@ class sfp_keybase(SpiderFootPlugin):
# In this case, it will always be 200 if keybase is queried
# The actual response codes are stored in status tag of the response
if res['code'] != '200':
- self.sf.error(f"Unexpected reply from Keybase: {res['code']}")
+ self.error(f"Unexpected reply from Keybase: {res['code']}")
return None
try:
content = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
status = content.get('status')
@@ -117,7 +117,7 @@ class sfp_keybase(SpiderFootPlugin):
code = status.get('code')
if code != 0:
- self.sf.error(f"Unexpected JSON response code reply from Keybase: {code}")
+ self.error(f"Unexpected JSON response code reply from Keybase: {code}")
return None
them = content.get('them')
@@ -134,10 +134,10 @@ class sfp_keybase(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -148,7 +148,7 @@ class sfp_keybase(SpiderFootPlugin):
links = re.findall(linkRegex, eventData)
if len(links) == 0:
- self.sf.debug(f"Skipping URL {eventData}, as not a keybase link")
+ self.debug(f"Skipping URL {eventData}, as not a keybase link")
return
userName = links[0].split("/")[3]
@@ -162,7 +162,7 @@ class sfp_keybase(SpiderFootPlugin):
return
if not data:
- self.sf.debug(f"No data found for {eventName}: {eventData}")
+ self.debug(f"No data found for {eventName}: {eventData}")
return
for user in data:
@@ -178,13 +178,13 @@ class sfp_keybase(SpiderFootPlugin):
# Failsafe to prevent reporting any wrongly received data
if eventName == "USERNAME":
if eventData.lower() != username.lower():
- self.sf.error("Username does not match received response, skipping")
+ self.error("Username does not match received response, skipping")
continue
# For newly discovereed usernames, create a username event to be used as a source event
if eventName in ['LINKED_URL_EXTERNAL', 'DOMAIN_NAME']:
if username in self.results:
- self.sf.debug(f"Skipping {userName}, already checked.")
+ self.debug(f"Skipping {userName}, already checked.")
continue
source_event = SpiderFootEvent("USERNAME", username, self.__name__, event)
@@ -251,7 +251,7 @@ class sfp_keybase(SpiderFootPlugin):
for pgpKey in pgpKeys:
if len(pgpKey) < 300:
- self.sf.debug(f"PGP key size ({len(pgpKey)} bytes) is likely invalid (smaller than 300 bytes), skipping.")
+ self.debug(f"PGP key size ({len(pgpKey)} bytes) is likely invalid (smaller than 300 bytes), skipping.")
continue
# Remove unescaped \n literals
diff --git a/modules/sfp_koodous.py b/modules/sfp_koodous.py
index 36b22e60..4bcf7c4b 100644
--- a/modules/sfp_koodous.py
+++ b/modules/sfp_koodous.py
@@ -86,14 +86,14 @@ class sfp_koodous(SpiderFootPlugin):
return None
if res['code'] != '200':
- self.sf.error(f"Unexpected reply from Koodous: {res['code']}")
+ self.error(f"Unexpected reply from Koodous: {res['code']}")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from Koodous: {e}")
+ self.debug(f"Error processing JSON response from Koodous: {e}")
return None
return None
@@ -106,10 +106,10 @@ class sfp_koodous(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName not in self.watchedEvents():
@@ -161,7 +161,7 @@ class sfp_koodous(SpiderFootPlugin):
and not package_name.lower().endswith(f".{domain_reversed}")
and f".{domain_reversed}." not in package_name.lower()
):
- self.sf.debug(f"App {app_full_name} does not match {domain_reversed}, skipping")
+ self.debug(f"App {app_full_name} does not match {domain_reversed}, skipping")
continue
sha256 = result.get('sha256')
diff --git a/modules/sfp_leakix.py b/modules/sfp_leakix.py
index b2dbf87d..c3a5b32b 100644
--- a/modules/sfp_leakix.py
+++ b/modules/sfp_leakix.py
@@ -102,18 +102,18 @@ class sfp_leakix(SpiderFootPlugin):
# Parse API response
def parseAPIResponse(self, res):
if res['code'] == '404':
- self.sf.debug("Host not found")
+ self.debug("Host not found")
return None
# Future proofing - LeakIX does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by LeakIX")
+ self.error("You are being rate-limited by LeakIX")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from LeakIX")
+ self.error("Failed to retrieve content from LeakIX")
self.errorState = True
return None
@@ -123,7 +123,7 @@ class sfp_leakix(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -149,8 +149,8 @@ class sfp_leakix(SpiderFootPlugin):
self.results[eventData] = True
if self.opts['api_key'] == "":
- self.sf.debug("You enabled sfp_leakix but did not set an API key, results are limited")
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug("You enabled sfp_leakix but did not set an API key, results are limited")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName in ["IP_ADDRESS", "DOMAIN_NAME"]:
if eventName == "IP_ADDRESS":
@@ -159,7 +159,7 @@ class sfp_leakix(SpiderFootPlugin):
data = self.queryApi("domain", eventData)
if data is None:
- self.sf.debug("No information found for host " + eventData)
+ self.debug("No information found for host " + eventData)
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -182,7 +182,7 @@ class sfp_leakix(SpiderFootPlugin):
hostname = service.get('hostname')
if hostname and eventName == "DOMAIN_NAME" and self.getTarget().matches(hostname) and hostname not in hosts:
if self.opts["verify"] and not self.sf.resolveHost(hostname) and not self.sf.resolveHost6(hostname):
- self.sf.debug(f"Host {hostname} could not be resolved")
+ self.debug(f"Host {hostname} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", hostname, self.__name__, event)
else:
evt = SpiderFootEvent("INTERNET_NAME", hostname, self.__name__, event)
diff --git a/modules/sfp_maltiverse.py b/modules/sfp_maltiverse.py
index 17f55d9f..c8384013 100644
--- a/modules/sfp_maltiverse.py
+++ b/modules/sfp_maltiverse.py
@@ -98,15 +98,15 @@ class sfp_maltiverse(SpiderFootPlugin):
)
if res['code'] == "400":
- self.sf.error("Bad request. " + qry + " is not a valid IP Address")
+ self.error("Bad request. " + qry + " is not a valid IP Address")
return None
if res['code'] == "404":
- self.sf.error("API endpoint not found")
+ self.error("API endpoint not found")
return None
if res['code'] != "200":
- self.sf.debug("No information found from Maltiverse for IP Address")
+ self.debug("No information found from Maltiverse for IP Address")
return None
try:
@@ -114,7 +114,7 @@ class sfp_maltiverse(SpiderFootPlugin):
data = str(res['content']).replace("\\n", " ")
return json.loads(data)
except Exception:
- self.sf.error("Incorrectly formatted data received as JSON response")
+ self.error("Incorrectly formatted data received as JSON response")
return None
# Handle events sent to this module
@@ -126,11 +126,11 @@ class sfp_maltiverse(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -140,9 +140,9 @@ class sfp_maltiverse(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -150,9 +150,9 @@ class sfp_maltiverse(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
qrylist = list()
@@ -182,13 +182,13 @@ class sfp_maltiverse(SpiderFootPlugin):
continue
if addr != maliciousIP:
- self.sf.error("Reported address doesn't match requested, skipping")
+ self.error("Reported address doesn't match requested, skipping")
continue
blacklistedRecords = data.get('blacklist')
if blacklistedRecords is None or len(blacklistedRecords) == 0:
- self.sf.debug("No blacklist information found for IP")
+ self.debug("No blacklist information found for IP")
continue
# Data is reported about the IP Address
@@ -213,7 +213,7 @@ class sfp_maltiverse(SpiderFootPlugin):
try:
lastSeenDate = datetime.strptime(str(lastSeen), "%Y-%m-%d %H:%M:%S")
except Exception:
- self.sf.error("Invalid date in JSON response, skipping")
+ self.error("Invalid date in JSON response, skipping")
continue
today = datetime.now()
@@ -221,7 +221,7 @@ class sfp_maltiverse(SpiderFootPlugin):
difference = (today - lastSeenDate).days
if difference > int(self.opts["age_limit_days"]):
- self.sf.debug("Record found is older than age limit, skipping")
+ self.debug("Record found is older than age limit, skipping")
continue
maliciousIPDesc += " - DESCRIPTION : " + str(blacklistedRecord.get("description")) + "\n"
diff --git a/modules/sfp_malwarepatrol.py b/modules/sfp_malwarepatrol.py
index dd21ed37..1d2affa1 100644
--- a/modules/sfp_malwarepatrol.py
+++ b/modules/sfp_malwarepatrol.py
@@ -86,7 +86,7 @@ class sfp_malwarepatrol(SpiderFootPlugin):
if data['content'] is None:
data = self.sf.fetchUrl(url, useragent=self.opts['_useragent'])
if data['content'] is None:
- self.sf.error("Unable to fetch " + url)
+ self.error("Unable to fetch " + url)
return None
else:
self.sf.cachePut("sfmalwarepatrol", data['content'])
@@ -109,15 +109,15 @@ class sfp_malwarepatrol(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if not self.opts['api_key']:
- self.sf.error("You enabled sfp_malwarepatrol but did not provide an receipt ID!")
+ self.error("You enabled sfp_malwarepatrol but did not provide an receipt ID!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already searched.")
+ self.debug("Skipping " + eventData + " as already searched.")
return
self.results[eventData] = True
diff --git a/modules/sfp_metadefender.py b/modules/sfp_metadefender.py
index d40e9523..8ac0d809 100644
--- a/modules/sfp_metadefender.py
+++ b/modules/sfp_metadefender.py
@@ -113,14 +113,14 @@ class sfp_metadefender(SpiderFootPlugin):
# Parse API response
def parseApiResponse(self, res):
if res['code'] == "401":
- self.sf.error("Invalid MetaDefender API key")
+ self.error("Invalid MetaDefender API key")
self.errorState = True
return None
# https://onlinehelp.opswat.com/mdcloud/3._Rate_Limiting.html
# https://onlinehelp.opswat.com/mdcloud/4._Throttling.html
if res['code'] == "429":
- self.sf.error("You are being rate-limited by MetaDefender")
+ self.error("You are being rate-limited by MetaDefender")
self.errorState = True
return None
@@ -133,7 +133,7 @@ class sfp_metadefender(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -150,19 +150,19 @@ class sfp_metadefender(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_metadefender but did not set an API key!")
+ self.error("You enabled sfp_metadefender but did not set an API key!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == 'IP_ADDRESS':
data = self.queryIp(eventData)
if data is None:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
geo_info = data.get('geo_info')
@@ -175,13 +175,13 @@ class sfp_metadefender(SpiderFootPlugin):
res = data.get('lookup_results')
if not res:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
sources = res.get('sources')
if not sources:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
for m in sources:
@@ -194,19 +194,19 @@ class sfp_metadefender(SpiderFootPlugin):
data = self.queryDomain(eventData)
if data is None:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
res = data.get('lookup_results')
if not res:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
sources = res.get('sources')
if not sources:
- self.sf.debug("No matches found for " + eventData)
+ self.debug("No matches found for " + eventData)
return
for m in sources:
diff --git a/modules/sfp_mnemonic.py b/modules/sfp_mnemonic.py
index 26d00980..a069f58e 100644
--- a/modules/sfp_mnemonic.py
+++ b/modules/sfp_mnemonic.py
@@ -125,42 +125,42 @@ class sfp_mnemonic(SpiderFootPlugin):
time.sleep(0.75)
if res['content'] is None:
- self.sf.info("No results found for " + qry)
+ self.info("No results found for " + qry)
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from Mnemonic: {e}")
+ self.debug(f"Error processing JSON response from Mnemonic: {e}")
return None
response_code = data.get('responseCode')
if not response_code:
- self.sf.debug("Error retrieving search results.")
+ self.debug("Error retrieving search results.")
return None
if response_code == 402:
- self.sf.debug("Error retrieving search results: Resource limit exceeded")
+ self.debug("Error retrieving search results: Resource limit exceeded")
self.errorState = True
return None
if response_code != 200:
- self.sf.debug(f"Error retrieving search results: {response_code}")
+ self.debug(f"Error retrieving search results: {response_code}")
return None
if 'data' not in data:
- self.sf.info(f"No results found for {qry}")
+ self.info(f"No results found for {qry}")
return None
size = data.get('size')
count = data.get('count')
if not count or not size:
- self.sf.info(f"No results found for {qry}")
+ self.info(f"No results found for {qry}")
return None
- self.sf.info(f"Retrieved {size} of {count} results")
+ self.info(f"Retrieved {size} of {count} results")
return data['data']
@@ -173,12 +173,12 @@ class sfp_mnemonic(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
position = 0
max_pages = int(self.opts['max_pages'])
@@ -197,7 +197,7 @@ class sfp_mnemonic(SpiderFootPlugin):
data = self.query(eventData, limit=per_page, offset=position)
if data is None:
- self.sf.info(f"No passive DNS data found for {eventData}")
+ self.info(f"No passive DNS data found for {eventData}")
break
position += per_page
@@ -207,7 +207,7 @@ class sfp_mnemonic(SpiderFootPlugin):
continue
if r['lastSeenTimestamp'] < agelimit:
- self.sf.debug(f"Record {r['answer']} found for {r['query']} is too old, skipping.")
+ self.debug(f"Record {r['answer']} found for {r['query']} is too old, skipping.")
continue
if eventName in ['IP_ADDRESS']:
@@ -261,7 +261,7 @@ class sfp_mnemonic(SpiderFootPlugin):
if eventName in ["IP_ADDRESS", "IPV6_ADDRESS"]:
if self.opts['verify'] and not self.sf.validateIP(co, eventData):
- self.sf.debug(f"Host {co} no longer resolves to {eventData}")
+ self.debug(f"Host {co} no longer resolves to {eventData}")
continue
if self.opts['cohostsamedomain']:
@@ -273,7 +273,7 @@ class sfp_mnemonic(SpiderFootPlugin):
if self.getTarget().matches(co, includeParents=True):
if self.opts['verify'] and not self.sf.resolveHost(co) and not self.sf.resolveHost6(co):
- self.sf.debug(f"Host {co} could not be resolved")
+ self.debug(f"Host {co} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", co, self.__name__, event)
self.notifyListeners(evt)
continue
diff --git a/modules/sfp_multiproxy.py b/modules/sfp_multiproxy.py
index b5456bb6..43240782 100644
--- a/modules/sfp_multiproxy.py
+++ b/modules/sfp_multiproxy.py
@@ -94,13 +94,13 @@ class sfp_multiproxy(SpiderFootPlugin):
if targetType == "ip":
if target in proxy_list:
- self.sf.debug(f"IP address {target} found in multiproxy.org open proxy list.")
+ self.debug(f"IP address {target} found in multiproxy.org open proxy list.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in proxy_list:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in multiproxy.org open proxy list.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in multiproxy.org open proxy list.")
return True
return False
@@ -118,12 +118,12 @@ class sfp_multiproxy(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from multiproxy.org.")
+ self.error(f"Unexpected HTTP response code {res['code']} from multiproxy.org.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from multiproxy.org")
+ self.error("Received no content from multiproxy.org")
self.errorState = True
return None
@@ -161,10 +161,10 @@ class sfp_multiproxy(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -193,7 +193,7 @@ class sfp_multiproxy(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with multiproxy.org open proxy list")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with multiproxy.org open proxy list")
if self.queryProxyList(eventData, targetType):
url = "http://multiproxy.org/txt_all/proxy.txt"
diff --git a/modules/sfp_myspace.py b/modules/sfp_myspace.py
index 9cbb57e2..2b250943 100644
--- a/modules/sfp_myspace.py
+++ b/modules/sfp_myspace.py
@@ -70,7 +70,7 @@ class sfp_myspace(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Search by email address
if eventName == "EMAILADDR":
@@ -80,14 +80,14 @@ class sfp_myspace(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.error(f"Could not fetch MySpace content for {email}")
+ self.error(f"Could not fetch MySpace content for {email}")
return
# Extract HTML containing potential profile matches
profiles = re.findall(r'<a href="/[a-zA-Z0-9_]+">[^<]+</a></h6>', str(res['content']))
if not profiles:
- self.sf.debug(f"No profiles found for e-mail: {email}")
+ self.debug(f"No profiles found for e-mail: {email}")
return
# The first result is the closest match, but whether it's an exact match is unknown.
@@ -97,11 +97,11 @@ class sfp_myspace(SpiderFootPlugin):
try:
matches = re.findall(r'<a href=\"\/([a-zA-Z0-9_]+)\".*[\&; :\"\#\*\(\"\'\;\,\>\.\?\!]+' + email + r'[\&; :\"\#\*\)\"\'\;\,\<\.\?\!]+', profile, re.IGNORECASE)
except Exception:
- self.sf.debug("Malformed e-mail address, skipping.")
+ self.debug("Malformed e-mail address, skipping.")
return
if not matches:
- self.sf.debug("No concrete match for that e-mail.")
+ self.debug("No concrete match for that e-mail.")
return
name = matches[0]
@@ -119,11 +119,11 @@ class sfp_myspace(SpiderFootPlugin):
network = eventData.split(": ")[0]
url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")
except Exception as e:
- self.sf.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
+ self.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
return
if network != "MySpace":
- self.sf.debug(f"Skipping social network profile, {url}, as not a MySpace profile")
+ self.debug(f"Skipping social network profile, {url}, as not a MySpace profile")
return
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
@@ -140,7 +140,7 @@ class sfp_myspace(SpiderFootPlugin):
location = data[0]
if len(location) < 5 or len(location) > 100:
- self.sf.debug("Skipping likely invalid location.")
+ self.debug("Skipping likely invalid location.")
return
e = SpiderFootEvent("GEOINFO", location, self.__name__, event)
diff --git a/modules/sfp_nameapi.py b/modules/sfp_nameapi.py
index 0fd58c43..ac384cee 100644
--- a/modules/sfp_nameapi.py
+++ b/modules/sfp_nameapi.py
@@ -82,13 +82,13 @@ class sfp_nameapi(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.info(f"No NameAPI info found for {qry}")
+ self.info(f"No NameAPI info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from NameAPI: {e}")
+ self.error(f"Error processing JSON response from NameAPI: {e}")
return None
@@ -101,10 +101,10 @@ class sfp_nameapi(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
diff --git a/modules/sfp_names.py b/modules/sfp_names.py
index 4542ebab..931505d3 100644
--- a/modules/sfp_names.py
+++ b/modules/sfp_names.py
@@ -71,7 +71,7 @@ class sfp_names(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# If the source event is web content, check if the source URL was javascript
# or CSS, in which case optionally ignore it.
@@ -79,7 +79,7 @@ class sfp_names(SpiderFootPlugin):
url = event.actualSource
if url is not None:
if self.opts['filterjscss'] and (".js" in url or ".css" in url):
- self.sf.debug("Ignoring web content from CSS/JS.")
+ self.debug("Ignoring web content from CSS/JS.")
return
# Find names in email addresses in "<firstname>.<lastname>@<domain>" format
@@ -110,7 +110,7 @@ class sfp_names(SpiderFootPlugin):
"sfp_fullcontact", "sfp_github", "sfp_hunter",
"sfp_opencorporates", "sfp_slideshare",
"sfp_twitter", "sfp_venmo", "sfp_instagram"]:
- self.sf.debug("Ignoring RAW_RIR_DATA from untrusted module.")
+ self.debug("Ignoring RAW_RIR_DATA from untrusted module.")
return
# Stage 1: Find things that look (very vaguely) like names
@@ -134,11 +134,11 @@ class sfp_names(SpiderFootPlugin):
# If both words are not in the dictionary, add 75 points.
if first not in self.d and second not in self.d:
- self.sf.debug(f"Both first and second names are not in the dictionary, so high chance of name: ({first}:{second}).")
+ self.debug(f"Both first and second names are not in the dictionary, so high chance of name: ({first}:{second}).")
p += 75
notindict = True
else:
- self.sf.debug(first + " was found or " + second + " was found in dictionary.")
+ self.debug(first + " was found or " + second + " was found in dictionary.")
# If the first word is a known popular first name, award 50 points.
if first in self.n:
@@ -161,7 +161,7 @@ class sfp_names(SpiderFootPlugin):
name = r[0] + " " + secondOrig
- self.sf.debug("Name of " + name + " has score: " + str(p))
+ self.debug("Name of " + name + " has score: " + str(p))
if p > self.opts['algolimit']:
# Notify other modules of what you've found
evt = SpiderFootEvent("HUMAN_NAME", name, self.__name__, event)
diff --git a/modules/sfp_networksdb.py b/modules/sfp_networksdb.py
index 8dabd1f9..58638f3a 100644
--- a/modules/sfp_networksdb.py
+++ b/modules/sfp_networksdb.py
@@ -221,12 +221,12 @@ class sfp_networksdb(SpiderFootPlugin):
def parseApiResponse(self, res):
# Future proofing - NetworksDB does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by NetworksDB")
+ self.error("You are being rate-limited by NetworksDB")
self.errorState = True
return None
if res['code'] == '403':
- self.sf.error("Authentication failed")
+ self.error("Authentication failed")
self.errorState = True
return None
@@ -236,14 +236,14 @@ class sfp_networksdb(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from NetworksDB: {e}")
+ self.error(f"Error processing JSON response from NetworksDB: {e}")
return None
if data.get('warning'):
- self.sf.debug("Received warning from NetworksDB: " + data.get('warning'))
+ self.debug("Received warning from NetworksDB: " + data.get('warning'))
if data.get('error'):
- self.sf.error("Received error from NetworksDB: " + data.get('error'))
+ self.error("Received error from NetworksDB: " + data.get('error'))
return data
@@ -260,19 +260,19 @@ class sfp_networksdb(SpiderFootPlugin):
return
if self.opts['api_key'] == '':
- self.sf.error("You enabled sfp_networksdb but did not set an API key!")
+ self.error("You enabled sfp_networksdb but did not set an API key!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName in ["IP_ADDRESS", "IPV6_ADDRESS"]:
data = self.queryIpInfo(eventData)
if data is None:
- self.sf.debug("No IP address information found for " + eventData)
+ self.debug("No IP address information found for " + eventData)
else:
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
self.notifyListeners(evt)
@@ -290,7 +290,7 @@ class sfp_networksdb(SpiderFootPlugin):
data = self.queryIpGeo(eventData)
if data is None:
- self.sf.debug("No IP geolocation information found for " + eventData)
+ self.debug("No IP geolocation information found for " + eventData)
else:
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
self.notifyListeners(evt)
@@ -305,7 +305,7 @@ class sfp_networksdb(SpiderFootPlugin):
cohosts = list()
if data is None:
- self.sf.debug("No reverse DNS results for " + eventData)
+ self.debug("No reverse DNS results for " + eventData)
else:
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
self.notifyListeners(evt)
@@ -323,7 +323,7 @@ class sfp_networksdb(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.validateIP(co, eventData):
- self.sf.debug("Host " + co + " no longer resolves to " + eventData)
+ self.debug("Host " + co + " no longer resolves to " + eventData)
continue
if not self.opts['cohostsamedomain']:
@@ -344,13 +344,13 @@ class sfp_networksdb(SpiderFootPlugin):
data = self.queryForwardDns(eventData)
if data is None:
- self.sf.debug("No forward DNS results for " + eventData)
+ self.debug("No forward DNS results for " + eventData)
return
res = data.get('results')
if not res:
- self.sf.debug("No forward DNS results for " + eventData)
+ self.debug("No forward DNS results for " + eventData)
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(res), self.__name__, event)
diff --git a/modules/sfp_neutrinoapi.py b/modules/sfp_neutrinoapi.py
index 496aa4e3..e5ef5112 100644
--- a/modules/sfp_neutrinoapi.py
+++ b/modules/sfp_neutrinoapi.py
@@ -131,7 +131,7 @@ class sfp_neutrinoapi(SpiderFootPlugin):
# Parse API response
def parseApiResponse(self, res):
if res['code'] == "403":
- self.sf.error("Authentication failed")
+ self.error("Authentication failed")
self.errorState = True
return None
@@ -141,17 +141,17 @@ class sfp_neutrinoapi(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if res['code'] == "400":
if data.get('api-error-msg'):
- self.sf.error("Error: " + data.get('api-error-msg'))
+ self.error("Error: " + data.get('api-error-msg'))
if "EXCEED" in data.get('api-error-msg'):
self.errorState = True
return None
else:
- self.sf.error("Error: HTTP 400")
+ self.error("Error: HTTP 400")
return None
return data
@@ -169,24 +169,24 @@ class sfp_neutrinoapi(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_neutrinoapi but did not set an API key!")
+ self.error("You enabled sfp_neutrinoapi but did not set an API key!")
self.errorState = True
return
if self.opts['user_id'] == "":
- self.sf.error("You enabled sfp_neutrinoapi but did not set a user ID!")
+ self.error("You enabled sfp_neutrinoapi but did not set a user ID!")
self.errorState = True
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == 'PHONE_NUMBER':
data = self.queryPhoneValidate(eventData)
if data is None:
- self.sf.debug("No phone info results found for " + eventData)
+ self.debug("No phone info results found for " + eventData)
else:
if data.get('location') is not None and data.get('country') is not None:
if data.get('location') == data.get('country'):
@@ -203,7 +203,7 @@ class sfp_neutrinoapi(SpiderFootPlugin):
data = self.queryIpInfo(eventData)
if data is None:
- self.sf.debug("No IP info results found for " + eventData)
+ self.debug("No IP info results found for " + eventData)
else:
if data.get('city') is not None and data.get('region') is not None and data.get('country-code') is not None:
location = data.get('city') + ', ' + data.get('region') + ', ' + data.get('country-code')
@@ -213,7 +213,7 @@ class sfp_neutrinoapi(SpiderFootPlugin):
data = self.queryIpBlocklist(eventData)
if data is None:
- self.sf.debug("No IP blocklist results found for " + eventData)
+ self.debug("No IP blocklist results found for " + eventData)
else:
if data.get('is-listed'):
evt = SpiderFootEvent("MALICIOUS_IPADDR", "NeutrinoAPI [" + eventData + "]", self.__name__, event)
@@ -224,7 +224,7 @@ class sfp_neutrinoapi(SpiderFootPlugin):
data = self.queryHostReputation(eventData)
if data is None:
- self.sf.debug("No host reputation results found for " + eventData)
+ self.debug("No host reputation results found for " + eventData)
else:
if data.get('is-listed'):
evt = SpiderFootEvent("MALICIOUS_IPADDR", "NeutrinoAPI [" + eventData + "]", self.__name__, event)
diff --git a/modules/sfp_numverify.py b/modules/sfp_numverify.py
index 149ae4b2..70fa8f18 100644
--- a/modules/sfp_numverify.py
+++ b/modules/sfp_numverify.py
@@ -99,32 +99,32 @@ class sfp_numverify(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.debug('No response from apilayer.net')
+ self.debug('No response from apilayer.net')
return None
if res['code'] == '101':
- self.sf.error('API error: invalid API key')
+ self.error('API error: invalid API key')
self.errorState = True
return None
if res['code'] == '102':
- self.sf.error('API error: user account deactivated')
+ self.error('API error: user account deactivated')
self.errorState = True
return None
if res['code'] == '104':
- self.sf.error('API error: usage limit exceeded')
+ self.error('API error: usage limit exceeded')
self.errorState = True
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if data.get('error') is not None:
- self.sf.error('API error: ' + str(data.get('error')))
+ self.error('API error: ' + str(data.get('error')))
return None
return data
@@ -139,7 +139,7 @@ class sfp_numverify(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_numverify but did not set an API key!")
+ self.error("You enabled sfp_numverify but did not set an API key!")
self.errorState = True
return
@@ -148,12 +148,12 @@ class sfp_numverify(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.query(eventData)
if data is None:
- self.sf.debug("No phone information found for " + eventData)
+ self.debug("No phone information found for " + eventData)
return
evt = SpiderFootEvent("RAW_RIR_DATA", str(data), self.__name__, event)
@@ -165,12 +165,12 @@ class sfp_numverify(SpiderFootPlugin):
evt = SpiderFootEvent("GEOINFO", location, self.__name__, event)
self.notifyListeners(evt)
else:
- self.sf.debug("No location information found for " + eventData)
+ self.debug("No location information found for " + eventData)
if data.get('carrier'):
evt = SpiderFootEvent("PROVIDER_TELCO", data.get('carrier'), self.__name__, event)
self.notifyListeners(evt)
else:
- self.sf.debug("No carrier information found for " + eventData)
+ self.debug("No carrier information found for " + eventData)
# End of sfp_numverify class
diff --git a/modules/sfp_onioncity.py b/modules/sfp_onioncity.py
index 75a38c6e..0e6e511f 100644
--- a/modules/sfp_onioncity.py
+++ b/modules/sfp_onioncity.py
@@ -95,15 +95,15 @@ class sfp_onioncity(SpiderFootPlugin):
if not self.opts['fullnames'] and eventName == 'HUMAN_NAME':
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_onioncity but did not set a Google API key!")
+ self.error("You enabled sfp_onioncity but did not set a Google API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Already did a search for {eventData}, skipping.")
+ self.debug(f"Already did a search for {eventData}, skipping.")
return
self.results[eventData] = True
@@ -142,7 +142,7 @@ class sfp_onioncity(SpiderFootPlugin):
)
self.notifyListeners(evt)
else:
- self.sf.error("Failed to fetch Google web search URL")
+ self.error("Failed to fetch Google web search URL")
# Check if we've been asked to stop
if self.checkForStop():
@@ -153,7 +153,7 @@ class sfp_onioncity(SpiderFootPlugin):
]
for link in darknet_links:
- self.sf.debug("Found a darknet mention: " + link)
+ self.debug("Found a darknet mention: " + link)
torlink = link.replace(".onion.link", ".onion")
if self.opts['fetchlinks']:
res = self.sf.fetchUrl(torlink, timeout=self.opts['_fetchtimeout'],
@@ -161,13 +161,13 @@ class sfp_onioncity(SpiderFootPlugin):
verify=False)
if res['content'] is None:
- self.sf.debug("Ignoring " + link + " as no data returned")
+ self.debug("Ignoring " + link + " as no data returned")
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:
- self.sf.debug("Ignoring " + link + " as no mention of " + eventData)
+ self.debug("Ignoring " + link + " as no mention of " + eventData)
continue
evt = SpiderFootEvent("DARKNET_MENTION_URL", torlink, self.__name__, event)
@@ -177,7 +177,7 @@ class sfp_onioncity(SpiderFootPlugin):
startIndex = res['content'].index(eventData) - 120
endIndex = startIndex + len(eventData) + 240
except Exception:
- self.sf.debug("String not found in content.")
+ self.debug("String not found in content.")
continue
data = res['content'][startIndex:endIndex]
diff --git a/modules/sfp_onionsearchengine.py b/modules/sfp_onionsearchengine.py
index c6fdb6a3..4c41fd2c 100644
--- a/modules/sfp_onionsearchengine.py
+++ b/modules/sfp_onionsearchengine.py
@@ -86,7 +86,7 @@ class sfp_onionsearchengine(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug("Already did a search for " + eventData + ", skipping.")
+ self.debug("Already did a search for " + eventData + ", skipping.")
return
self.results[eventData] = True
@@ -110,7 +110,7 @@ class sfp_onionsearchengine(SpiderFootPlugin):
timeout=self.opts['timeout'])
if data is None or not data.get('content'):
- self.sf.info("No results returned from onionsearchengine.com.")
+ self.info("No results returned from onionsearchengine.com.")
return
page += 1
@@ -144,12 +144,12 @@ class sfp_onionsearchengine(SpiderFootPlugin):
blacklist = False
for r in self.opts['blacklist']:
if re.match(r, link, re.IGNORECASE):
- self.sf.debug("Skipping " + link + " as it matches blacklist " + r)
+ self.debug("Skipping " + link + " as it matches blacklist " + r)
blacklist = True
if blacklist:
continue
- self.sf.debug("Found a darknet mention: " + link)
+ self.debug("Found a darknet mention: " + link)
if not self.sf.urlFQDN(link).endswith(".onion"):
continue
@@ -165,11 +165,11 @@ class sfp_onionsearchengine(SpiderFootPlugin):
verify=False)
if res['content'] is None:
- self.sf.debug("Ignoring " + link + " as no data returned")
+ self.debug("Ignoring " + link + " as no data returned")
continue
if eventData not in res['content']:
- self.sf.debug("Ignoring " + link + " as no mention of " + eventData)
+ self.debug("Ignoring " + link + " as no mention of " + eventData)
continue
evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)
@@ -179,7 +179,7 @@ class sfp_onionsearchengine(SpiderFootPlugin):
startIndex = res['content'].index(eventData) - 120
endIndex = startIndex + len(eventData) + 240
except Exception:
- self.sf.debug('String "' + eventData + '" not found in content.')
+ self.debug('String "' + eventData + '" not found in content.')
continue
data = res['content'][startIndex:endIndex]
diff --git a/modules/sfp_onyphe.py b/modules/sfp_onyphe.py
index df9678c0..8739da72 100644
--- a/modules/sfp_onyphe.py
+++ b/modules/sfp_onyphe.py
@@ -112,29 +112,29 @@ class sfp_onyphe(SpiderFootPlugin):
)
if res["code"] == "429":
- self.sf.error("Reaching rate limit on Onyphe API")
+ self.error("Reaching rate limit on Onyphe API")
self.errorState = True
return None
if res["code"] == 400:
- self.sf.error("Invalid request or API key on Onyphe")
+ self.error("Invalid request or API key on Onyphe")
self.errorState = True
return None
try:
info = json.loads(res["content"])
if "status" in info and info["status"] == "nok":
- self.sf.error(
+ self.error(
f"Unexpected error happened while requesting data from Onyphe. Error message: {info.get('text', '')}"
)
self.errorState = True
return None
elif "results" not in info or info["results"] == []:
- self.sf.info(f"No Onyphe {endpoint} data found for {ip}")
+ self.info(f"No Onyphe {endpoint} data found for {ip}")
return None
except Exception as e:
- self.sf.debug(f"{e.__class__} {res['code']} {res['content']}")
- self.sf.error("Error processing JSON response from Onyphe.")
+ self.debug(f"{e.__class__} {res['code']} {res['content']}")
+ self.error("Error processing JSON response from Onyphe.")
return None
# Go through other pages if user has paid plan
@@ -148,7 +148,7 @@ class sfp_onyphe(SpiderFootPlugin):
page = current_page + 1
if page > self.opts["max_page"]:
- self.sf.error(
+ self.error(
"Maximum number of pages from options for Onyphe reached."
)
return [info]
@@ -160,7 +160,7 @@ class sfp_onyphe(SpiderFootPlugin):
retarr.append(info)
except ValueError:
- self.sf.error(
+ self.error(
f"Unexpected value for page in response from Onyphe, url: https://www.onyphe.io/api/v2/simple/{endpoint}/{ip}?page={page}"
)
self.errorState = True
@@ -171,7 +171,7 @@ class sfp_onyphe(SpiderFootPlugin):
def emitLocationEvent(self, location, eventData, event):
if location is None:
return
- self.sf.info(f"Found location for {eventData}: {location}")
+ self.info(f"Found location for {eventData}: {location}")
evt = SpiderFootEvent("PHYSICAL_COORDINATES", location, self.__name__, event)
self.notifyListeners(evt)
@@ -206,12 +206,12 @@ class sfp_onyphe(SpiderFootPlugin):
if self.cohostcount < self.opts['maxcohost']:
if self.opts["verify"] and not self.sf.validateIP(domain, eventData):
- self.sf.debug("Host no longer resolves to our IP.")
+ self.debug("Host no longer resolves to our IP.")
continue
if not self.opts["cohostsamedomain"]:
if self.getTarget().matches(domain, includeParents=True):
- self.sf.debug(
+ self.debug(
"Skipping " + domain + " because it is on the same domain."
)
continue
@@ -227,7 +227,7 @@ class sfp_onyphe(SpiderFootPlugin):
timestamp = result.get("@timestamp")
if timestamp is None:
- self.sf.debug("Record doesn't have timestamp defined")
+ self.debug("Record doesn't have timestamp defined")
return False
last_dt = datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%fZ")
@@ -235,7 +235,7 @@ class sfp_onyphe(SpiderFootPlugin):
age_limit_ts = int(time.time()) - (86400 * limit)
if last_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({last_dt}), skipping.")
+ self.debug("Record found but too old, skipping.")
return False
return True
@@ -250,15 +250,15 @@ class sfp_onyphe(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.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!")
+ self.error("You enabled sfp_onyphe, but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already mapped.")
+ self.debug("Skipping " + eventData + " as already mapped.")
return
self.results[eventData] = True
@@ -289,10 +289,10 @@ class sfp_onyphe(SpiderFootPlugin):
if _f
]
)
- self.sf.info("Found GeoIP for " + eventData + ": " + location)
+ self.info("Found GeoIP for " + eventData + ": " + location)
if location in sentData:
- self.sf.debug(f"Skipping {location}, already sent")
+ self.debug(f"Skipping {location}, already sent")
continue
sentData.add(location)
@@ -305,7 +305,7 @@ class sfp_onyphe(SpiderFootPlugin):
continue
if coordinates in sentData:
- self.sf.debug(f"Skipping {coordinates}, already sent")
+ self.debug(f"Skipping {coordinates}, already sent")
continue
sentData.add(coordinates)
@@ -331,7 +331,7 @@ class sfp_onyphe(SpiderFootPlugin):
continue
if pastry in sentData:
- self.sf.debug(f"Skipping {pastry}, already sent")
+ self.debug(f"Skipping {pastry}, already sent")
continue
sentData.add(pastry)
@@ -362,7 +362,7 @@ class sfp_onyphe(SpiderFootPlugin):
continue
if threatList in sentData:
- self.sf.debug(f"Skipping {threatList}, already sent")
+ self.debug(f"Skipping {threatList}, already sent")
continue
sentData.add(threatList)
@@ -398,7 +398,7 @@ class sfp_onyphe(SpiderFootPlugin):
cveData = ", ".join([cve for cve in cves if cve])
if cveData in sentData:
- self.sf.debug(f"Skipping {cveData}, already sent")
+ self.debug(f"Skipping {cveData}, already sent")
continue
sentData.add(cveData)
diff --git a/modules/sfp_open_passive_dns_database.py b/modules/sfp_open_passive_dns_database.py
index 584d9315..af9ece16 100644
--- a/modules/sfp_open_passive_dns_database.py
+++ b/modules/sfp_open_passive_dns_database.py
@@ -86,17 +86,17 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
time.sleep(1)
if res['code'] != "200":
- self.sf.debug("Error retrieving search results.")
+ self.debug("Error retrieving search results.")
return None
if res['content'] is None:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
rows = re.findall(r'<tr>(.+?)</tr>', str(res['content']), re.DOTALL)
if not rows:
- self.sf.debug("No passive DNS results for " + qry)
+ self.debug("No passive DNS results for " + qry)
return None
data = list()
@@ -109,12 +109,12 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
continue
if len(columns) != 7:
- self.sf.error("Unexpected number of columns for row. Expected 7, Found " + str(len(columns)))
+ self.error("Unexpected number of columns for row. Expected 7, Found " + str(len(columns)))
continue
data.append(columns)
- self.sf.info("Retrieved " + str(len(data)) + " DNS records")
+ self.info("Retrieved " + str(len(data)) + " DNS records")
return data
@@ -128,21 +128,21 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
return
if srcModuleName == "sfp_open_passive_dns_database":
- self.sf.debug("Ignoring " + eventName + ", from self.")
+ self.debug("Ignoring " + eventName + ", from self.")
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.query(eventData)
if data is None or len(data) == 0:
- self.sf.info("No passive DNS data found for " + eventData)
+ self.info("No passive DNS data found for " + eventData)
return
domains = list()
@@ -199,11 +199,11 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
continue
if not self.sf.validIP(answer):
- self.sf.debug("Skipping invalid IP address " + answer)
+ self.debug("Skipping invalid IP address " + answer)
continue
if self.opts['verify'] and not self.sf.validateIP(query, answer):
- self.sf.debug("Host " + query + " no longer resolves to " + answer)
+ self.debug("Host " + query + " no longer resolves to " + answer)
continue
evt = SpiderFootEvent("IP_ADDRESS", answer, self.__name__, event)
@@ -214,11 +214,11 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
continue
if not self.sf.validIP6(answer):
- self.sf.debug("Skipping invalid IPv6 address " + answer)
+ self.debug("Skipping invalid IPv6 address " + answer)
continue
if self.opts['verify'] and not self.sf.validateIP(query, answer):
- self.sf.debug("Host " + query + " no longer resolves to " + answer)
+ self.debug("Host " + query + " no longer resolves to " + answer)
continue
evt = SpiderFootEvent("IPV6_ADDRESS", answer, self.__name__, event)
@@ -235,7 +235,7 @@ class sfp_open_passive_dns_database(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.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_openbugbounty.py b/modules/sfp_openbugbounty.py
index 17a0a609..7531ad85 100644
--- a/modules/sfp_openbugbounty.py
+++ b/modules/sfp_openbugbounty.py
@@ -79,7 +79,7 @@ class sfp_openbugbounty(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=30, useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug("No content returned from openbugbounty.org")
+ self.debug("No content returned from openbugbounty.org")
return None
try:
@@ -89,7 +89,7 @@ class sfp_openbugbounty(SpiderFootPlugin):
if m[1] == qry or m[1].endswith("." + qry):
ret.append("From openbugbounty.org: <SFURL>" + base + m[0] + "</SFURL>")
except Exception as e:
- self.sf.error("Error processing response from openbugbounty.org: " + str(e))
+ self.error("Error processing response from openbugbounty.org: " + str(e))
return None
return ret
@@ -100,10 +100,10 @@ class sfp_openbugbounty(SpiderFootPlugin):
eventData = event.data
data = list()
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_opencorporates.py b/modules/sfp_opencorporates.py
index 6ded4e7b..034008c4 100644
--- a/modules/sfp_opencorporates.py
+++ b/modules/sfp_opencorporates.py
@@ -103,17 +103,17 @@ class sfp_opencorporates(SpiderFootPlugin):
)
if res['code'] == "401":
- self.sf.error("Invalid OpenCorporates API key.")
+ self.error("Invalid OpenCorporates API key.")
return None
if res['code'] == "403":
- self.sf.error("You are being rate-limited by OpenCorporates.")
+ self.error("You are being rate-limited by OpenCorporates.")
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if 'results' not in data:
@@ -134,17 +134,17 @@ class sfp_opencorporates(SpiderFootPlugin):
)
if res['code'] == "401":
- self.sf.error("Invalid OpenCorporates API key.")
+ self.error("Invalid OpenCorporates API key.")
return None
if res['code'] == "403":
- self.sf.error("You are being rate-limited by OpenCorporates.")
+ self.error("You are being rate-limited by OpenCorporates.")
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if 'results' not in data:
@@ -160,7 +160,7 @@ class sfp_opencorporates(SpiderFootPlugin):
if location:
if len(location) < 3 or len(location) > 100:
- self.sf.debug("Skipping likely invalid location.")
+ self.debug("Skipping likely invalid location.")
else:
if company.get('registered_address'):
country = company.get('registered_address').get('country')
@@ -169,7 +169,7 @@ class sfp_opencorporates(SpiderFootPlugin):
location += ", " + country
location = location.replace("\n", ',')
- self.sf.info("Found company address: " + location)
+ self.info("Found company address: " + location)
e = SpiderFootEvent("PHYSICAL_ADDRESS", location, self.__name__, sevt)
self.notifyListeners(e)
@@ -180,7 +180,7 @@ class sfp_opencorporates(SpiderFootPlugin):
for previous_name in previous_names:
p = previous_name.get('company_name')
if p:
- self.sf.info("Found previous company name: " + p)
+ self.info("Found previous company name: " + p)
e = SpiderFootEvent("COMPANY_NAME", p, self.__name__, sevt)
self.notifyListeners(e)
@@ -191,7 +191,7 @@ class sfp_opencorporates(SpiderFootPlugin):
for officer in officers:
n = officer.get('name')
if n:
- self.sf.info("Found company officer: " + n)
+ self.info("Found company officer: " + n)
e = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + n, self.__name__, sevt)
self.notifyListeners(e)
@@ -201,26 +201,26 @@ class sfp_opencorporates(SpiderFootPlugin):
eventData = event.data
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == '':
- self.sf.error(f"Warning: You enabled {self.__class__.__name__} but did not set an API key! Queries will be limited to 50 per day and 200 per month.")
+ self.error(f"Warning: You enabled {self.__class__.__name__} but did not set an API key! Queries will be limited to 50 per day and 200 per month.")
res = self.searchCompany(f"{eventData}*")
if res is None:
- self.sf.debug("Found no results for " + eventData)
+ self.debug("Found no results for " + eventData)
return
companies = res.get('companies')
if not companies:
- self.sf.debug("Found no results for " + eventData)
+ self.debug("Found no results for " + eventData)
return
for c in companies:
diff --git a/modules/sfp_opendns.py b/modules/sfp_opendns.py
index 00c399af..04c95095 100644
--- a/modules/sfp_opendns.py
+++ b/modules/sfp_opendns.py
@@ -75,9 +75,9 @@ class sfp_opendns(SpiderFootPlugin):
try:
addrs = res.resolve(qaddr)
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
except Exception:
- self.sf.debug(f"Unable to resolve {qaddr}")
+ self.debug(f"Unable to resolve {qaddr}")
return False
if addrs:
@@ -92,7 +92,7 @@ class sfp_opendns(SpiderFootPlugin):
parentEvent = event
resolved = False
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_openphish.py b/modules/sfp_openphish.py
index f8c4d5a5..9cf03692 100644
--- a/modules/sfp_openphish.py
+++ b/modules/sfp_openphish.py
@@ -85,7 +85,7 @@ class sfp_openphish(SpiderFootPlugin):
return False
if target.lower() in blacklist:
- self.sf.debug(f"Host name {target} found in OpenPhish blacklist.")
+ self.debug(f"Host name {target} found in OpenPhish blacklist.")
return True
return False
@@ -103,12 +103,12 @@ class sfp_openphish(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from OpenPhish.")
+ self.error(f"Unexpected HTTP response code {res['code']} from OpenPhish.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from OpenPhish")
+ self.error("Received no content from OpenPhish")
self.errorState = True
return None
@@ -155,10 +155,10 @@ class sfp_openphish(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -179,7 +179,7 @@ class sfp_openphish(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with OpenPhish")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with OpenPhish")
if self.queryBlacklist(eventData):
url = "https://www.openphish.com/feed.txt"
diff --git a/modules/sfp_openstreetmap.py b/modules/sfp_openstreetmap.py
index ca73fb21..6dbbf7ed 100644
--- a/modules/sfp_openstreetmap.py
+++ b/modules/sfp_openstreetmap.py
@@ -79,13 +79,13 @@ class sfp_openstreetmap(SpiderFootPlugin):
timeout=self.opts['_fetchtimeout'], useragent='SpiderFoot')
if res['content'] is None:
- self.sf.info("No location info found for " + qry)
+ self.info("No location info found for " + qry)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -95,10 +95,10 @@ class sfp_openstreetmap(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -107,7 +107,7 @@ class sfp_openstreetmap(SpiderFootPlugin):
# Skip post office boxes
if address.lower().startswith('po box'):
- self.sf.debug("Skipping PO BOX address")
+ self.debug("Skipping PO BOX address")
return
rx1 = re.compile(r'^(c/o|care of|attn:|attention:)\s+[0-9a-z\s\.]', flags=re.IGNORECASE)
@@ -125,24 +125,24 @@ class sfp_openstreetmap(SpiderFootPlugin):
time.sleep(1)
if data is None:
- self.sf.debug("Found no results for " + eventData)
+ self.debug("Found no results for " + eventData)
return
- self.sf.info("Found " + str(len(data)) + " matches for " + eventData)
+ self.info("Found " + str(len(data)) + " matches for " + eventData)
for location in data:
try:
lat = location.get('lat')
lon = location.get('lon')
except Exception as e:
- self.sf.debug("Failed to get lat/lon: " + str(e))
+ self.debug("Failed to get lat/lon: " + str(e))
continue
if not lat or not lon:
continue
coords = str(lat) + "," + str(lon)
- self.sf.debug("Found coordinates: " + coords)
+ self.debug("Found coordinates: " + coords)
evt = SpiderFootEvent("PHYSICAL_COORDINATES", coords, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_pageinfo.py b/modules/sfp_pageinfo.py
index 2c8846c7..811df01b 100644
--- a/modules/sfp_pageinfo.py
+++ b/modules/sfp_pageinfo.py
@@ -69,7 +69,7 @@ class sfp_pageinfo(SpiderFootPlugin):
# because the spidering module will always provide events with the
# event.sourceEvent.data set to the URL of the source.
if "sfp_spider" not in event.module:
- self.sf.debug("Ignoring web content from " + event.module)
+ self.debug("Ignoring web content from " + event.module)
return
eventName = event.eventType
@@ -77,25 +77,25 @@ class sfp_pageinfo(SpiderFootPlugin):
eventData = event.data
eventSource = event.actualSource
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# We aren't interested in describing pages that are not hosted on
# our base domain.
if not self.getTarget().matches(self.sf.urlFQDN(eventSource)):
- self.sf.debug("Not gathering page info for external site " + eventSource)
+ self.debug("Not gathering page info for external site " + eventSource)
return
# Ignore javascript and CSS
if ".css?" in eventSource or eventSource.endswith(".css"):
- self.sf.debug("Not attempting to match CSS content.")
+ self.debug("Not attempting to match CSS content.")
return
if ".js?" in eventSource or eventSource.endswith(".js"):
- self.sf.debug("Not attempting to match JS content.")
+ self.debug("Not attempting to match JS content.")
return
if eventSource in self.results:
- self.sf.debug("Already checked this page for a page type, skipping.")
+ self.debug("Already checked this page for a page type, skipping.")
return
self.results[eventSource] = list()
@@ -109,14 +109,14 @@ class sfp_pageinfo(SpiderFootPlugin):
rx = re.compile(regex, re.IGNORECASE)
matches = re.findall(rx, eventData)
if len(matches) > 0 and regexpGrp not in self.results[eventSource]:
- self.sf.info("Matched " + regexpGrp + " in content from " + eventSource)
+ self.info("Matched " + regexpGrp + " in content from " + eventSource)
self.results[eventSource] = self.results[eventSource] + [regexpGrp]
evt = SpiderFootEvent(regexpGrp, eventSource, self.__name__, event)
self.notifyListeners(evt)
# If no regexps were matched, consider this a static page
if len(self.results[eventSource]) == 0:
- self.sf.info("Treating " + eventSource + " as URL_STATIC")
+ self.info("Treating " + eventSource + " as URL_STATIC")
evt = SpiderFootEvent("URL_STATIC", eventSource, self.__name__, event)
self.notifyListeners(evt)
@@ -131,7 +131,7 @@ class sfp_pageinfo(SpiderFootPlugin):
continue
if self.getTarget().matches(self.sf.urlFQDN(match)):
continue
- self.sf.debug(f"Externally hosted JavaScript found at: {match}")
+ self.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 31923c8e..ded75adf 100644
--- a/modules/sfp_pastebin.py
+++ b/modules/sfp_pastebin.py
@@ -91,7 +91,7 @@ class sfp_pastebin(SpiderFootPlugin):
return
if self.opts['api_key'] == "":
- self.sf.error(f"You enabled {self.__class__.__name__} but did not set a Google API key!")
+ self.error(f"You enabled {self.__class__.__name__} but did not set a Google API key!")
self.errorState = True
return
@@ -128,7 +128,7 @@ class sfp_pastebin(SpiderFootPlugin):
]
for link in relevant_links:
- self.sf.debug("Found a link: " + link)
+ self.debug("Found a link: " + link)
if self.checkForStop():
return
@@ -137,7 +137,7 @@ class sfp_pastebin(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug(f"Ignoring {link} as no data returned")
+ self.debug(f"Ignoring {link} as no data returned")
continue
if re.search(
diff --git a/modules/sfp_pgp.py b/modules/sfp_pgp.py
index af4f3cb5..dbb0731a 100644
--- a/modules/sfp_pgp.py
+++ b/modules/sfp_pgp.py
@@ -74,7 +74,7 @@ class sfp_pgp(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Get e-mail addresses on this domain
if eventName in ["DOMAIN_NAME", "INTERNET_NAME"]:
@@ -99,7 +99,7 @@ class sfp_pgp(SpiderFootPlugin):
if not self.getTarget().matches(mailDom):
evttype = "AFFILIATE_EMAILADDR"
- self.sf.info("Found e-mail address: " + email)
+ self.info("Found e-mail address: " + email)
evt = SpiderFootEvent(evttype, email, self.__name__, event)
self.notifyListeners(evt)
@@ -117,9 +117,9 @@ class sfp_pgp(SpiderFootPlugin):
pat = re.compile("(-----BEGIN.*END.*BLOCK-----)", re.MULTILINE | re.DOTALL)
matches = re.findall(pat, str(res['content']))
for match in matches:
- self.sf.debug("Found public key: " + match)
+ self.debug("Found public key: " + match)
if len(match) < 300:
- self.sf.debug("Likely invalid public key.")
+ self.debug("Likely invalid public key.")
continue
evt = SpiderFootEvent("PGP_KEY", match, self.__name__, event)
diff --git a/modules/sfp_phishstats.py b/modules/sfp_phishstats.py
index 73d79e5d..78bebf64 100644
--- a/modules/sfp_phishstats.py
+++ b/modules/sfp_phishstats.py
@@ -107,13 +107,13 @@ class sfp_phishstats(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.debug("No information found from Phishstats for IP Address")
+ self.debug("No information found from Phishstats for IP Address")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response: {e}")
+ self.error(f"Error processing JSON response: {e}")
return None
# Handle events sent to this module
@@ -125,11 +125,11 @@ class sfp_phishstats(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -139,9 +139,9 @@ class sfp_phishstats(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -149,9 +149,9 @@ class sfp_phishstats(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
qrylist = list()
@@ -185,7 +185,7 @@ class sfp_phishstats(SpiderFootPlugin):
continue
if addr != maliciousIP:
- self.sf.error("Reported address doesn't match requested, skipping")
+ self.error("Reported address doesn't match requested, skipping")
continue
# Data is reported about the IP Address
diff --git a/modules/sfp_phishtank.py b/modules/sfp_phishtank.py
index a792f064..c7460569 100644
--- a/modules/sfp_phishtank.py
+++ b/modules/sfp_phishtank.py
@@ -84,7 +84,7 @@ class sfp_phishtank(SpiderFootPlugin):
if not item:
continue
if target.lower() in item[1]:
- self.sf.debug(f"Host name {target} found in phishtank.com blacklist.")
+ self.debug(f"Host name {target} found in phishtank.com blacklist.")
return item[0]
return None
@@ -102,12 +102,12 @@ class sfp_phishtank(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from phishtank.com.")
+ self.error(f"Unexpected HTTP response code {res['code']} from phishtank.com.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from phishtank.com")
+ self.error("Received no content from phishtank.com")
self.errorState = True
return None
@@ -154,10 +154,10 @@ class sfp_phishtank(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -178,7 +178,7 @@ class sfp_phishtank(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with phishtank.com")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with phishtank.com")
phish_id = self.queryBlacklist(eventData)
if phish_id:
diff --git a/modules/sfp_phone.py b/modules/sfp_phone.py
index 5ee23f93..aee747dc 100644
--- a/modules/sfp_phone.py
+++ b/modules/sfp_phone.py
@@ -58,7 +58,7 @@ class sfp_phone(SpiderFootPlugin):
self.results[sourceData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName in ['TARGET_WEB_CONTENT', 'DOMAIN_WHOIS', 'NETBLOCK_WHOIS']:
# Make potential phone numbers more friendly to parse
@@ -77,17 +77,17 @@ class sfp_phone(SpiderFootPlugin):
try:
number = phonenumbers.parse(eventData)
except Exception as e:
- self.sf.debug(f"Error parsing phone number: {e}")
+ self.debug(f"Error parsing phone number: {e}")
return
try:
number_carrier = carrier.name_for_number(number, 'en')
except Exception as e:
- self.sf.debug(f"Error retrieving phone number carrier: {e}")
+ self.debug(f"Error retrieving phone number carrier: {e}")
return
if not number_carrier:
- self.sf.debug(f"No carrier information found for {eventData}")
+ self.debug(f"No carrier information found for {eventData}")
return
evt = SpiderFootEvent("PROVIDER_TELCO", number_carrier, self.__name__, event)
@@ -102,13 +102,13 @@ class sfp_phone(SpiderFootPlugin):
# try:
# location = geocoder.description_for_number(number, 'en')
# except Exception as e:
- # self.sf.debug('Error retrieving phone number location: ' + str(e))
+ # self.debug('Error retrieving phone number location: ' + str(e))
# return
# if location:
# evt = SpiderFootEvent("GEOINFO", location, self.__name__, event)
# self.notifyListeners(evt)
# else:
- # self.sf.debug("No location information found for " + eventData)
+ # self.debug("No location information found for " + eventData)
# End of sfp_phone class
diff --git a/modules/sfp_portscan_tcp.py b/modules/sfp_portscan_tcp.py
index cd9bbaf2..3df9e8cf 100644
--- a/modules/sfp_portscan_tcp.py
+++ b/modules/sfp_portscan_tcp.py
@@ -79,7 +79,7 @@ class sfp_portscan_tcp(SpiderFootPlugin):
if file_ports:
portlist = file_ports.split("\n")
else:
- self.sf.error(f"Could not load ports from {self.opts['ports'][0]}")
+ self.error(f"Could not load ports from {self.opts['ports'][0]}")
else:
portlist = self.opts['ports']
@@ -88,7 +88,7 @@ class sfp_portscan_tcp(SpiderFootPlugin):
try:
self.portlist.append(int(port))
except ValueError:
- self.sf.debug(f"Skipping invalid port '{port}' specified in port list")
+ self.debug(f"Skipping invalid port '{port}' specified in port list")
if self.opts['randomize']:
random.SystemRandom().shuffle(self.portlist)
@@ -132,7 +132,7 @@ class sfp_portscan_tcp(SpiderFootPlugin):
# Spawn threads for scanning
while i < len(portList):
port = portList[i]
- self.sf.info(f"Spawning thread to check port: {port} on {ip}")
+ self.info(f"Spawning thread to check port: {port} on {ip}")
t.append(threading.Thread(name=f"sfp_portscan_tcp_{port}", target=self.tryPort, args=(ip, port)))
t[i].start()
i += 1
@@ -156,7 +156,7 @@ class sfp_portscan_tcp(SpiderFootPlugin):
if not resArray[cp]:
continue
- self.sf.info(f"TCP port {cp} found to be OPEN.")
+ self.info(f"TCP port {cp} found to be OPEN.")
evt = SpiderFootEvent("TCP_PORT_OPEN", cp, self.__name__, srcEvent)
self.notifyListeners(evt)
@@ -174,27 +174,27 @@ class sfp_portscan_tcp(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if not self.portlist:
- self.sf.error('No ports specified in port list')
+ self.error('No ports specified in port list')
self.errorState = True
return
scanIps = list()
if eventName == "NETBLOCK_OWNER":
if not self.opts['netblockscan']:
- self.sf.debug(f"Scanning of owned netblocks is disabled. Skipping netblock {eventData}.")
+ self.debug(f"Scanning of owned netblocks is disabled. Skipping netblock {eventData}.")
return
try:
net = IPNetwork(eventData)
except Exception as e:
- self.sf.error(f"Strange netblock identified, unable to parse: {eventData} ({e})")
+ self.error(f"Strange netblock identified, unable to parse: {eventData} ({e})")
return
if net.prefixlen < self.opts['netblockscanmax']:
- self.sf.debug(f"Skipping port scanning of owned net block {eventData}, too big.")
+ self.debug(f"Skipping port scanning of owned net block {eventData}, too big.")
return
for ip in net:
@@ -209,12 +209,12 @@ class sfp_portscan_tcp(SpiderFootPlugin):
for ipAddr in set(scanIps):
if ipAddr in self.results:
- self.sf.debug(f"Skipping {ipAddr} as already scanned.")
+ self.debug(f"Skipping {ipAddr} as already scanned.")
return
self.results[ipAddr] = True
- self.sf.info(f"Scanning {len(set(self.portlist))} ports on {ipAddr}")
+ self.info(f"Scanning {len(set(self.portlist))} ports on {ipAddr}")
i = 0
portArr = []
diff --git a/modules/sfp_projectdiscovery.py b/modules/sfp_projectdiscovery.py
index 289f498a..e7fb4ab4 100644
--- a/modules/sfp_projectdiscovery.py
+++ b/modules/sfp_projectdiscovery.py
@@ -80,13 +80,13 @@ class sfp_projectdiscovery(SpiderFootPlugin):
)
if res["content"] is None:
- self.sf.info("No DNS info found in chaos projectdiscovery API for " + qry)
+ self.info("No DNS info found in chaos projectdiscovery API for " + qry)
return None
try:
return json.loads(res["content"])
except json.JSONDecodeError as e:
- self.sf.error(
+ self.error(
f"Error processing JSON response from Chaos projectdiscovery: {e}"
)
@@ -101,17 +101,17 @@ class sfp_projectdiscovery(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
"You enabled sfp_projectdiscovery but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -139,7 +139,7 @@ class sfp_projectdiscovery(SpiderFootPlugin):
continue
completeSubdomain = f"{subdomain}.{eventData}"
if self.opts["verify"] and not self.sf.resolveHost(completeSubdomain) and not self.sf.resolveHost6(completeSubdomain):
- self.sf.debug(f"Host {completeSubdomain} could not be resolved")
+ self.debug(f"Host {completeSubdomain} could not be resolved")
evt = SpiderFootEvent(
"INTERNET_NAME_UNRESOLVED", completeSubdomain, self.__name__, event
)
diff --git a/modules/sfp_psbdmp.py b/modules/sfp_psbdmp.py
index f906e954..c8b0b7e4 100644
--- a/modules/sfp_psbdmp.py
+++ b/modules/sfp_psbdmp.py
@@ -70,13 +70,13 @@ class sfp_psbdmp(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=15, useragent="SpiderFoot")
if res['code'] == "403" or res['content'] is None:
- self.sf.info("Unable to fetch data from psbdmp.cc right now.")
+ self.info("Unable to fetch data from psbdmp.cc right now.")
return None
try:
ret = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from psbdmp.cc: {e}")
+ self.error(f"Error processing JSON response from psbdmp.cc: {e}")
return None
ids = list()
@@ -96,10 +96,10 @@ class sfp_psbdmp(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -119,7 +119,7 @@ class sfp_psbdmp(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.debug(f"Ignoring {n} as no data returned")
+ self.debug(f"Ignoring {n} as no data returned")
continue
if re.search(
diff --git a/modules/sfp_pulsedive.py b/modules/sfp_pulsedive.py
index 3aea0f89..b7c135ca 100644
--- a/modules/sfp_pulsedive.py
+++ b/modules/sfp_pulsedive.py
@@ -122,12 +122,12 @@ class sfp_pulsedive(SpiderFootPlugin):
time.sleep(self.opts['delay'])
if res['code'] == '429':
- self.sf.error("You are being rate-limited by Pulsedive")
+ self.error("You are being rate-limited by Pulsedive")
self.errorState = True
return None
if res['code'] == "403":
- self.sf.error("Pulsedive API key seems to have been rejected or you have exceeded usage limits for the month.")
+ self.error("Pulsedive API key seems to have been rejected or you have exceeded usage limits for the month.")
self.errorState = True
return None
@@ -137,7 +137,7 @@ class sfp_pulsedive(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Pulsedive: {e}")
+ self.error(f"Error processing JSON response from Pulsedive: {e}")
return None
@@ -150,16 +150,16 @@ class sfp_pulsedive(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_pulsedive but did not set an API key!")
+ self.error("You enabled sfp_pulsedive but did not set an API key!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -178,7 +178,7 @@ class sfp_pulsedive(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName in ['NETBLOCK_MEMBER', 'NETBLOCKV6_MEMBER']:
@@ -191,7 +191,7 @@ class sfp_pulsedive(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
qrylist = list()
@@ -235,7 +235,7 @@ class sfp_pulsedive(SpiderFootPlugin):
if not threats:
continue
- self.sf.debug(f"Found threat info for {addr} in Pulsedive")
+ self.debug(f"Found threat info for {addr} in Pulsedive")
for result in threats:
descr = addr
@@ -253,10 +253,10 @@ class sfp_pulsedive(SpiderFootPlugin):
created_ts = int(time.mktime(created_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Threat found but too old ({created_dt}), skipping.")
+ self.debug(f"Threat found but too old ({created_dt}), skipping.")
continue
except Exception:
- self.sf.debug("Couldn't parse date from Pulsedive so assuming it's OK.")
+ self.debug("Couldn't parse date from Pulsedive so assuming it's OK.")
e = SpiderFootEvent(evtType, descr, self.__name__, event)
self.notifyListeners(e)
diff --git a/modules/sfp_punkspider.py b/modules/sfp_punkspider.py
index fcc3a7c7..68d4f6d6 100644
--- a/modules/sfp_punkspider.py
+++ b/modules/sfp_punkspider.py
@@ -69,13 +69,13 @@ class sfp_punkspider(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=30, useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug("No content returned from PunkSpider")
+ self.debug("No content returned from PunkSpider")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing response from PunkSpider: {e}")
+ self.error(f"Error processing response from PunkSpider: {e}")
return None
@@ -85,10 +85,10 @@ class sfp_punkspider(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_quad9.py b/modules/sfp_quad9.py
index 3c327add..f945010f 100644
--- a/modules/sfp_quad9.py
+++ b/modules/sfp_quad9.py
@@ -72,9 +72,9 @@ class sfp_quad9(SpiderFootPlugin):
try:
addrs = res.resolve(qry)
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
except Exception:
- self.sf.debug(f"Unable to resolve {qry}")
+ self.debug(f"Unable to resolve {qry}")
return False
if addrs:
@@ -87,7 +87,7 @@ class sfp_quad9(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
diff --git a/modules/sfp_recondev.py b/modules/sfp_recondev.py
index 1836bc07..d48f51d8 100644
--- a/modules/sfp_recondev.py
+++ b/modules/sfp_recondev.py
@@ -99,18 +99,18 @@ class sfp_recondev(SpiderFootPlugin):
def parseAPIResponse(self, res):
# Future proofing - recon.dev does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by Recon.dev")
+ self.error("You are being rate-limited by Recon.dev")
self.errorState = True
return None
if res['code'] == '500':
- self.sf.error("Error during request from either an inproper domain/API key or you have used up all your API credits for the month")
+ self.error("Error during request from either an inproper domain/API key or you have used up all your API credits for the month")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from Recon.dev")
+ self.error("Failed to retrieve content from Recon.dev")
self.errorState = True
return None
@@ -120,15 +120,15 @@ class sfp_recondev(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
# returns list of results; 'null' when no results; or dict when there's an error
if not isinstance(data, list):
- self.sf.error("Failed to retrieve content from Recon.dev")
+ self.error("Failed to retrieve content from Recon.dev")
if isinstance(data, dict) and data.get('message'):
- self.sf.debug(f"Failed to retrieve content from Recon.dev: {data.get('message')}")
+ self.debug(f"Failed to retrieve content from Recon.dev: {data.get('message')}")
self.errorState = True
return None
@@ -147,10 +147,10 @@ class sfp_recondev(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
@@ -162,7 +162,7 @@ class sfp_recondev(SpiderFootPlugin):
data = self.queryDomain(eventData)
if data is None:
- self.sf.debug(f"No information found for domain {eventData}")
+ self.debug(f"No information found for domain {eventData}")
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(data), self.__name__, event)
@@ -187,7 +187,7 @@ class sfp_recondev(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.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_reversewhois.py b/modules/sfp_reversewhois.py
index fff81f1f..8e0b021e 100644
--- a/modules/sfp_reversewhois.py
+++ b/modules/sfp_reversewhois.py
@@ -72,7 +72,7 @@ class sfp_reversewhois(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts.get("_fetchtimeout", 30))
if res["code"] not in ["200"]:
- self.sf.error("You may have exceeded ReverseWhois usage limits.")
+ self.error("You may have exceeded ReverseWhois usage limits.")
self.errorState = True
return ret
@@ -92,13 +92,13 @@ class sfp_reversewhois(SpiderFootPlugin):
if registrar:
registrars.add(registrar)
except IndexError:
- self.sf.debug(f"Invalid row {table_row}")
+ self.debug(f"Invalid row {table_row}")
continue
ret = (list(domains), list(registrars))
if not registrars and not domains:
- self.sf.info(f"No ReverseWhois info found for {qry}")
+ self.info(f"No ReverseWhois info found for {qry}")
return ret
@@ -111,10 +111,10 @@ class sfp_reversewhois(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_ripe.py b/modules/sfp_ripe.py
index 928bb9b8..c324be4f 100644
--- a/modules/sfp_ripe.py
+++ b/modules/sfp_ripe.py
@@ -110,18 +110,18 @@ class sfp_ripe(SpiderFootPlugin):
res = self.fetchRir(f"https://stat.ripe.net/data/network-info/data.json?resource={ipaddr}")
if res['content'] is None:
- self.sf.debug(f"No netblock info found/available for {ipaddr} at RIPE.")
+ self.debug(f"No netblock info found/available for {ipaddr} at RIPE.")
return None
try:
j = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
prefix = j["data"].get("prefix")
if prefix is None:
- self.sf.debug("Could not identify network prefix.")
+ self.debug("Could not identify network prefix.")
return None
return prefix
@@ -130,14 +130,14 @@ class sfp_ripe(SpiderFootPlugin):
def queryWhois(self, qry):
res = self.fetchRir(f"https://stat.ripe.net/data/whois/data.json?resource={qry}")
if res['content'] is None:
- self.sf.debug(f"No results for {qry} at RIPE.")
+ self.debug(f"No results for {qry} at RIPE.")
return None
try:
data = json.loads(res['content'])
return data.get("data")
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -154,7 +154,7 @@ class sfp_ripe(SpiderFootPlugin):
else:
data = whois["records"][0]
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
asn = None
@@ -178,7 +178,7 @@ class sfp_ripe(SpiderFootPlugin):
try:
data = whois["records"]
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
ownerinfo = dict()
@@ -201,28 +201,28 @@ class sfp_ripe(SpiderFootPlugin):
else:
ownerinfo[key] = [value]
- self.sf.debug(f"Found AS owner info: {ownerinfo}")
+ self.debug(f"Found AS owner info: {ownerinfo}")
return ownerinfo
# Netblocks owned by an AS
def asNetblocks(self, asn):
res = self.fetchRir(f"https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS{asn}")
if res['content'] is None:
- self.sf.debug(f"No netblocks info found/available for AS{asn} at RIPE.")
+ self.debug(f"No netblocks info found/available for AS{asn} at RIPE.")
return None
try:
j = json.loads(res['content'])
data = j["data"]["prefixes"]
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
netblocks = list()
for rec in data:
prefix = rec["prefix"]
netblocks.append(rec["prefix"])
- self.sf.info(f"Additional netblock found from same AS: {prefix}")
+ self.info(f"Additional netblock found from same AS: {prefix}")
return netblocks
@@ -230,14 +230,14 @@ class sfp_ripe(SpiderFootPlugin):
def asNeighbours(self, asn):
res = self.fetchRir(f"https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS{asn}")
if res['content'] is None:
- self.sf.debug(f"No neighbour info found/available for AS{asn} at RIPE.")
+ self.debug(f"No neighbour info found/available for AS{asn} at RIPE.")
return None
try:
j = json.loads(res['content'])
data = j["data"]["neighbours"]
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
neighbours = list()
@@ -306,11 +306,11 @@ class sfp_ripe(SpiderFootPlugin):
eventData = event.data
self.currentEventSrc = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -351,7 +351,7 @@ class sfp_ripe(SpiderFootPlugin):
# Get the BGP AS the netblock is a part of
asn = self.netblockAs(eventData)
if asn is None:
- self.sf.debug(f"Could not identify BGP AS for {eventData}")
+ self.debug(f"Could not identify BGP AS for {eventData}")
return
if eventName in ["NETBLOCK_OWNER", "NETBLOCKV6_OWNER"] and self.ownsAs(asn):
@@ -370,19 +370,19 @@ class sfp_ripe(SpiderFootPlugin):
# Get the Netblock the IP is a part of
prefix = self.ipNetblock(eventData)
if prefix is None:
- self.sf.debug(f"Could not identify network prefix for {eventData}")
+ self.debug(f"Could not identify network prefix for {eventData}")
return
# Get the BGP AS the netblock is a part of
asn = self.netblockAs(prefix)
if asn is None:
- self.sf.debug(f"Could not identify BGP AS for {prefix}")
+ self.debug(f"Could not identify BGP AS for {prefix}")
return
if not self.sf.validIpNetwork(prefix):
return
- self.sf.info(f"Netblock found: {prefix} ({asn})")
+ self.info(f"Netblock found: {prefix} ({asn})")
if ":" in prefix:
evt = SpiderFootEvent("NETBLOCKV6_MEMBER", prefix, self.__name__, event)
diff --git a/modules/sfp_riskiq.py b/modules/sfp_riskiq.py
index 4fb59f6e..2166c3d8 100644
--- a/modules/sfp_riskiq.py
+++ b/modules/sfp_riskiq.py
@@ -129,21 +129,21 @@ class sfp_riskiq(SpiderFootPlugin):
postData=post)
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("RiskIQ access seems to have been rejected or you have exceeded usage limits.")
+ self.error("RiskIQ access seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No RiskIQ info found for " + qry)
+ self.info("No RiskIQ info found for " + qry)
return None
try:
ret = json.loads(res['content'])
if 'results' not in ret:
- self.sf.info("No RiskIQ info found for " + qry)
+ self.info("No RiskIQ info found for " + qry)
return None
except Exception as e:
- self.sf.error(f"Invalid JSON returned by RiskIQ: {e}")
+ self.error(f"Invalid JSON returned by RiskIQ: {e}")
return None
return ret['results']
@@ -157,20 +157,20 @@ class sfp_riskiq(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Ignore messages from myself
if srcModuleName == "sfp_riskiq":
- self.sf.debug("Ignoring " + eventName + ", from self.")
+ self.debug("Ignoring " + eventName + ", from self.")
return
if self.opts['api_key_login'] == "" or self.opts['api_key_password'] == "":
- self.sf.error("You enabled sfp_riskiq but did not set an credentials!")
+ self.error("You enabled sfp_riskiq but did not set an credentials!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -178,7 +178,7 @@ class sfp_riskiq(SpiderFootPlugin):
if eventName == 'DOMAIN_NAME':
ret = self.query(eventData, "PSSL")
if not ret:
- self.sf.info(f"No RiskIQ passive SSL data found for {eventData}")
+ self.info(f"No RiskIQ passive SSL data found for {eventData}")
else:
# Generate an event for the IP first, and then link the cert
# to that event.
@@ -205,7 +205,7 @@ class sfp_riskiq(SpiderFootPlugin):
if eventName == 'EMAILADDR':
ret = self.query(eventData, "WHOIS")
if not ret:
- self.sf.info("No RiskIQ passive DNS data found for " + eventData)
+ self.info("No RiskIQ passive DNS data found for " + eventData)
return
for r in ret:
@@ -226,7 +226,7 @@ class sfp_riskiq(SpiderFootPlugin):
if eventName in ['IP_ADDRESS', 'INTERNET_NAME', 'DOMAIN_NAME']:
ret = self.query(eventData, "PDNS")
if not ret:
- self.sf.info("No RiskIQ passive DNS data found for " + eventData)
+ self.info("No RiskIQ passive DNS data found for " + eventData)
return
cohosts = list()
@@ -254,7 +254,7 @@ class sfp_riskiq(SpiderFootPlugin):
continue
if eventName == "IP_ADDRESS" and (self.opts['verify'] and not self.sf.validateIP(co, eventData)):
- self.sf.debug("Host no longer resolves to our IP.")
+ self.debug("Host no longer resolves to our IP.")
continue
if not self.opts['cohostsamedomain']:
diff --git a/modules/sfp_robtex.py b/modules/sfp_robtex.py
index 1bcc0bd8..6f99a267 100644
--- a/modules/sfp_robtex.py
+++ b/modules/sfp_robtex.py
@@ -102,17 +102,17 @@ class sfp_robtex(SpiderFootPlugin):
eventData = event.data
self.currentEventSrc = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.cohostcount > self.opts['maxcohost']:
return
if srcModuleName == "sfp_robtex":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName in ['NETBLOCK_OWNER', 'NETBLOCKV6_OWNER']:
@@ -126,7 +126,7 @@ class sfp_robtex(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName in ['NETBLOCK_MEMBER', 'NETBLOCKV6_MEMBER']:
@@ -139,7 +139,7 @@ class sfp_robtex(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
qrylist = list()
@@ -173,13 +173,13 @@ class sfp_robtex(SpiderFootPlugin):
retry += 1
if res['content'] is None:
- self.sf.error("No reply from robtex API.")
+ self.error("No reply from robtex API.")
continue
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error parsing JSON from Robtex API: {e}")
+ self.error(f"Error parsing JSON from Robtex API: {e}")
return
if not data:
@@ -188,7 +188,7 @@ class sfp_robtex(SpiderFootPlugin):
status = data.get("status")
if status and status == "ratelimited":
- self.sf.error("You are being rate-limited by robtex API.")
+ self.error("You are being rate-limited by robtex API.")
self.errorState = True
continue
@@ -198,7 +198,7 @@ class sfp_robtex(SpiderFootPlugin):
pas = data.get('pas')
if not pas:
- self.sf.info(f"No results from robtex API for {ip}")
+ self.info(f"No results from robtex API for {ip}")
continue
if not len(pas):
@@ -212,11 +212,11 @@ class sfp_robtex(SpiderFootPlugin):
if not self.opts['cohostsamedomain']:
if self.getTarget().matches(host, includeParents=True):
- self.sf.debug(f"Skipping {host} because it is on the same domain.")
+ self.debug(f"Skipping {host} because it is on the same domain.")
continue
if self.opts['verify'] and not self.sf.validateIP(host, ip):
- self.sf.debug(f"Host {host} no longer resolves to {ip}")
+ self.debug(f"Host {host} no longer resolves to {ip}")
continue
if eventName == "NETBLOCK_OWNER":
diff --git a/modules/sfp_s3bucket.py b/modules/sfp_s3bucket.py
index 65c3a8e3..c9ab9312 100644
--- a/modules/sfp_s3bucket.py
+++ b/modules/sfp_s3bucket.py
@@ -74,7 +74,7 @@ class sfp_s3bucket(SpiderFootPlugin):
return
if "NoSuchBucket" in res['content']:
- self.sf.debug(f"Not a valid bucket: {url}")
+ self.debug(f"Not a valid bucket: {url}")
return
# Bucket found
@@ -98,7 +98,7 @@ class sfp_s3bucket(SpiderFootPlugin):
if self.checkForStop():
return False
- self.sf.info("Spawning thread to check bucket: " + site)
+ self.info("Spawning thread to check bucket: " + site)
tname = str(random.SystemRandom().randint(0, 999999999))
t.append(threading.Thread(name='thread_sfp_s3buckets_' + tname,
target=self.checkSite, args=(site,)))
@@ -154,7 +154,7 @@ class sfp_s3bucket(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "LINKED_URL_EXTERNAL":
if ".amazonaws.com" in eventData:
diff --git a/modules/sfp_scylla.py b/modules/sfp_scylla.py
index c2262d07..56003bb1 100644
--- a/modules/sfp_scylla.py
+++ b/modules/sfp_scylla.py
@@ -94,18 +94,18 @@ class sfp_scylla(SpiderFootPlugin):
time.sleep(self.opts['pause'])
if res['code'] != "200":
- self.sf.error("Syclla.sh is having problems.")
+ self.error("Syclla.sh is having problems.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.debug('No response from Scylla.so')
+ self.debug('No response from Scylla.so')
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -123,7 +123,7 @@ class sfp_scylla(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
position = 0
max_pages = int(self.opts['max_pages'])
@@ -163,7 +163,7 @@ class sfp_scylla(SpiderFootPlugin):
continue
if not self.sf.validEmail(email):
- self.sf.debug("Skipping invalid email address: " + email)
+ self.debug("Skipping invalid email address: " + email)
continue
mailDom = email.lower().split('@')[1]
@@ -171,7 +171,7 @@ class sfp_scylla(SpiderFootPlugin):
# Skip unrelated emails
# Scylla sometimes returns broader results than the searched data
if not self.getTarget().matches(mailDom):
- self.sf.debug("Skipped address: " + email)
+ self.debug("Skipped address: " + email)
continue
breach = result.get('domain', 'Unknown')
diff --git a/modules/sfp_searchcode.py b/modules/sfp_searchcode.py
index b14197ff..b932db22 100644
--- a/modules/sfp_searchcode.py
+++ b/modules/sfp_searchcode.py
@@ -91,19 +91,19 @@ class sfp_searchcode(SpiderFootPlugin):
return None
if res['code'] == "429":
- self.sf.error("You are being rate-limited by searchcode.")
+ self.error("You are being rate-limited by searchcode.")
self.errorState = True
return None
if res['code'] != '200':
- self.sf.error(f"Unexpected reply from searchcode: {res['code']}")
+ self.error(f"Unexpected reply from searchcode: {res['code']}")
self.errorState = True
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from searchcode: {e}")
+ self.debug(f"Error processing JSON response from searchcode: {e}")
return None
return None
@@ -116,10 +116,10 @@ class sfp_searchcode(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName not in self.watchedEvents():
@@ -153,10 +153,10 @@ class sfp_searchcode(SpiderFootPlugin):
mail_domain = email.lower().split('@')[1]
if not self.getTarget().matches(mail_domain):
- self.sf.debug(f"Skipped email address: {email}")
+ self.debug(f"Skipped email address: {email}")
continue
- self.sf.info(f"Found e-mail address: {email}")
+ self.info(f"Found e-mail address: {email}")
evt_type = "EMAILADDR"
if email.split("@")[0] in self.opts['_genericusers'].split(","):
@@ -179,10 +179,10 @@ class sfp_searchcode(SpiderFootPlugin):
host = self.sf.urlFQDN(link)
if not self.getTarget().matches(host, includeChildren=True, includeParents=True):
- self.sf.debug(f"Skipped unrelated URL: {link}")
+ self.debug(f"Skipped unrelated URL: {link}")
continue
- self.sf.debug(f"Found a URL: {link}")
+ self.debug(f"Found a URL: {link}")
evt = SpiderFootEvent('LINKED_URL_INTERNAL', link, self.__name__, event)
self.notifyListeners(evt)
self.results[link] = True
@@ -191,7 +191,7 @@ class sfp_searchcode(SpiderFootPlugin):
continue
if self.opts['dns_resolve'] and not self.sf.resolveHost(host) and not self.sf.resolveHost6(host):
- self.sf.debug(f"Host {host} could not be resolved")
+ self.debug(f"Host {host} could not be resolved")
evt = SpiderFootEvent("INTERNET_NAME_UNRESOLVED", host, self.__name__, event)
self.notifyListeners(evt)
else:
diff --git a/modules/sfp_securitytrails.py b/modules/sfp_securitytrails.py
index 0d6aac06..f77bf95d 100644
--- a/modules/sfp_securitytrails.py
+++ b/modules/sfp_securitytrails.py
@@ -113,12 +113,12 @@ class sfp_securitytrails(SpiderFootPlugin):
postData=request)
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("SecurityTrails API key seems to have been rejected or you have exceeded usage limits for the month.")
+ self.error("SecurityTrails API key seems to have been rejected or you have exceeded usage limits for the month.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No SecurityTrails info found for " + qry)
+ self.info("No SecurityTrails info found for " + qry)
return None
try:
@@ -141,7 +141,7 @@ class sfp_securitytrails(SpiderFootPlugin):
else:
return info.get('records', [])
except Exception as e:
- self.sf.error("Error processing JSON response from SecurityTrails: " + str(e))
+ self.error("Error processing JSON response from SecurityTrails: " + str(e))
return None
# Handle events sent to this module
@@ -153,16 +153,16 @@ class sfp_securitytrails(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_securitytrails but did not set an API uid/secret!")
+ self.error("You enabled sfp_securitytrails but did not set an API uid/secret!")
self.errorState = True
return
# Don't look up stuff twice
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -189,12 +189,12 @@ class sfp_securitytrails(SpiderFootPlugin):
h = r['hostname']
if not self.opts['cohostsamedomain']:
if self.getTarget().matches(h, includeParents=True):
- self.sf.debug("Skipping " + h + " because it is on the same domain.")
+ self.debug("Skipping " + h + " because it is on the same domain.")
continue
if h not in myres and h != ip:
if self.opts['verify'] and not self.sf.validateIP(h, ip):
- self.sf.debug("Host " + h + " no longer resolves to our IP.")
+ self.debug("Host " + h + " no longer resolves to our IP.")
continue
myres.append(h.lower())
e = SpiderFootEvent("CO_HOSTED_SITE", h, self.__name__, event)
diff --git a/modules/sfp_seon.py b/modules/sfp_seon.py
index f8082bfb..8d76d433 100644
--- a/modules/sfp_seon.py
+++ b/modules/sfp_seon.py
@@ -116,15 +116,15 @@ class sfp_seon(SpiderFootPlugin):
)
if res['code'] == '429':
- self.sf.error("You are being rate-limited by seon.io")
+ self.error("You are being rate-limited by seon.io")
return None
if res['code'] != "200":
- self.sf.error("Error retrieving search results from seon.io")
+ self.error("Error retrieving search results from seon.io")
return None
if res['code'] == '404':
- self.sf.error("API Endpoint not found")
+ self.error("API Endpoint not found")
return None
return json.loads(res['content'])
@@ -135,18 +135,18 @@ class sfp_seon(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_seon but did not set an API key!")
+ self.error("You enabled sfp_seon but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_shodan.py b/modules/sfp_shodan.py
index e7d61d91..e027770a 100644
--- a/modules/sfp_shodan.py
+++ b/modules/sfp_shodan.py
@@ -94,17 +94,17 @@ class sfp_shodan(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.info(f"No SHODAN info found for {qry}")
+ self.info(f"No SHODAN info found for {qry}")
return None
try:
r = json.loads(res['content'])
if "error" in r:
- self.sf.error(f"Error returned from SHODAN: {r['error']}")
+ self.error(f"Error returned from SHODAN: {r['error']}")
return None
return r
except Exception as e:
- self.sf.error(f"Error processing JSON response from SHODAN: {e}")
+ self.error(f"Error processing JSON response from SHODAN: {e}")
return None
return None
@@ -122,17 +122,17 @@ class sfp_shodan(SpiderFootPlugin):
)
time.sleep(1)
if res['content'] is None:
- self.sf.info(f"No SHODAN info found for {qry}")
+ self.info(f"No SHODAN info found for {qry}")
return None
try:
r = json.loads(res['content'])
if "error" in r:
- self.sf.error(f"Error returned from SHODAN: {r['error']}")
+ self.error(f"Error returned from SHODAN: {r['error']}")
return None
return r
except Exception as e:
- self.sf.error(f"Error processing JSON response from SHODAN: {e}")
+ self.error(f"Error processing JSON response from SHODAN: {e}")
return None
return None
@@ -150,20 +150,20 @@ class sfp_shodan(SpiderFootPlugin):
)
time.sleep(1)
if res['content'] is None:
- self.sf.info(f"No SHODAN info found for {qry}")
+ self.info(f"No SHODAN info found for {qry}")
return None
try:
r = json.loads(res['content'])
if "error" in r:
- self.sf.error(f"Error returned from SHODAN: {r['error']}")
+ self.error(f"Error returned from SHODAN: {r['error']}")
return None
if r.get('total', 0) == 0:
- self.sf.info(f"No SHODAN info found for {qry}")
+ self.info(f"No SHODAN info found for {qry}")
return None
return r
except Exception as e:
- self.sf.error(f"Error processing JSON response from SHODAN: {e}")
+ self.error(f"Error processing JSON response from SHODAN: {e}")
return None
return None
@@ -177,15 +177,15 @@ class sfp_shodan(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_shodan but did not set an API key!")
+ self.error("You enabled sfp_shodan but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -203,11 +203,11 @@ class sfp_shodan(SpiderFootPlugin):
network = eventData.split(": ")[0]
analytics_id = eventData.split(": ")[1]
except Exception as e:
- self.sf.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})")
+ self.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})")
return
if network not in ['Google AdSense', 'Google Analytics', 'Google Site Verification']:
- self.sf.debug(f"Skipping {eventData}, as not supported.")
+ self.debug(f"Skipping {eventData}, as not supported.")
return
rec = self.searchHtml(analytics_id)
@@ -224,7 +224,7 @@ class sfp_shodan(SpiderFootPlugin):
return
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
qrylist = list()
@@ -270,7 +270,7 @@ class sfp_shodan(SpiderFootPlugin):
if 'data' not in rec:
continue
- self.sf.info(f"Found SHODAN data for {eventData}")
+ self.info(f"Found SHODAN data for {eventData}")
ports = list()
banners = list()
asns = list()
diff --git a/modules/sfp_similar.py b/modules/sfp_similar.py
index e3848d4a..82f76545 100644
--- a/modules/sfp_similar.py
+++ b/modules/sfp_similar.py
@@ -106,7 +106,7 @@ class sfp_similar(SpiderFootPlugin):
return
tld = "." + eventData.split(dom + ".")[-1]
- self.sf.debug(f"Keyword extracted from {eventData}: {dom}")
+ self.debug(f"Keyword extracted from {eventData}: {dom}")
if dom in self.results:
return
@@ -150,7 +150,7 @@ class sfp_similar(SpiderFootPlugin):
try:
for domain in [f"{d}{tld}", f"www.{d}{tld}"]:
if self.sf.resolveHost(domain) or self.sf.resolveHost6(domain):
- self.sf.debug(f"Resolved {domain}")
+ self.debug(f"Resolved {domain}")
evt = SpiderFootEvent("SIMILARDOMAIN", f"{d}{tld}", self.__name__, event)
self.notifyListeners(evt)
break
diff --git a/modules/sfp_skymem.py b/modules/sfp_skymem.py
index ebc9248c..e77815fc 100644
--- a/modules/sfp_skymem.py
+++ b/modules/sfp_skymem.py
@@ -74,7 +74,7 @@ class sfp_skymem(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Get e-mail addresses on this domain
res = self.sf.fetchUrl("http://www.skymem.info/srch?q=" + eventData, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
@@ -89,10 +89,10 @@ class sfp_skymem(SpiderFootPlugin):
# Skip unrelated emails
mailDom = email.lower().split('@')[1]
if not self.getTarget().matches(mailDom):
- self.sf.debug("Skipped address: " + email)
+ self.debug("Skipped address: " + email)
continue
- self.sf.info("Found e-mail address: " + email)
+ self.info("Found e-mail address: " + email)
if email not in self.results:
if email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
@@ -121,10 +121,10 @@ class sfp_skymem(SpiderFootPlugin):
# Skip unrelated emails
mailDom = email.lower().split('@')[1]
if not self.getTarget().matches(mailDom):
- self.sf.debug("Skipped address: " + email)
+ self.debug("Skipped address: " + email)
continue
- self.sf.info("Found e-mail address: " + email)
+ self.info("Found e-mail address: " + email)
if email not in self.results:
if email.split("@")[0] in self.opts['_genericusers'].split(","):
evttype = "EMAILADDR_GENERIC"
diff --git a/modules/sfp_slideshare.py b/modules/sfp_slideshare.py
index cb26dad9..941ee775 100644
--- a/modules/sfp_slideshare.py
+++ b/modules/sfp_slideshare.py
@@ -77,18 +77,18 @@ class sfp_slideshare(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Retrieve profile
try:
network = eventData.split(": ")[0]
url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")
except Exception as e:
- self.sf.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
+ self.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
return
if network != "SlideShare":
- self.sf.debug(f"Skipping social network profile, {url}, as not a SlideShare profile")
+ self.debug(f"Skipping social network profile, {url}, as not a SlideShare profile")
return
res = self.sf.fetchUrl(
@@ -104,7 +104,7 @@ class sfp_slideshare(SpiderFootPlugin):
human_name = self.extractMeta('slideshare:name', res['content'])
if not human_name:
- self.sf.debug(f"{url} is not a valid SlideShare profile")
+ self.debug(f"{url} is not a valid SlideShare profile")
return
e = SpiderFootEvent("RAW_RIR_DATA", f"Possible full name: {human_name[0]}", self.__name__, event)
@@ -117,7 +117,7 @@ class sfp_slideshare(SpiderFootPlugin):
return
if len(location[0]) < 3 or len(location[0]) > 100:
- self.sf.debug("Skipping likely invalid location.")
+ self.debug("Skipping likely invalid location.")
return
e = SpiderFootEvent("GEOINFO", location[0], self.__name__, event)
diff --git a/modules/sfp_snov.py b/modules/sfp_snov.py
index a7875e93..714fa129 100644
--- a/modules/sfp_snov.py
+++ b/modules/sfp_snov.py
@@ -100,7 +100,7 @@ class sfp_snov(SpiderFootPlugin):
)
if res['code'] != '200':
- self.sf.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
+ self.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
self.errorState = True
return None
try:
@@ -109,12 +109,12 @@ class sfp_snov(SpiderFootPlugin):
accessToken = json.loads(content).get('access_token')
if accessToken is None:
- self.sf.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
+ self.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
return None
return str(accessToken)
except Exception:
- self.sf.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
+ self.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
self.errorState = True
return None
@@ -139,7 +139,7 @@ class sfp_snov(SpiderFootPlugin):
useragent=self.opts['_useragent']
)
if res['code'] != '200':
- self.sf.debug("Could not fetch email addresses")
+ self.debug("Could not fetch email addresses")
return None
return res.get('content')
@@ -153,17 +153,17 @@ class sfp_snov(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Always check if the API key is set and complain if it isn't, then set
# self.errorState to avoid this being a continual complaint during the scan.
if self.opts['api_key_client_id'] == "" or self.opts['api_key_client_secret'] == "":
- self.sf.error("You enabled sfp_snov but did not set a Client ID and/or Client Secret")
+ self.error("You enabled sfp_snov but did not set a Client ID and/or Client Secret")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -171,7 +171,7 @@ class sfp_snov(SpiderFootPlugin):
# Get access token from Snov IO API
accessToken = self.queryAccessToken()
if accessToken is None or accessToken == '':
- self.sf.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
+ self.error("No access token received from snov.io for the provided Client ID and/or Client Secret")
self.errorState = True
return
@@ -184,13 +184,13 @@ class sfp_snov(SpiderFootPlugin):
data = self.queryDomainName(eventData, accessToken, currentLastId)
if data is None:
- self.sf.debug("No email address found for target domain")
+ self.debug("No email address found for target domain")
break
try:
data = json.loads(data)
except Exception:
- self.sf.debug("No email address found for target domain")
+ self.debug("No email address found for target domain")
break
evt = SpiderFootEvent("RAW_RIR_DATA", str(data), self.__name__, event)
diff --git a/modules/sfp_social.py b/modules/sfp_social.py
index 27d55f05..e2cfd536 100644
--- a/modules/sfp_social.py
+++ b/modules/sfp_social.py
@@ -67,7 +67,7 @@ class sfp_social(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in list(self.results.keys()):
return
@@ -81,7 +81,7 @@ class sfp_social(SpiderFootPlugin):
if not bits:
continue
- self.sf.info(f"Matched {regexpGrp} in {eventData}")
+ self.info(f"Matched {regexpGrp} in {eventData}")
evt = SpiderFootEvent(
"SOCIAL_MEDIA", f"{regexpGrp}: <SFURL>{eventData}</SFURL>",
self.__name__,
diff --git a/modules/sfp_sociallinks.py b/modules/sfp_sociallinks.py
index 674edb20..14def284 100644
--- a/modules/sfp_sociallinks.py
+++ b/modules/sfp_sociallinks.py
@@ -97,17 +97,17 @@ class sfp_sociallinks(SpiderFootPlugin):
)
if res['code'] == '429':
- self.sf.error("You are being rate-limited by Social Links")
+ self.error("You are being rate-limited by Social Links")
self.errorState = True
return None
if res['code'] == '404':
- self.sf.error("API Endpoint not found")
+ self.error("API Endpoint not found")
self.errorState = True
return None
if res['code'] != "200":
- self.sf.error("No search results from Social Links")
+ self.error("No search results from Social Links")
return None
if res['content'] is None:
@@ -143,18 +143,18 @@ class sfp_sociallinks(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_sociallinks but did not set an API key!")
+ self.error("You enabled sfp_sociallinks but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -267,7 +267,7 @@ class sfp_sociallinks(SpiderFootPlugin):
self.notifyListeners(evt)
if failedModules == 3:
- self.sf.info(f"No data found for {eventData}")
+ self.info(f"No data found for {eventData}")
return
# End of sfp_sociallinks class
diff --git a/modules/sfp_socialprofiles.py b/modules/sfp_socialprofiles.py
index a7fb620d..401cec0c 100644
--- a/modules/sfp_socialprofiles.py
+++ b/modules/sfp_socialprofiles.py
@@ -135,15 +135,15 @@ class sfp_socialprofiles(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['google_api_key'] == "" and self.opts['bing_api_key'] == "":
- self.sf.error("You enabled sfp_socialprofiles but did not set a Google or Bing API key!")
+ self.error("You enabled sfp_socialprofiles but did not set a Google or Bing API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -161,7 +161,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
res = None
if self.opts["method"].lower() == "yahoo":
- self.sf.error(
+ self.error(
"Yahoo is no longer supported. Please try 'bing' or 'google'."
)
return
@@ -191,7 +191,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
self.__dataSource__ = "Bing"
if res is None:
- self.sf.info("No data returned from " + self.opts["method"] + ".")
+ self.info("No data returned from " + self.opts["method"] + ".")
continue
if self.checkForStop():
@@ -216,7 +216,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
continue
for match in matches:
- self.sf.debug("Match found: " + match)
+ self.debug("Match found: " + match)
if match in instances:
continue
else:
@@ -230,7 +230,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
# Keywords might be empty if the target was an IP, subnet or name.
if self.opts["tighten"] and self.keywords:
match = urllib.parse.unquote(match)
- self.sf.debug(
+ self.debug(
"Tightening results to look for " + str(self.keywords)
)
pres = self.sf.fetchUrl(
@@ -254,7 +254,7 @@ class sfp_socialprofiles(SpiderFootPlugin):
if not found:
continue
- self.sf.info("Social Media Profile found at " + site + ": " + match)
+ self.info("Social Media Profile found at " + site + ": " + match)
match = urllib.parse.unquote(match)
evt = SpiderFootEvent(
"SOCIAL_MEDIA", site + ": <SFURL>" + match + "</SFURL>", self.__name__, event
diff --git a/modules/sfp_sorbs.py b/modules/sfp_sorbs.py
index 4145919e..66ec52ad 100644
--- a/modules/sfp_sorbs.py
+++ b/modules/sfp_sorbs.py
@@ -109,12 +109,12 @@ class sfp_sorbs(SpiderFootPlugin):
try:
lookup = self.reverseAddr(qaddr) + "." + domain
- self.sf.debug("Checking Blacklist: " + lookup)
+ self.debug("Checking Blacklist: " + lookup)
addrs = self.sf.resolveHost(lookup)
if not addrs:
continue
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
text = None
for addr in addrs:
@@ -123,7 +123,7 @@ class sfp_sorbs(SpiderFootPlugin):
break
else:
if str(addr) not in list(self.checks[domain].keys()):
- self.sf.debug("Return code not found in list: " + str(addr))
+ self.debug("Return code not found in list: " + str(addr))
continue
k = str(addr)
@@ -144,7 +144,7 @@ class sfp_sorbs(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
return
@@ -155,7 +155,7 @@ class sfp_sorbs(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -168,7 +168,7 @@ class sfp_sorbs(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -177,7 +177,7 @@ class sfp_sorbs(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_spamcop.py b/modules/sfp_spamcop.py
index c6d2620d..4b0cabe3 100644
--- a/modules/sfp_spamcop.py
+++ b/modules/sfp_spamcop.py
@@ -100,9 +100,9 @@ class sfp_spamcop(SpiderFootPlugin):
try:
lookup = self.reverseAddr(qaddr) + "." + domain
- self.sf.debug("Checking Blacklist: " + lookup)
+ self.debug("Checking Blacklist: " + lookup)
addrs = self.sf.resolveHost(lookup)
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
if not addrs:
continue
@@ -118,7 +118,7 @@ class sfp_spamcop(SpiderFootPlugin):
text = self.checks[domain][k] + " (" + qaddr + ")"
break
- self.sf.debug(f"Return code not found in list: {addr}")
+ self.debug(f"Return code not found in list: {addr}")
if text is not None:
if eventName == "AFFILIATE_IPADDR":
@@ -134,7 +134,7 @@ class sfp_spamcop(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
# Handle events sent to this module
def handleEvent(self, event):
@@ -143,7 +143,7 @@ class sfp_spamcop(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -155,7 +155,7 @@ class sfp_spamcop(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -164,7 +164,7 @@ class sfp_spamcop(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_spamhaus.py b/modules/sfp_spamhaus.py
index b39045cd..3f5f3753 100644
--- a/modules/sfp_spamhaus.py
+++ b/modules/sfp_spamhaus.py
@@ -108,9 +108,9 @@ class sfp_spamhaus(SpiderFootPlugin):
try:
lookup = self.reverseAddr(qaddr) + "." + domain
- self.sf.debug("Checking Blacklist: " + lookup)
+ self.debug("Checking Blacklist: " + lookup)
addrs = self.sf.resolveHost(lookup)
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
if not addrs:
continue
@@ -126,7 +126,7 @@ class sfp_spamhaus(SpiderFootPlugin):
text = self.checks[domain][k] + " (" + qaddr + ")"
break
- self.sf.debug(f"Return code not found in list: {addr}")
+ self.debug(f"Return code not found in list: {addr}")
if text is not None:
if eventName == "AFFILIATE_IPADDR":
@@ -142,7 +142,7 @@ class sfp_spamhaus(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
def handleEvent(self, event):
eventName = event.eventType
@@ -150,7 +150,7 @@ class sfp_spamhaus(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -163,7 +163,7 @@ class sfp_spamhaus(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -172,7 +172,7 @@ class sfp_spamhaus(SpiderFootPlugin):
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_spider.py b/modules/sfp_spider.py
index 39507b0c..9450d206 100644
--- a/modules/sfp_spider.py
+++ b/modules/sfp_spider.py
@@ -90,11 +90,11 @@ class sfp_spider(SpiderFootPlugin):
# Filter out certain file types (if user chooses to)
if list(filter(lambda ext: url.lower().split('?')[0].endswith('.' + ext.lower()), self.opts['filterfiles'])):
- # self.sf.debug('Ignoring filtered extension: ' + link)
+ # self.debug('Ignoring filtered extension: ' + link)
return None
if site in self.siteCookies:
- self.sf.debug(f"Restoring cookies for {site}: {self.siteCookies[site]}")
+ self.debug(f"Restoring cookies for {site}: {self.siteCookies[site]}")
cookies = self.siteCookies[site]
# Fetch the contents of the supplied URL (object returned)
fetched = self.sf.fetchUrl(
@@ -112,18 +112,18 @@ class sfp_spider(SpiderFootPlugin):
if self.opts['usecookies'] and fetched['headers'] is not None:
if fetched['headers'].get('Set-Cookie'):
self.siteCookies[site] = fetched['headers'].get('Set-Cookie')
- self.sf.debug(f"Saving cookies for {site}: {self.siteCookies[site]}")
+ self.debug(f"Saving cookies for {site}: {self.siteCookies[site]}")
if url not in self.urlEvents:
# TODO: be more descriptive
- self.sf.error("Something strange happened - shouldn't get here: url not in self.urlEvents")
+ self.error("Something strange happened - shouldn't get here: url not in self.urlEvents")
self.urlEvents[url] = None
# Notify modules about the content obtained
self.contentNotify(url, fetched, self.urlEvents[url])
if fetched['realurl'] is not None and fetched['realurl'] != url:
- # self.sf.debug("Redirect of " + url + " to " + fetched['realurl'])
+ # self.debug("Redirect of " + url + " to " + fetched['realurl'])
# Store the content for the redirect so that it isn't fetched again
self.fetchedPages[fetched['realurl']] = True
# Notify modules about the new link
@@ -136,7 +136,7 @@ class sfp_spider(SpiderFootPlugin):
self.getTarget().getNames())
if not links:
- self.sf.debug(f"No links found at {url}")
+ self.debug(f"No links found at {url}")
return None
# Notify modules about the links found
@@ -149,7 +149,7 @@ class sfp_spider(SpiderFootPlugin):
# Supply the SpiderFootEvent of the parent URL as the parent
self.urlEvents[link] = self.linkNotify(link, self.urlEvents[url])
- self.sf.debug('Links found from parsing: ' + str(links))
+ self.debug('Links found from parsing: ' + str(links))
return links
# Clear out links that we don't want to follow
@@ -162,33 +162,33 @@ class sfp_spider(SpiderFootPlugin):
# Skip external sites (typical behaviour..)
if not self.getTarget().matches(linkFQDN):
- # self.sf.debug('Ignoring external site: ' + link)
+ # self.debug('Ignoring external site: ' + link)
continue
# Optionally skip sub-domain sites
if self.opts['nosubs'] and not \
self.getTarget().matches(linkFQDN, includeChildren=False):
- # self.sf.debug("Ignoring subdomain: " + link)
+ # self.debug("Ignoring subdomain: " + link)
continue
# Skip parent domain sites
if not self.getTarget().matches(linkFQDN, includeParents=False):
- # self.sf.debug("Ignoring parent domain: " + link)
+ # self.debug("Ignoring parent domain: " + link)
continue
# Optionally skip user directories
if self.opts['filterusers'] and '/~' in link:
- # self.sf.debug("Ignoring user folder: " + link)
+ # self.debug("Ignoring user folder: " + link)
continue
# If we are respecting robots.txt, filter those out too
if linkBase in self.robotsRules and self.opts['robotsonly']:
if list(filter(lambda blocked: type(blocked).lower(blocked) in link.lower() or blocked == '*', self.robotsRules[linkBase])):
- # self.sf.debug("Ignoring page found in robots.txt: " + link)
+ # self.debug("Ignoring page found in robots.txt: " + link)
continue
# All tests passed, add link to be spidered
- self.sf.debug("Adding URL for spidering: " + link)
+ self.debug("Adding URL for spidering: " + link)
returnLinks[link] = links[link]
return returnLinks
@@ -275,15 +275,15 @@ class sfp_spider(SpiderFootPlugin):
eventData = event.data
spiderTarget = None
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't spider links we find ourselves
if srcModuleName == "sfp_spider":
- self.sf.debug(f"Ignoring {eventName}, from self.")
+ self.debug(f"Ignoring {eventName}, from self.")
return None
if eventData in self.urlEvents:
- self.sf.debug("Ignoring " + eventData + " as already spidered or is being spidered.")
+ self.debug("Ignoring " + eventData + " as already spidered or is being spidered.")
return None
self.urlEvents[eventData] = event
@@ -306,7 +306,7 @@ class sfp_spider(SpiderFootPlugin):
if spiderTarget is None:
return None
- self.sf.debug("Initiating spider of " + spiderTarget + " from " + srcModuleName)
+ self.debug("Initiating spider of " + spiderTarget + " from " + srcModuleName)
# Link the spidered URL to the event that triggered it
self.urlEvents[spiderTarget] = event
@@ -327,7 +327,7 @@ class sfp_spider(SpiderFootPlugin):
useragent=self.opts['_useragent'],
verify=False)
if robotsTxt['content'] is not None:
- self.sf.debug('robots.txt contents: ' + robotsTxt['content'])
+ self.debug('robots.txt contents: ' + robotsTxt['content'])
self.robotsRules[targetBase] = SpiderFootHelpers.parseRobotsTxt(robotsTxt['content'])
if self.checkForStop():
@@ -339,7 +339,7 @@ class sfp_spider(SpiderFootPlugin):
links = self.processUrl(startingPoint) # fetch first page
if links is None:
- self.sf.debug("No links found on the first fetch!")
+ self.debug("No links found on the first fetch!")
return
while keepSpidering:
@@ -352,14 +352,14 @@ class sfp_spider(SpiderFootPlugin):
for link in nextLinks:
# Always skip links we've already fetched
if (link in self.fetchedPages):
- self.sf.debug("Already fetched " + link + ", skipping.")
+ self.debug("Already fetched " + link + ", skipping.")
continue
# Check if we've been asked to stop
if self.checkForStop():
return
- self.sf.debug("Fetching fresh content from: " + link)
+ self.debug("Fetching fresh content from: " + link)
time.sleep(self.opts['pausesec'])
freshLinks = self.processUrl(link)
if freshLinks is not None:
@@ -367,24 +367,24 @@ class sfp_spider(SpiderFootPlugin):
totalFetched += 1
if totalFetched >= self.opts['maxpages']:
- self.sf.info("Maximum number of pages (" + str(self.opts['maxpages'])
- + ") reached.")
+ self.info("Maximum number of pages (" + str(self.opts['maxpages'])
+ + ") reached.")
keepSpidering = False
break
nextLinks = self.cleanLinks(links)
- self.sf.debug(f"Found links: {nextLinks}")
+ self.debug(f"Found links: {nextLinks}")
# We've scanned through another layer of the site
levelsTraversed += 1
- self.sf.debug(f"At level: {levelsTraversed}, Pages: {totalFetched}")
+ self.debug(f"At level: {levelsTraversed}, Pages: {totalFetched}")
if levelsTraversed >= self.opts['maxlevels']:
- self.sf.info(f"Maximum number of levels ({self.opts['maxlevels']}) reached.")
+ self.info(f"Maximum number of levels ({self.opts['maxlevels']}) reached.")
keepSpidering = False
# We've reached the end of our journey..
if len(nextLinks) == 0:
- self.sf.debug("No more links found to spider, finishing..")
+ self.debug("No more links found to spider, finishing..")
keepSpidering = False
# We've been asked to stop scanning
diff --git a/modules/sfp_spur.py b/modules/sfp_spur.py
index d20083f9..bb100e77 100644
--- a/modules/sfp_spur.py
+++ b/modules/sfp_spur.py
@@ -117,16 +117,16 @@ class sfp_spur(SpiderFootPlugin):
code = res.get('code')
if code == '403':
- self.sf.error("Invalid credentials. Please check API Token")
+ self.error("Invalid credentials. Please check API Token")
self.errorState = True
return None
if code == '404':
- self.sf.debug("IP Address not found.")
+ self.debug("IP Address not found.")
return None
if code != '200':
- self.sf.error("Unable to fetch data from spur.us")
+ self.error("Unable to fetch data from spur.us")
return None
return res.get('content')
@@ -139,17 +139,17 @@ class sfp_spur(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Always check if the API key is set and complain if it isn't, then set
# self.errorState to avoid this being a continual complaint during the scan.
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_spur but did not set an API key!")
+ self.error("You enabled sfp_spur but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -159,9 +159,9 @@ class sfp_spur(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -169,9 +169,9 @@ class sfp_spur(SpiderFootPlugin):
return
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
qrylist = list()
diff --git a/modules/sfp_spyonweb.py b/modules/sfp_spyonweb.py
index d9e9d66a..941b257d 100644
--- a/modules/sfp_spyonweb.py
+++ b/modules/sfp_spyonweb.py
@@ -99,43 +99,43 @@ class sfp_spyonweb(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts['timeout'], useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
status = data.get('status')
if status != 'found':
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
api_result = data.get('result')
if not api_result:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
endpoint_result = api_result.get(endpoint)
if not endpoint_result:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
results = endpoint_result.get(qry)
if not results:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
items = results.get('items')
if not items:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
return items
@@ -145,10 +145,10 @@ class sfp_spyonweb(SpiderFootPlugin):
items = self.query('analytics', qry, limit)
if not items:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
- self.sf.info("Retrieved " + str(len(items)) + " results")
+ self.info("Retrieved " + str(len(items)) + " results")
return items
@@ -157,10 +157,10 @@ class sfp_spyonweb(SpiderFootPlugin):
items = self.query('adsense', qry, limit)
if not items:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
- self.sf.info("Retrieved " + str(len(items)) + " results")
+ self.info("Retrieved " + str(len(items)) + " results")
return items
@@ -169,10 +169,10 @@ class sfp_spyonweb(SpiderFootPlugin):
items = self.query('ip', qry, limit)
if not items:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
- self.sf.info("Retrieved " + str(len(items)) + " results")
+ self.info("Retrieved " + str(len(items)) + " results")
return items
@@ -181,10 +181,10 @@ class sfp_spyonweb(SpiderFootPlugin):
items = self.query('summary', qry, limit)
if not items:
- self.sf.debug("No results found for " + qry)
+ self.debug("No results found for " + qry)
return None
- self.sf.info("Retrieved " + str(len(items)) + " results")
+ self.info("Retrieved " + str(len(items)) + " results")
return items
@@ -202,10 +202,10 @@ class sfp_spyonweb(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_spyonweb but did not set an API key!")
+ self.error("You enabled sfp_spyonweb but did not set an API key!")
self.errorState = True
return
@@ -216,7 +216,7 @@ class sfp_spyonweb(SpiderFootPlugin):
data = self.querySummary(eventData, limit=self.opts['limit'])
if data is None:
- self.sf.info(f"No data found for {eventData}")
+ self.info(f"No data found for {eventData}")
return
google_adsense = data.get('adsense')
@@ -239,7 +239,7 @@ class sfp_spyonweb(SpiderFootPlugin):
network = eventData.split(": ")[0]
analytics_id = eventData.split(": ")[1]
except Exception as e:
- self.sf.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})")
+ self.error(f"Unable to parse WEB_ANALYTICS_ID: {eventData} ({e})")
return
data = dict()
@@ -251,14 +251,14 @@ class sfp_spyonweb(SpiderFootPlugin):
return
if data is None:
- self.sf.info("No data found for " + eventData)
+ self.info("No data found for " + eventData)
return
for r in list(data.keys()):
last_seen = int(datetime.datetime.strptime(data[r], '%Y-%m-%d').strftime('%s')) * 1000
if last_seen < agelimit:
- self.sf.debug("Record found too old, skipping.")
+ self.debug("Record found too old, skipping.")
continue
evt = SpiderFootEvent("AFFILIATE_INTERNET_NAME", r, self.__name__, event)
@@ -273,7 +273,7 @@ class sfp_spyonweb(SpiderFootPlugin):
data = self.queryIP(eventData, limit=self.opts['limit'])
if data is None:
- self.sf.info("No data found for " + eventData)
+ self.info("No data found for " + eventData)
return
self.cohostcount = 0
@@ -282,11 +282,11 @@ class sfp_spyonweb(SpiderFootPlugin):
last_seen = int(datetime.datetime.strptime(data[co], '%Y-%m-%d').strftime('%s')) * 1000
if last_seen < agelimit:
- self.sf.debug("Record found too old, skipping.")
+ self.debug("Record found too old, skipping.")
continue
if self.opts['verify'] and not self.sf.validateIP(co, eventData):
- self.sf.debug(f"Host {co} no longer resolves to {eventData}")
+ self.debug(f"Host {co} no longer resolves to {eventData}")
continue
if not self.opts['cohostsamedomain']:
diff --git a/modules/sfp_spyse.py b/modules/sfp_spyse.py
index 44878ff0..41dcea49 100644
--- a/modules/sfp_spyse.py
+++ b/modules/sfp_spyse.py
@@ -252,28 +252,28 @@ class sfp_spyse(SpiderFootPlugin):
"""
if res['code'] == '400':
- self.sf.error("Malformed request")
+ self.error("Malformed request")
return None
if res['code'] == '402':
- self.sf.error("Request limit exceeded")
+ self.error("Request limit exceeded")
self.errorState = True
return None
if res['code'] == '403':
- self.sf.error("Authentication failed")
+ self.error("Authentication failed")
self.errorState = True
return None
# Future proofing - Spyse does not implement rate limiting
if res['code'] == '429':
- self.sf.error("You are being rate-limited by Spyse")
+ self.error("You are being rate-limited by Spyse")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from Spyse")
+ self.error("Failed to retrieve content from Spyse")
self.errorState = True
return None
@@ -283,11 +283,11 @@ class sfp_spyse(SpiderFootPlugin):
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
if data.get('message'):
- self.sf.debug("Received error from Spyse: " + data.get('message'))
+ self.debug("Received error from Spyse: " + data.get('message'))
return data
@@ -316,7 +316,7 @@ class sfp_spyse(SpiderFootPlugin):
return
if self.opts['api_key'] == '':
- self.sf.error("You enabled sfp_spyse but did not set an API key!")
+ self.error("You enabled sfp_spyse but did not set an API key!")
self.errorState = True
return
eventName = event.eventType
@@ -328,7 +328,7 @@ class sfp_spyse(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Query open ports for source IP Address
if eventName in ["IP_ADDRESS"]:
@@ -359,7 +359,7 @@ class sfp_spyse(SpiderFootPlugin):
data = data.get("data")
if data is None:
- self.sf.debug("No domains found on IP address " + eventData)
+ self.debug("No domains found on IP address " + eventData)
nextPageHasData = False
break
else:
@@ -385,7 +385,7 @@ class sfp_spyse(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.validateIP(co, eventData):
- self.sf.debug("Host " + co + " no longer resolves to " + eventData)
+ self.debug("Host " + co + " no longer resolves to " + eventData)
continue
if not self.opts['cohostsamedomain']:
@@ -409,7 +409,7 @@ class sfp_spyse(SpiderFootPlugin):
data = data.get("data")
if data is None:
- self.sf.debug("No open ports found for IP " + eventData)
+ self.debug("No open ports found for IP " + eventData)
else:
records = data.get('items')
if records:
@@ -602,7 +602,7 @@ class sfp_spyse(SpiderFootPlugin):
data = data.get("data")
if data is None:
- self.sf.debug("No subdomains found for domain " + eventData)
+ self.debug("No subdomains found for domain " + eventData)
nextPageHasData = False
break
else:
@@ -631,7 +631,7 @@ class sfp_spyse(SpiderFootPlugin):
continue
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.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_sslcert.py b/modules/sfp_sslcert.py
index 1dab347b..12e5891d 100644
--- a/modules/sfp_sslcert.py
+++ b/modules/sfp_sslcert.py
@@ -78,7 +78,7 @@ class sfp_sslcert(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "LINKED_URL_INTERNAL":
if not eventData.lower().startswith("https://") and not self.opts['tryhttp']:
@@ -92,7 +92,7 @@ class sfp_sslcert(SpiderFootPlugin):
port = u.port
fqdn = self.sf.urlFQDN(eventData.lower())
except Exception:
- self.sf.debug("Couldn't parse URL: " + eventData)
+ self.debug("Couldn't parse URL: " + eventData)
return
else:
fqdn = eventData
@@ -103,7 +103,7 @@ class sfp_sslcert(SpiderFootPlugin):
else:
return
- self.sf.debug("Testing SSL for: " + fqdn + ':' + str(port))
+ self.debug("Testing SSL for: " + fqdn + ':' + str(port))
# Re-fetch the certificate from the site and process
try:
sock = self.sf.safeSSLSocket(fqdn, port, self.opts['ssltimeout'])
@@ -112,7 +112,7 @@ class sfp_sslcert(SpiderFootPlugin):
pemcert = self.sf.sslDerToPem(dercert)
cert = self.sf.parseCert(str(pemcert), fqdn, self.opts['certexpiringdays'])
except Exception as x:
- self.sf.info("Unable to SSL-connect to " + fqdn + " (" + str(x) + ")")
+ self.info("Unable to SSL-connect to " + fqdn + " (" + str(x) + ")")
return
if eventName in ['INTERNET_NAME', 'IP_ADDRESS']:
@@ -120,7 +120,7 @@ class sfp_sslcert(SpiderFootPlugin):
self.notifyListeners(evt)
if not cert.get('text'):
- self.sf.info("Failed to parse the SSL cert for " + fqdn)
+ self.info("Failed to parse the SSL cert for " + fqdn)
return
# Generate the event for the raw cert (in text form)
@@ -149,7 +149,7 @@ class sfp_sslcert(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, domain, self.__name__, event)
diff --git a/modules/sfp_stevenblack_hosts.py b/modules/sfp_stevenblack_hosts.py
index 3e16d25e..e138b109 100644
--- a/modules/sfp_stevenblack_hosts.py
+++ b/modules/sfp_stevenblack_hosts.py
@@ -76,7 +76,7 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):
return False
if target.lower() in blocklist:
- self.sf.debug(f"Host name {target} found in Steven Black Hosts block list.")
+ self.debug(f"Host name {target} found in Steven Black Hosts block list.")
return True
return False
@@ -95,12 +95,12 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from {url}")
+ self.error(f"Unexpected HTTP response code {res['code']} from {url}")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error(f"Received no content from {url}")
+ self.error(f"Received no content from {url}")
self.errorState = True
return None
@@ -143,10 +143,10 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -167,7 +167,7 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with Steven Black Hosts blocklist")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with Steven Black Hosts blocklist")
if self.queryBlocklist(eventData):
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
diff --git a/modules/sfp_strangeheaders.py b/modules/sfp_strangeheaders.py
index 037deac8..d141e6e7 100644
--- a/modules/sfp_strangeheaders.py
+++ b/modules/sfp_strangeheaders.py
@@ -117,7 +117,7 @@ class sfp_strangeheaders(SpiderFootPlugin):
eventData = event.data
eventSource = event.actualSource
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventSource in self.results:
return
@@ -125,13 +125,13 @@ class sfp_strangeheaders(SpiderFootPlugin):
fqdn = self.sf.urlFQDN(eventSource)
if not self.getTarget().matches(fqdn):
- self.sf.debug(f"Not collecting header information for external sites. Ignoring HTTP headers from {fqdn}")
+ self.debug(f"Not collecting header information for external sites. Ignoring HTTP headers from {fqdn}")
return
try:
data = json.loads(eventData)
except Exception:
- self.sf.error("Received HTTP headers from another module in an unexpected format.")
+ self.error("Received HTTP headers from another module in an unexpected format.")
return
for key in data:
diff --git a/modules/sfp_subdomain_takeover.py b/modules/sfp_subdomain_takeover.py
index c9341bbe..7d5507ef 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(f"Unable to fetch {url}")
+ self.error(f"Unable to fetch {url}")
self.errorState = True
return
@@ -64,7 +64,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
try:
self.fingerprints = json.loads(content)
except Exception as e:
- self.sf.error(f"Unable to parse subdomain takeover fingerprints list: {e}")
+ self.error(f"Unable to parse subdomain takeover fingerprints list: {e}")
self.errorState = True
return
@@ -90,7 +90,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName == "AFFILIATE_INTERNET_NAME":
for data in self.fingerprints:
@@ -119,7 +119,7 @@ class sfp_subdomain_takeover(SpiderFootPlugin):
continue
for fingerprint in fingerprints:
if fingerprint in res['content']:
- self.sf.info(f"{eventData} appears to be vulnerable to takeover on {service}")
+ self.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 cname.lower() not in eventData.lower():
continue
- self.sf.info(f"{eventData} appears to be vulnerable to takeover on {service}")
+ self.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_sublist3r.py b/modules/sfp_sublist3r.py
index a03c1e3b..d517f197 100644
--- a/modules/sfp_sublist3r.py
+++ b/modules/sfp_sublist3r.py
@@ -40,7 +40,7 @@ class sfp_sublist3r(SpiderFootPlugin):
def setup(self, sfc, userOpts=dict()):
self.sf = sfc
- self.sf.debug("Setting up sfp_sublist3r")
+ self.debug("Setting up sfp_sublist3r")
self.results = self.tempStorage()
self.opts.update(userOpts)
@@ -66,12 +66,12 @@ class sfp_sublist3r(SpiderFootPlugin):
try:
ret = [s.strip().lower() for s in json.loads(res["content"])]
except json.decoder.JSONDecodeError as e:
- self.sf.error(f"Error decoding JSON response: {e}")
+ self.error(f"Error decoding JSON response: {e}")
except TypeError:
- self.sf.error("Error querying Sublist3r API")
+ self.error("Error querying Sublist3r API")
if res["code"] not in ["200"]:
- self.sf.error(f"Bad response code \"{res['code']}\" from Sublist3r API")
+ self.error(f"Bad response code \"{res['code']}\" from Sublist3r API")
return list(set(ret))
@@ -85,7 +85,7 @@ class sfp_sublist3r(SpiderFootPlugin):
def handleEvent(self, event):
query = str(event.data).lower()
- self.sf.debug(f"Received event, {event.eventType}, from {event.module}")
+ self.debug(f"Received event, {event.eventType}, from {event.module}")
# skip if we've already processed this event (or its parent domain/subdomain)
target = self.getTarget()
@@ -93,7 +93,7 @@ class sfp_sublist3r(SpiderFootPlugin):
if eventDataHash in self.results or \
(target.matches(query, includeParents=True) and not
target.matches(query, includeChildren=False)):
- self.sf.debug(f"Skipping already-processed event, {event.eventType}, from {event.module}")
+ self.debug(f"Skipping already-processed event, {event.eventType}, from {event.module}")
return
self.results[eventDataHash] = True
@@ -102,4 +102,4 @@ class sfp_sublist3r(SpiderFootPlugin):
target.matches(hostname, includeChildren=False):
self.sendEvent(event, hostname)
else:
- self.sf.debug(f"Invalid subdomain: {hostname}")
+ self.debug(f"Invalid subdomain: {hostname}")
diff --git a/modules/sfp_talosintel.py b/modules/sfp_talosintel.py
index 0501f4bd..2a89f46e 100644
--- a/modules/sfp_talosintel.py
+++ b/modules/sfp_talosintel.py
@@ -94,13 +94,13 @@ class sfp_talosintel(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in Talos Intelligence blacklist.")
+ self.debug(f"IP address {target} found in Talos Intelligence blacklist.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in Talos Intelligence blacklist.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in Talos Intelligence blacklist.")
return True
return False
@@ -120,12 +120,12 @@ class sfp_talosintel(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from Talos Intelligence.")
+ self.error(f"Unexpected HTTP response code {res['code']} from Talos Intelligence.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from Talos Intelligence")
+ self.error("Received no content from Talos Intelligence")
self.errorState = True
return None
@@ -163,10 +163,10 @@ class sfp_talosintel(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -195,7 +195,7 @@ class sfp_talosintel(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with Talos Intelligence")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with Talos Intelligence")
if self.queryBlacklist(eventData, targetType):
url = "https://snort.org/downloads/ip-block-list"
diff --git a/modules/sfp_template.py b/modules/sfp_template.py
index ba67348e..3743ca59 100644
--- a/modules/sfp_template.py
+++ b/modules/sfp_template.py
@@ -245,7 +245,7 @@ class sfp_template(SpiderFootPlugin):
# - error(message) if it's a bad thing and should cause the scan to abort
# - fatal(message) if it's a horrible thing and should kill SpiderFoot completely
if res['content'] is None:
- self.sf.info(f"No SHODAN info found for {qry}")
+ self.info(f"No SHODAN info found for {qry}")
return None
# Always process external data which is expected to be in a specific format
@@ -253,7 +253,7 @@ class sfp_template(SpiderFootPlugin):
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from SHODAN: {e}")
+ self.error(f"Error processing JSON response from SHODAN: {e}")
return None
@@ -272,7 +272,7 @@ class sfp_template(SpiderFootPlugin):
# Check if the module has already analysed this event data.
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
# Add the event data to results dictionary to prevent duplicate queries.
@@ -288,7 +288,7 @@ class sfp_template(SpiderFootPlugin):
max_netblock = self.opts['maxnetblock']
net_size = IPNetwork(eventData).prefixlen
if net_size < max_netblock:
- self.sf.debug(f"Network size {net_size} bigger than permitted: {max_netblock}")
+ self.debug(f"Network size {net_size} bigger than permitted: {max_netblock}")
return
# When handling netblocks/subnets, assuming the user set
diff --git a/modules/sfp_textmagic.py b/modules/sfp_textmagic.py
index 9dd9d719..7dcc5106 100644
--- a/modules/sfp_textmagic.py
+++ b/modules/sfp_textmagic.py
@@ -86,7 +86,7 @@ class sfp_textmagic(SpiderFootPlugin):
error_str = f", message {error_message}"
else:
error_str = ""
- self.sf.error(f"Failed to get results for {qry}, code {res['code']}{error_str}")
+ self.error(f"Failed to get results for {qry}, code {res['code']}{error_str}")
def queryPhoneNumber(self, qry):
headers = {
@@ -106,13 +106,13 @@ class sfp_textmagic(SpiderFootPlugin):
return None
if res['content'] is None:
- self.sf.info(f"No TextMagic info found for {qry}")
+ self.info(f"No TextMagic info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from TextMagic: {e}")
+ self.error(f"Error processing JSON response from TextMagic: {e}")
return None
@@ -124,10 +124,10 @@ class sfp_textmagic(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "" or self.opts["api_key_username"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API Username/Key!"
)
self.errorState = True
diff --git a/modules/sfp_threatcrowd.py b/modules/sfp_threatcrowd.py
index c0ac0992..f7f4cf9a 100644
--- a/modules/sfp_threatcrowd.py
+++ b/modules/sfp_threatcrowd.py
@@ -104,13 +104,13 @@ class sfp_threatcrowd(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")
if res['content'] is None:
- self.sf.info(f"No ThreatCrowd info found for {qry}")
+ self.info(f"No ThreatCrowd info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from ThreatCrowd: {e}")
+ self.error(f"Error processing JSON response from ThreatCrowd: {e}")
self.errorState = True
return None
@@ -124,10 +124,10 @@ class sfp_threatcrowd(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -143,7 +143,7 @@ class sfp_threatcrowd(SpiderFootPlugin):
return
max_netblock = self.opts['maxnetblock']
if IPNetwork(eventData).prefixlen < max_netblock:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -151,7 +151,7 @@ class sfp_threatcrowd(SpiderFootPlugin):
return
max_subnet = self.opts['maxsubnet']
if IPNetwork(eventData).prefixlen < max_subnet:
- self.sf.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
+ self.debug(f"Network size bigger than permitted: {IPNetwork(eventData).prefixlen} > {max_subnet}")
return
qrylist = list()
@@ -170,7 +170,7 @@ class sfp_threatcrowd(SpiderFootPlugin):
if info is None:
continue
if info.get('votes', 0) < 0:
- self.sf.info("Found ThreatCrowd URL data for " + addr)
+ self.info("Found ThreatCrowd URL data for " + addr)
if eventName in ["IP_ADDRESS"] or eventName.startswith("NETBLOCK_"):
evt = "MALICIOUS_IPADDR"
diff --git a/modules/sfp_threatfox.py b/modules/sfp_threatfox.py
index e9cdff97..962f63a7 100644
--- a/modules/sfp_threatfox.py
+++ b/modules/sfp_threatfox.py
@@ -93,35 +93,35 @@ class sfp_threatfox(SpiderFootPlugin):
return None
if res['code'] == "429":
- self.sf.error("You are being rate-limited by ThreatFox.")
+ self.error("You are being rate-limited by ThreatFox.")
self.errorState = True
return None
if res['code'] != '200':
- self.sf.error(f"Unexpected reply from ThreatFox: {res['code']}")
+ self.error(f"Unexpected reply from ThreatFox: {res['code']}")
self.errorState = True
return None
try:
json_result = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response from ThreatFox: {e}")
+ self.debug(f"Error processing JSON response from ThreatFox: {e}")
return None
query_status = json_result.get('query_status')
if query_status == 'no_result':
- self.sf.debug(f"No results from ThreatFox for: {qry}")
+ self.debug(f"No results from ThreatFox for: {qry}")
return None
if query_status != 'ok':
- self.sf.debug(f"ThreatFox query failed: {query_status}")
+ self.debug(f"ThreatFox query failed: {query_status}")
return None
data = json_result.get('data')
if not data:
- self.sf.debug(f"No results from ThreatFox for: {qry}")
+ self.debug(f"No results from ThreatFox for: {qry}")
return None
return data
@@ -134,10 +134,10 @@ class sfp_threatfox(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if eventName not in self.watchedEvents():
diff --git a/modules/sfp_threatminer.py b/modules/sfp_threatminer.py
index 9ebf5ba3..16b086dd 100644
--- a/modules/sfp_threatminer.py
+++ b/modules/sfp_threatminer.py
@@ -111,17 +111,17 @@ class sfp_threatminer(SpiderFootPlugin):
res = self.sf.fetchUrl(url, timeout=10, useragent="SpiderFoot")
if res['content'] is None:
- self.sf.info("No ThreatMiner info found for " + qry)
+ self.info("No ThreatMiner info found for " + qry)
return None
if len(res['content']) == 0:
- self.sf.info("No ThreatMiner info found for " + qry)
+ self.info("No ThreatMiner info found for " + qry)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from ThreatMiner: {e}")
+ self.error(f"Error processing JSON response from ThreatMiner: {e}")
return None
@@ -131,10 +131,10 @@ class sfp_threatminer(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -143,18 +143,18 @@ class sfp_threatminer(SpiderFootPlugin):
if not self.opts['netblocklookup']:
return
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
if not self.opts['subnetlookup']:
return
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
qrylist = list()
@@ -171,7 +171,7 @@ class sfp_threatminer(SpiderFootPlugin):
evtType = "CO_HOSTED_SITE"
ret = self.query(qry, "passive")
if ret is None:
- self.sf.info("No Passive DNS info for " + qry)
+ self.info("No Passive DNS info for " + qry)
return
if "results" not in ret:
@@ -179,7 +179,7 @@ class sfp_threatminer(SpiderFootPlugin):
if len(ret['results']) == 0:
continue
- self.sf.debug("Found passive DNS results in ThreatMiner")
+ self.debug("Found passive DNS results in ThreatMiner")
res = ret["results"]
for rec in res:
# Skip stuff with no date
@@ -189,7 +189,7 @@ class sfp_threatminer(SpiderFootPlugin):
last_ts = int(time.mktime(last_seen.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and last_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({last_seen}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
host = rec['domain']
@@ -213,15 +213,15 @@ class sfp_threatminer(SpiderFootPlugin):
evtType = "INTERNET_NAME"
ret = self.query(eventData, "subs")
if ret is None:
- self.sf.debug("No hosts found")
+ self.debug("No hosts found")
return
if len(ret.get("results", list())) == 0:
- self.sf.debug("No hosts found")
+ self.debug("No hosts found")
return
for host in ret.get("results"):
- self.sf.debug("Found host results in ThreatMiner")
+ self.debug("Found host results in ThreatMiner")
if host in self.reportedhosts:
continue
diff --git a/modules/sfp_tldsearch.py b/modules/sfp_tldsearch.py
index 858d7b1a..9ae5a345 100644
--- a/modules/sfp_tldsearch.py
+++ b/modules/sfp_tldsearch.py
@@ -99,7 +99,7 @@ class sfp_tldsearch(SpiderFootPlugin):
t = []
# Spawn threads for scanning
- self.sf.info("Spawning threads to check TLDs: " + str(tldList))
+ self.info("Spawning threads to check TLDs: " + str(tldList))
for pair in tldList:
(domain, tld) = pair
tn = 'thread_sfp_tldsearch_' + str(random.SystemRandom().randint(0, 999999999))
@@ -125,7 +125,7 @@ class sfp_tldsearch(SpiderFootPlugin):
# Store the result internally and notify listening modules
def sendEvent(self, source, result):
- self.sf.info("Found a TLD with the target's name: " + result)
+ self.info("Found a TLD with the target's name: " + result)
self.results[result] = True
# Inform listening modules
@@ -157,10 +157,10 @@ class sfp_tldsearch(SpiderFootPlugin):
keyword = self.sf.domainKeyword(eventData, self.opts['_internettlds'])
if not keyword:
- self.sf.error(f"Failed to extract keyword from {eventData}")
+ self.error(f"Failed to extract keyword from {eventData}")
return
- self.sf.debug(f"Keyword extracted from {eventData}: {keyword}")
+ self.debug(f"Keyword extracted from {eventData}: {keyword}")
if keyword in self.results:
return
diff --git a/modules/sfp_tool_cmseek.py b/modules/sfp_tool_cmseek.py
index 25c86b31..d57cb454 100644
--- a/modules/sfp_tool_cmseek.py
+++ b/modules/sfp_tool_cmseek.py
@@ -75,19 +75,19 @@ class sfp_tool_cmseek(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData} as already scanned.")
+ self.debug(f"Skipping {eventData} as already scanned.")
return
self.results[eventData] = True
if not self.opts['cmseekpath']:
- self.sf.error("You enabled sfp_tool_cmseek but did not set a path to the tool!")
+ self.error("You enabled sfp_tool_cmseek but did not set a path to the tool!")
self.errorState = True
return
@@ -104,13 +104,13 @@ class sfp_tool_cmseek(SpiderFootPlugin):
# If tool is not found, abort
if not os.path.isfile(exe):
- self.sf.error(f"File does not exist: {exe}")
+ self.error(f"File does not exist: {exe}")
self.errorState = True
return
# Sanitize domain name.
if not SpiderFootHelpers.sanitiseInput(eventData):
- self.sf.error("Invalid input, refusing to run.")
+ self.error("Invalid input, refusing to run.")
return
args = [
@@ -125,27 +125,27 @@ class sfp_tool_cmseek(SpiderFootPlugin):
p = Popen(args, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(input=None)
except Exception as e:
- self.sf.error(f"Unable to run CMSeeK: {e}")
+ self.error(f"Unable to run CMSeeK: {e}")
return
if p.returncode != 0:
- self.sf.error(f"Unable to read CMSeeK output\nstderr: {stderr}\nstdout: {stdout}")
+ self.error(f"Unable to read CMSeeK output\nstderr: {stderr}\nstdout: {stdout}")
return
if b"CMS Detection failed" in stdout:
- self.sf.debug(f"Could not detect the CMS for {eventData}")
+ self.debug(f"Could not detect the CMS for {eventData}")
return
log_path = f"{resultpath}/{eventData}/cms.json"
if not os.path.isfile(log_path):
- self.sf.error(f"File does not exist: {log_path}")
+ self.error(f"File does not exist: {log_path}")
return
try:
f = io.open(log_path, encoding='utf-8')
j = json.loads(f.read())
except Exception as e:
- self.sf.error(f"Could not parse CMSeeK output file {log_path} as JSON: {e}")
+ self.error(f"Could not parse CMSeeK output file {log_path} as JSON: {e}")
return
cms_name = j.get('cms_name')
diff --git a/modules/sfp_tool_dnstwist.py b/modules/sfp_tool_dnstwist.py
index 47d1dd3e..61fe05ab 100644
--- a/modules/sfp_tool_dnstwist.py
+++ b/modules/sfp_tool_dnstwist.py
@@ -78,13 +78,13 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already scanned.")
+ self.debug("Skipping " + eventData + " as already scanned.")
return
self.results[eventData] = True
@@ -94,7 +94,7 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
cmd = ['dnstwist']
else:
if not self.opts['dnstwistpath']:
- self.sf.error("You enabled sfp_tool_dnstwist but did not set a path to the tool!")
+ self.error("You enabled sfp_tool_dnstwist but did not set a path to the tool!")
self.errorState = True
return
@@ -108,7 +108,7 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
# If tool is not found, abort
if not Path(exe).is_file():
- self.sf.error("File does not exist: " + exe)
+ self.error("File does not exist: " + exe)
self.errorState = True
return
@@ -116,7 +116,7 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
# Sanitize domain name.
if not SpiderFootHelpers.sanitiseInput(eventData):
- self.sf.error("Invalid input, refusing to run.")
+ self.error("Invalid input, refusing to run.")
return
try:
@@ -125,8 +125,8 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
if p.returncode == 0:
content = stdout
else:
- self.sf.error("Unable to read DNSTwist content.")
- self.sf.debug("Error running DNSTwist: " + stderr + ", " + stdout)
+ self.error("Unable to read DNSTwist content.")
+ self.debug("Error running DNSTwist: " + stderr + ", " + stdout)
return
# For each line in output, generate a SIMILARDOMAIN event
@@ -140,10 +140,10 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
self.__name__, event)
self.notifyListeners(evt)
except Exception as e:
- self.sf.error("Couldn't parse the JSON output of DNSTwist: " + str(e))
+ self.error("Couldn't parse the JSON output of DNSTwist: " + str(e))
return
except Exception as e:
- self.sf.error("Unable to run DNSTwist: " + str(e))
+ self.error("Unable to run DNSTwist: " + str(e))
return
# End of sfp_tool_dnstwist class
diff --git a/modules/sfp_tool_nmap.py b/modules/sfp_tool_nmap.py
index 8ba3750f..dece5814 100644
--- a/modules/sfp_tool_nmap.py
+++ b/modules/sfp_tool_nmap.py
@@ -81,10 +81,10 @@ class sfp_tool_nmap(SpiderFootPlugin):
eventData = event.data
if srcModuleName == "sfp_tool_nmap":
- self.sf.debug("Skipping event from myself.")
+ self.debug("Skipping event from myself.")
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
@@ -93,28 +93,28 @@ class sfp_tool_nmap(SpiderFootPlugin):
if eventName == "NETBLOCK_OWNER" and self.opts['netblockscan']:
net = IPNetwork(eventData)
if net.prefixlen < self.opts['netblockscanmax']:
- self.sf.debug("Skipping port scanning of " + eventData + ", too big.")
+ self.debug("Skipping port scanning of " + eventData + ", too big.")
return
except Exception as e:
- self.sf.error("Strange netblock identified, unable to parse: " + eventData + " (" + str(e) + ")")
+ self.error("Strange netblock identified, unable to parse: " + eventData + " (" + str(e) + ")")
return
# Don't look up stuff twice, check IP == IP here
if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already scanned.")
+ self.debug("Skipping " + eventData + " as already scanned.")
return
else:
# Might be a subnet within a subnet or IP within a subnet
for addr in self.results:
if IPNetwork(eventData) in IPNetwork(addr):
- self.sf.debug("Skipping " + eventData + " as already within a scanned range.")
+ self.debug("Skipping " + eventData + " as already within a scanned range.")
return
self.results[eventData] = True
if not self.opts['nmappath']:
- self.sf.error("You enabled sfp_tool_nmap but did not set a path to the tool!")
+ self.error("You enabled sfp_tool_nmap but did not set a path to the tool!")
self.errorState = True
return
@@ -124,18 +124,18 @@ class sfp_tool_nmap(SpiderFootPlugin):
elif self.opts['nmappath'].endswith('/'):
exe = self.opts['nmappath'] + "nmap"
else:
- self.sf.error("Could not recognize your nmap path configuration.")
+ self.error("Could not recognize your nmap path configuration.")
self.errorState = True
# If tool is not found, abort
if not os.path.isfile(exe):
- self.sf.error("File does not exist: " + exe)
+ self.error("File does not exist: " + exe)
self.errorState = True
return
# Sanitize domain name.
if not self.sf.validIP(eventData) and not self.sf.validIpNetwork(eventData):
- self.sf.error("Invalid input, refusing to run.")
+ self.error("Invalid input, refusing to run.")
return
try:
@@ -144,19 +144,19 @@ class sfp_tool_nmap(SpiderFootPlugin):
if p.returncode == 0:
content = stdout.decode('utf-8', errors='replace')
else:
- self.sf.error("Unable to read Nmap content.")
- self.sf.debug(f"Error running Nmap: {stderr}, {stdout}")
+ self.error("Unable to read Nmap content.")
+ self.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(f"Couldn't reliably detect the OS for {eventData}")
+ self.debug(f"Couldn't reliably detect the OS for {eventData}")
return
except Exception as e:
- self.sf.error(f"Unable to run Nmap: {e}")
+ self.error(f"Unable to run Nmap: {e}")
return
if not content:
- self.sf.debug("No content from Nmap to parse.")
+ self.debug("No content from Nmap to parse.")
return
if eventName == "IP_ADDRESS":
@@ -169,7 +169,7 @@ class sfp_tool_nmap(SpiderFootPlugin):
evt = SpiderFootEvent("OPERATING_SYSTEM", opsys, self.__name__, event)
self.notifyListeners(evt)
except Exception as e:
- self.sf.error("Couldn't parse the output of Nmap: " + str(e))
+ self.error("Couldn't parse the output of Nmap: " + str(e))
return
if eventName == "NETBLOCK_OWNER":
@@ -190,7 +190,7 @@ class sfp_tool_nmap(SpiderFootPlugin):
self.notifyListeners(evt)
currentIp = None
except Exception as e:
- self.sf.error(f"Couldn't parse the output of Nmap: {e}")
+ self.error(f"Couldn't parse the output of Nmap: {e}")
return
# End of sfp_tool_nmap class
diff --git a/modules/sfp_tool_wafw00f.py b/modules/sfp_tool_wafw00f.py
index 27f2190a..cda32e5a 100644
--- a/modules/sfp_tool_wafw00f.py
+++ b/modules/sfp_tool_wafw00f.py
@@ -66,19 +66,19 @@ class sfp_tool_wafw00f(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData} as already scanned.")
+ self.debug(f"Skipping {eventData} as already scanned.")
return
self.results[eventData] = True
if not self.opts['wafw00f_path']:
- self.sf.error("You enabled sfp_tool_wafw00f but did not set a path to the tool!")
+ self.error("You enabled sfp_tool_wafw00f but did not set a path to the tool!")
self.errorState = True
return
@@ -87,14 +87,14 @@ class sfp_tool_wafw00f(SpiderFootPlugin):
exe = exe + 'wafw00f'
if not os.path.isfile(exe):
- self.sf.error(f"File does not exist: {exe}")
+ self.error(f"File does not exist: {exe}")
self.errorState = True
return
url = eventData
if not SpiderFootHelpers.sanitiseInput(url):
- self.sf.error("Invalid input, refusing to run.")
+ self.error("Invalid input, refusing to run.")
return
args = [
@@ -110,25 +110,25 @@ class sfp_tool_wafw00f(SpiderFootPlugin):
p = Popen(args, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(input=None)
except Exception as e:
- self.sf.error(f"Unable to run wafw00f: {e}")
+ self.error(f"Unable to run wafw00f: {e}")
return
if p.returncode != 0:
- self.sf.error(f"Unable to read wafw00f output\nstderr: {stderr}\nstdout: {stdout}")
+ self.error(f"Unable to read wafw00f output\nstderr: {stderr}\nstdout: {stdout}")
return
if not stdout:
- self.sf.debug(f"wafw00f returned no output for {eventData}")
+ self.debug(f"wafw00f returned no output for {eventData}")
return
try:
result_json = json.loads(stdout)
except Exception as e:
- self.sf.error(f"Could not parse wafw00f output as JSON: {e}\nstdout: {stdout}")
+ self.error(f"Could not parse wafw00f output as JSON: {e}\nstdout: {stdout}")
return
if not result_json:
- self.sf.debug(f"wafw00f returned no output for {eventData}")
+ self.debug(f"wafw00f returned no output for {eventData}")
return
evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(result_json), self.__name__, event)
diff --git a/modules/sfp_tool_whatweb.py b/modules/sfp_tool_whatweb.py
index 41df2670..27f43ea2 100644
--- a/modules/sfp_tool_whatweb.py
+++ b/modules/sfp_tool_whatweb.py
@@ -75,19 +75,19 @@ class sfp_tool_whatweb(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already scanned.")
+ self.debug("Skipping " + eventData + " as already scanned.")
return
self.results[eventData] = True
if not self.opts['whatweb_path']:
- self.sf.error("You enabled sfp_tool_whatweb but did not set a path to the tool!")
+ self.error("You enabled sfp_tool_whatweb but did not set a path to the tool!")
self.errorState = True
return
@@ -97,13 +97,13 @@ class sfp_tool_whatweb(SpiderFootPlugin):
# If tool is not found, abort
if not os.path.isfile(exe):
- self.sf.error("File does not exist: " + exe)
+ self.error("File does not exist: " + exe)
self.errorState = True
return
# Sanitize domain name.
if not SpiderFootHelpers.sanitiseInput(eventData):
- self.sf.error("Invalid input, refusing to run.")
+ self.error("Invalid input, refusing to run.")
return
# Set aggression level
@@ -131,22 +131,22 @@ class sfp_tool_whatweb(SpiderFootPlugin):
p = Popen(args, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(input=None)
except Exception as e:
- self.sf.error(f"Unable to run WhatWeb: {e}")
+ self.error(f"Unable to run WhatWeb: {e}")
return
if p.returncode != 0:
- self.sf.error("Unable to read WhatWeb output.")
- self.sf.debug("Error running WhatWeb: " + stderr + ", " + stdout)
+ self.error("Unable to read WhatWeb output.")
+ self.debug("Error running WhatWeb: " + stderr + ", " + stdout)
return
if not stdout:
- self.sf.debug(f"WhatWeb returned no output for {eventData}")
+ self.debug(f"WhatWeb returned no output for {eventData}")
return
try:
result_json = json.loads(stdout)
except Exception as e:
- self.sf.error(f"Couldn't parse the JSON output of WhatWeb: {e}")
+ self.error(f"Couldn't parse the JSON output of WhatWeb: {e}")
return
if len(result_json) == 0:
diff --git a/modules/sfp_torch.py b/modules/sfp_torch.py
index 82a51521..1b4fa8b0 100644
--- a/modules/sfp_torch.py
+++ b/modules/sfp_torch.py
@@ -80,7 +80,7 @@ class sfp_torch(SpiderFootPlugin):
return
if eventData in self.results:
- self.sf.debug(f"Already did a search for {eventData}, skipping.")
+ self.debug(f"Already did a search for {eventData}, skipping.")
return
self.results[eventData] = True
@@ -91,11 +91,11 @@ class sfp_torch(SpiderFootPlugin):
timeout=60)
if not formpage['content']:
- self.sf.info("Couldn't connect to TORCH, it might be down.")
+ self.info("Couldn't connect to TORCH, it might be down.")
return
if "<b>0</b> results" in formpage['content']:
- self.sf.info(f"No results found on TORCH for {eventData}")
+ self.info(f"No results found on TORCH for {eventData}")
return
pagecount = 0
@@ -117,7 +117,7 @@ class sfp_torch(SpiderFootPlugin):
timeout=60)
if data is None or not data.get('content'):
- self.sf.info("No results returned from TORCH.")
+ self.info("No results returned from TORCH.")
return
links = re.findall(r'<h5><a href="(.*?)"\s+target="_blank">',
@@ -130,7 +130,7 @@ class sfp_torch(SpiderFootPlugin):
linkcount += 1
self.results[link] = True
- self.sf.debug(f"Found a darknet mention: {link}")
+ self.debug(f"Found a darknet mention: {link}")
if self.sf.urlFQDN(link).endswith(".onion"):
if self.checkForStop():
return
@@ -139,11 +139,11 @@ class sfp_torch(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug(f"Ignoring {link} as no data returned")
+ self.debug(f"Ignoring {link} as no data returned")
continue
if eventData not in res['content']:
- self.sf.debug(f"Ignoring {link} as no mention of {eventData}")
+ self.debug(f"Ignoring {link} as no mention of {eventData}")
continue
evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)
self.notifyListeners(evt)
@@ -152,7 +152,7 @@ class sfp_torch(SpiderFootPlugin):
startIndex = res['content'].index(eventData) - 120
endIndex = startIndex + len(eventData) + 240
except Exception:
- self.sf.debug("String not found in content.")
+ self.debug("String not found in content.")
continue
darkcontent = res['content'][startIndex:endIndex]
diff --git a/modules/sfp_torexits.py b/modules/sfp_torexits.py
index 0f53d5e9..f5886ee2 100644
--- a/modules/sfp_torexits.py
+++ b/modules/sfp_torexits.py
@@ -82,13 +82,13 @@ class sfp_torexits(SpiderFootPlugin):
if targetType == "ip":
if target in exit_addresses:
- self.sf.debug(f"IP address {target} found in TOR exit node list.")
+ self.debug(f"IP address {target} found in TOR exit node list.")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in exit_addresses:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in TOR exit node list.")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in TOR exit node list.")
return True
return False
@@ -106,12 +106,12 @@ class sfp_torexits(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from check.torproject.org.")
+ self.error(f"Unexpected HTTP response code {res['code']} from check.torproject.org.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from check.torproject.org.")
+ self.error("Received no content from check.torproject.org.")
self.errorState = True
return None
@@ -146,10 +146,10 @@ class sfp_torexits(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -178,7 +178,7 @@ class sfp_torexits(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking if {eventData} ({eventName}) is a TOR exit node")
+ self.debug(f"Checking if {eventData} ({eventName}) is a TOR exit node")
if self.queryExitNodes(eventData, targetType):
url = "https://check.torproject.org/exit-addresses"
diff --git a/modules/sfp_trashpanda.py b/modules/sfp_trashpanda.py
index 50cee9f3..b5d5299c 100644
--- a/modules/sfp_trashpanda.py
+++ b/modules/sfp_trashpanda.py
@@ -104,7 +104,7 @@ class sfp_trashpanda(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error("Error retrieving search results from Trashpanda(got-hacked.wtf)")
+ self.error("Error retrieving search results from Trashpanda(got-hacked.wtf)")
return None
return json.loads(res['content'])
@@ -115,18 +115,18 @@ class sfp_trashpanda(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if self.opts['api_key_username'] == "" or self.opts['api_key_password'] == "":
- self.sf.error("You enabled sfp_trashpanda but did not set an API username / password!")
+ self.error("You enabled sfp_trashpanda but did not set an API username / password!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -145,7 +145,7 @@ class sfp_trashpanda(SpiderFootPlugin):
for leaksiteUrl in leaksiteUrls:
try:
- self.sf.debug("Found a link: " + leaksiteUrl)
+ self.debug("Found a link: " + leaksiteUrl)
if self.checkForStop():
return
@@ -154,7 +154,7 @@ class sfp_trashpanda(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['content'] is None:
- self.sf.debug(f"Ignoring {leaksiteUrl} as no data returned")
+ self.debug(f"Ignoring {leaksiteUrl} as no data returned")
continue
if re.search(
@@ -170,6 +170,6 @@ class sfp_trashpanda(SpiderFootPlugin):
evt = SpiderFootEvent("LEAKSITE_CONTENT", res['content'], self.__name__, evt)
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug(f"Error while fetching leaksite content : {str(e)}")
+ self.debug(f"Error while fetching leaksite content : {str(e)}")
# End of sfp_trashpanda class
diff --git a/modules/sfp_trumail.py b/modules/sfp_trumail.py
index 676da5b1..45f06f17 100644
--- a/modules/sfp_trumail.py
+++ b/modules/sfp_trumail.py
@@ -76,13 +76,13 @@ class sfp_trumail(SpiderFootPlugin):
)
if res['content'] is None:
- self.sf.info(f"No Trumail info found for {qry}")
+ self.info(f"No Trumail info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Trumail: {e}")
+ self.error(f"Error processing JSON response from Trumail: {e}")
return None
@@ -95,7 +95,7 @@ class sfp_trumail(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
self.results[eventData] = True
diff --git a/modules/sfp_twilio.py b/modules/sfp_twilio.py
index a61b5521..1a2ac08f 100644
--- a/modules/sfp_twilio.py
+++ b/modules/sfp_twilio.py
@@ -90,23 +90,23 @@ class sfp_twilio(SpiderFootPlugin):
)
if res['code'] == '400':
- self.sf.error("Bad request.")
+ self.error("Bad request.")
return None
if res['code'] == '404':
- self.sf.debug("Phone number not found.")
+ self.debug("Phone number not found.")
return None
if res['code'] == '429':
- self.sf.error("API usage limit reached.")
+ self.error("API usage limit reached.")
return None
if res['code'] == '503':
- self.sf.error("Service unavailable.")
+ self.error("Service unavailable.")
return None
if res['code'] != '200':
- self.sf.error("Could not fetch data.")
+ self.error("Could not fetch data.")
return None
return res.get('content')
@@ -120,17 +120,17 @@ class sfp_twilio(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Always check if the API key is set and complain if it isn't, then set
# self.errorState to avoid this being a continual complaint during the scan.
if self.opts['api_key_account_sid'] == "" or self.opts['api_key_auth_token'] == "":
- self.sf.error("You enabled sfp_twilio but did not set account sid/auth token")
+ self.error("You enabled sfp_twilio but did not set account sid/auth token")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_twitter.py b/modules/sfp_twitter.py
index 06292a9f..93a4e063 100644
--- a/modules/sfp_twitter.py
+++ b/modules/sfp_twitter.py
@@ -69,18 +69,18 @@ class sfp_twitter(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
# Retrieve profile
try:
network = eventData.split(": ")[0]
url = eventData.split(": ")[1].replace("<SFURL>", "").replace("</SFURL>", "")
except Exception as e:
- self.sf.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
+ self.error(f"Unable to parse SOCIAL_MEDIA: {eventData} ({e})")
return
if network != "Twitter":
- self.sf.debug(f"Skipping social network profile, {url}, as not a Twitter profile")
+ self.debug(f"Skipping social network profile, {url}, as not a Twitter profile")
return
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
@@ -90,7 +90,7 @@ class sfp_twitter(SpiderFootPlugin):
return
if res['code'] != "200":
- self.sf.debug(url + " is not a valid Twitter profile")
+ self.debug(url + " is not a valid Twitter profile")
return
# Retrieve name
@@ -107,7 +107,7 @@ class sfp_twitter(SpiderFootPlugin):
if location:
if len(location[0]) < 3 or len(location[0]) > 100:
- self.sf.debug("Skipping likely invalid location.")
+ self.debug("Skipping likely invalid location.")
else:
e = SpiderFootEvent("GEOINFO", location[0], self.__name__, event)
self.notifyListeners(e)
diff --git a/modules/sfp_uceprotect.py b/modules/sfp_uceprotect.py
index c2d8d5d7..543e031e 100644
--- a/modules/sfp_uceprotect.py
+++ b/modules/sfp_uceprotect.py
@@ -99,9 +99,9 @@ class sfp_uceprotect(SpiderFootPlugin):
try:
lookup = self.reverseAddr(qaddr) + "." + domain
- self.sf.debug("Checking Blacklist: " + lookup)
+ self.debug("Checking Blacklist: " + lookup)
addrs = self.sf.resolveHost(lookup)
- self.sf.debug("Addresses returned: " + str(addrs))
+ self.debug("Addresses returned: " + str(addrs))
if not addrs:
continue
@@ -113,7 +113,7 @@ class sfp_uceprotect(SpiderFootPlugin):
break
else:
if str(addr) not in list(self.checks[domain].keys()):
- self.sf.debug("Return code not found in list: " + str(addr))
+ self.debug("Return code not found in list: " + str(addr))
continue
k = str(addr)
@@ -134,7 +134,7 @@ class sfp_uceprotect(SpiderFootPlugin):
self.notifyListeners(evt)
except Exception as e:
- self.sf.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
+ self.debug("Unable to resolve " + qaddr + " / " + lookup + ": " + str(e))
# Handle events sent to this module
def handleEvent(self, event):
@@ -143,7 +143,7 @@ class sfp_uceprotect(SpiderFootPlugin):
eventData = event.data
parentEvent = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -155,9 +155,9 @@ class sfp_uceprotect(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -165,9 +165,9 @@ class sfp_uceprotect(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
if eventName.startswith("NETBLOCK_"):
diff --git a/modules/sfp_urlscan.py b/modules/sfp_urlscan.py
index 380736af..80212926 100644
--- a/modules/sfp_urlscan.py
+++ b/modules/sfp_urlscan.py
@@ -83,18 +83,18 @@ class sfp_urlscan(SpiderFootPlugin):
useragent=self.opts['_useragent'])
if res['code'] == "429":
- self.sf.error("You are being rate-limited by URLScan.io.")
+ self.error("You are being rate-limited by URLScan.io.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No results info found for " + qry)
+ self.info("No results info found for " + qry)
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
@@ -107,10 +107,10 @@ class sfp_urlscan(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -185,7 +185,7 @@ class sfp_urlscan(SpiderFootPlugin):
self.notifyListeners(evt)
if self.opts['verify'] and len(domains) > 0:
- self.sf.info("Resolving " + str(len(set(domains))) + " domains ...")
+ self.info("Resolving " + str(len(set(domains))) + " domains ...")
for domain in set(domains):
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
diff --git a/modules/sfp_venmo.py b/modules/sfp_venmo.py
index 15643075..164c5546 100644
--- a/modules/sfp_venmo.py
+++ b/modules/sfp_venmo.py
@@ -67,19 +67,19 @@ class sfp_venmo(SpiderFootPlugin):
time.sleep(1)
if res['content'] is None:
- self.sf.debug('No response from api.venmo.com')
+ self.debug('No response from api.venmo.com')
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
json_data = data.get('data')
if not json_data:
- self.sf.debug(qry + " is not a valid Venmo username")
+ self.debug(qry + " is not a valid Venmo username")
return None
return json_data
@@ -95,7 +95,7 @@ class sfp_venmo(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.query(eventData)
diff --git a/modules/sfp_viewdns.py b/modules/sfp_viewdns.py
index 2c9d705d..d6772baa 100644
--- a/modules/sfp_viewdns.py
+++ b/modules/sfp_viewdns.py
@@ -107,38 +107,38 @@ class sfp_viewdns(SpiderFootPlugin):
)
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("ViewDNS.info API key seems to have been rejected or you have exceeded usage limits.")
+ self.error("ViewDNS.info API key seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return
if res['content'] is None:
- self.sf.info(f"No ViewDNS.info data found for {qry}")
+ self.info(f"No ViewDNS.info data found for {qry}")
return
if res['content'] == 'Query limit reached for the supplied API key.':
- self.sf.error("ViewDNS.info API usage limit exceeded.")
+ self.error("ViewDNS.info API usage limit exceeded.")
self.errorState = True
return
try:
info = json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from ViewDNS.info: {e}")
+ self.error(f"Error processing JSON response from ViewDNS.info: {e}")
return
if not info.get("query"):
- self.sf.error("Error querying ViewDNS.info. Could be unavailable right now.")
+ self.error("Error querying ViewDNS.info. Could be unavailable right now.")
self.errorState = True
return
response = info.get("response")
if response:
if response.get("error"):
- self.sf.error(f"Error querying ViewDNS.info: {response.get('error')}")
+ self.error(f"Error querying ViewDNS.info: {response.get('error')}")
return
if len(response.get(responsekey, list())) == pagesize:
- self.sf.debug(f"Looping at ViewDNS page {page}")
+ self.debug(f"Looping at ViewDNS page {page}")
self.accum.extend(response.get(responsekey))
self.query(qry, querytype, page + 1)
@@ -153,15 +153,15 @@ class sfp_viewdns(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_viewdns but did not set an API key!")
+ self.error("You enabled sfp_viewdns but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -175,7 +175,7 @@ class sfp_viewdns(SpiderFootPlugin):
valkey = "name"
elif eventName == "PROVIDER_DNS":
if not self.getTarget().matches(eventData):
- self.sf.debug("DNS provider found but not related to target, skipping")
+ self.debug("DNS provider found but not related to target, skipping")
return
ident = "reversens"
valkey = "domain"
@@ -226,7 +226,7 @@ class sfp_viewdns(SpiderFootPlugin):
if eventName == "IP_ADDRESS" and self.opts['verify']:
if not self.sf.validateIP(h, eventData):
- self.sf.debug(f"Host {h} no longer resolves to IP address: {eventData}")
+ self.debug(f"Host {h} no longer resolves to IP address: {eventData}")
continue
e = SpiderFootEvent("CO_HOSTED_SITE", h, self.__name__, event)
diff --git a/modules/sfp_virustotal.py b/modules/sfp_virustotal.py
index 892d9ed2..033fb89e 100644
--- a/modules/sfp_virustotal.py
+++ b/modules/sfp_virustotal.py
@@ -125,13 +125,13 @@ class sfp_virustotal(SpiderFootPlugin):
time.sleep(15)
if res['content'] is None:
- self.sf.info(f"No VirusTotal info found for {qry}")
+ self.info(f"No VirusTotal info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from VirusTotal: {e}")
+ self.error(f"Error processing JSON response from VirusTotal: {e}")
self.errorState = True
return None
@@ -149,7 +149,7 @@ class sfp_virustotal(SpiderFootPlugin):
)
if res['code'] == "204":
- self.sf.error("Your request to VirusTotal was throttled.")
+ self.error("Your request to VirusTotal was throttled.")
return None
# Public API is limited to 4 queries per minute
@@ -157,13 +157,13 @@ class sfp_virustotal(SpiderFootPlugin):
time.sleep(15)
if res['content'] is None:
- self.sf.info(f"No VirusTotal info found for {qry}")
+ self.info(f"No VirusTotal info found for {qry}")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from VirusTotal: {e}")
+ self.error(f"Error processing JSON response from VirusTotal: {e}")
self.errorState = True
return None
@@ -176,17 +176,17 @@ class sfp_virustotal(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -204,7 +204,7 @@ class sfp_virustotal(SpiderFootPlugin):
net_size = IPNetwork(eventData).prefixlen
max_netblock = self.opts['maxnetblock']
if net_size < max_netblock:
- self.sf.debug(f"Network size {net_size} bigger than permitted: {max_netblock}")
+ self.debug(f"Network size {net_size} bigger than permitted: {max_netblock}")
return
if eventName == 'NETBLOCK_MEMBER':
@@ -214,7 +214,7 @@ class sfp_virustotal(SpiderFootPlugin):
net_size = IPNetwork(eventData).prefixlen
max_subnet = self.opts['maxsubnet']
if net_size < max_subnet:
- self.sf.debug(f"Network size {net_size} bigger than permitted: {max_subnet}")
+ self.debug(f"Network size {net_size} bigger than permitted: {max_subnet}")
return
qrylist = list()
@@ -238,7 +238,7 @@ class sfp_virustotal(SpiderFootPlugin):
continue
if len(info.get('detected_urls', [])) > 0:
- self.sf.info(f"Found VirusTotal URL data for {addr}")
+ self.info(f"Found VirusTotal URL data for {addr}")
if eventName in ["IP_ADDRESS"] or eventName.startswith("NETBLOCK_"):
evt = "MALICIOUS_IPADDR"
@@ -293,7 +293,7 @@ class sfp_virustotal(SpiderFootPlugin):
evt_type = 'AFFILIATE_INTERNET_NAME'
if self.opts['verify'] and not self.sf.resolveHost(domain) and not self.sf.resolveHost6(domain):
- self.sf.debug(f"Host {domain} could not be resolved")
+ self.debug(f"Host {domain} could not be resolved")
evt_type += '_UNRESOLVED'
evt = SpiderFootEvent(evt_type, domain, self.__name__, event)
diff --git a/modules/sfp_voipbl.py b/modules/sfp_voipbl.py
index 33a87d4b..2d47e5f7 100644
--- a/modules/sfp_voipbl.py
+++ b/modules/sfp_voipbl.py
@@ -91,13 +91,13 @@ class sfp_voipbl(SpiderFootPlugin):
if targetType == "ip":
if target in blacklist:
- self.sf.debug(f"IP address {target} found in VoIP Blacklist (VoIPBL).")
+ self.debug(f"IP address {target} found in VoIP Blacklist (VoIPBL).")
return True
elif targetType == "netblock":
netblock = IPNetwork(target)
for ip in blacklist:
if IPAddress(ip) in netblock:
- self.sf.debug(f"IP address {ip} found within netblock/subnet {target} in VoIP Blacklist (VoIPBL).")
+ self.debug(f"IP address {ip} found within netblock/subnet {target} in VoIP Blacklist (VoIPBL).")
return True
return False
@@ -115,12 +115,12 @@ class sfp_voipbl(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from VoIP Blacklist (VoIPBL).")
+ self.error(f"Unexpected HTTP response code {res['code']} from VoIP Blacklist (VoIPBL).")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from VoIP Blacklist (VoIPBL)")
+ self.error("Received no content from VoIP Blacklist (VoIPBL)")
self.errorState = True
return None
@@ -163,10 +163,10 @@ class sfp_voipbl(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -195,7 +195,7 @@ class sfp_voipbl(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with VoIP Blacklist (VoIPBL)")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with VoIP Blacklist (VoIPBL)")
if self.queryBlacklist(eventData, targetType):
url = "https://voipbl.org/update"
diff --git a/modules/sfp_vxvault.py b/modules/sfp_vxvault.py
index ef643288..98140c75 100644
--- a/modules/sfp_vxvault.py
+++ b/modules/sfp_vxvault.py
@@ -91,7 +91,7 @@ class sfp_vxvault(SpiderFootPlugin):
return False
if target.lower() in blacklist:
- self.sf.debug(f"Host name {target} found in VXVault.net blacklist.")
+ self.debug(f"Host name {target} found in VXVault.net blacklist.")
return True
return False
@@ -109,12 +109,12 @@ class sfp_vxvault(SpiderFootPlugin):
)
if res['code'] != "200":
- self.sf.error(f"Unexpected HTTP response code {res['code']} from VXVault.net.")
+ self.error(f"Unexpected HTTP response code {res['code']} from VXVault.net.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.error("Received no content from VXVault.net")
+ self.error("Received no content from VXVault.net")
self.errorState = True
return None
@@ -161,10 +161,10 @@ class sfp_vxvault(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
if self.errorState:
@@ -191,7 +191,7 @@ class sfp_vxvault(SpiderFootPlugin):
else:
return
- self.sf.debug(f"Checking maliciousness of {eventData} ({eventName}) with VXVault.net")
+ self.debug(f"Checking maliciousness of {eventData} ({eventName}) with VXVault.net")
if self.queryBlacklist(eventData):
url = "http://vxvault.net/URL_List.php"
diff --git a/modules/sfp_webanalytics.py b/modules/sfp_webanalytics.py
index e710b6d4..2d106264 100644
--- a/modules/sfp_webanalytics.py
+++ b/modules/sfp_webanalytics.py
@@ -54,12 +54,12 @@ class sfp_webanalytics(SpiderFootPlugin):
sourceData = self.sf.hashstring(eventData)
if sourceData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[sourceData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if event.moduleDataSource:
datasource = event.moduleDataSource
@@ -77,7 +77,7 @@ class sfp_webanalytics(SpiderFootPlugin):
if m.lower().startswith('ua-12345678'):
continue
- self.sf.debug("Google Analytics match: " + m)
+ self.debug("Google Analytics match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Google Analytics: " + m,
self.__name__, event)
@@ -90,7 +90,7 @@ class sfp_webanalytics(SpiderFootPlugin):
if m.lower().startswith('pub-12345678'):
continue
- self.sf.debug("Google AdSense match: " + m)
+ self.debug("Google AdSense match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Google AdSense: " + m,
self.__name__, event)
@@ -101,7 +101,7 @@ class sfp_webanalytics(SpiderFootPlugin):
# https://developers.google.com/site-verification/v1/getting_started
matches = re.findall(r'<meta name="google-site-verification" content="([a-z0-9\-\+_=]{43,44})"', eventData, re.IGNORECASE)
for m in matches:
- self.sf.debug("Google Site Verification match: " + m)
+ self.debug("Google Site Verification match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Google Site Verification: " + m,
self.__name__, event)
@@ -110,7 +110,7 @@ class sfp_webanalytics(SpiderFootPlugin):
matches = re.findall(r'<meta name="verify-v1" content="([a-z0-9\-\+_=]{43,44})"', eventData, re.IGNORECASE)
for m in matches:
- self.sf.debug("Google Site Verification match: " + m)
+ self.debug("Google Site Verification match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Google Site Verification: " + m,
self.__name__, event)
@@ -121,7 +121,7 @@ class sfp_webanalytics(SpiderFootPlugin):
if '_qevents.push' in eventData:
matches = re.findall(r"\bqacct:\"(p-[a-z0-9]+)\"", eventData, re.IGNORECASE)
for m in matches:
- self.sf.debug("Quantcast match: " + m)
+ self.debug("Quantcast match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Quantcast: " + m,
self.__name__, event)
@@ -131,7 +131,7 @@ class sfp_webanalytics(SpiderFootPlugin):
# Ahrefs Site Verification
matches = re.findall(r'<meta name="ahrefs-site-verification" content="([a-f0-9]{64})"', eventData, re.IGNORECASE)
for m in matches:
- self.sf.debug("Ahrefs Site Verification match: " + m)
+ self.debug("Ahrefs Site Verification match: " + m)
evt = SpiderFootEvent("WEB_ANALYTICS_ID",
"Ahrefs Site Verification: " + m,
self.__name__, event)
diff --git a/modules/sfp_webframework.py b/modules/sfp_webframework.py
index 256a18fb..3fa675d9 100644
--- a/modules/sfp_webframework.py
+++ b/modules/sfp_webframework.py
@@ -80,14 +80,14 @@ class sfp_webframework(SpiderFootPlugin):
if srcModuleName != "sfp_spider":
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventSource not in self.results:
self.results[eventSource] = list()
# We only want web content for pages on the target site
if not self.getTarget().matches(self.sf.urlFQDN(eventSource)):
- self.sf.debug("Not collecting web content information for external sites.")
+ self.debug("Not collecting web content information for external sites.")
return
for regexpGrp in list(regexps.keys()):
@@ -98,7 +98,7 @@ class sfp_webframework(SpiderFootPlugin):
pat = re.compile(regex, re.IGNORECASE)
matches = re.findall(pat, eventData)
if len(matches) > 0 and regexpGrp not in self.results[eventSource]:
- self.sf.info("Matched " + regexpGrp + " in content from " + eventSource)
+ self.info("Matched " + regexpGrp + " in content from " + eventSource)
self.results[eventSource] = self.results[eventSource] + [regexpGrp]
evt = SpiderFootEvent("URL_WEB_FRAMEWORK", regexpGrp,
self.__name__, event)
diff --git a/modules/sfp_webserver.py b/modules/sfp_webserver.py
index 19cf43ed..ca34b64a 100644
--- a/modules/sfp_webserver.py
+++ b/modules/sfp_webserver.py
@@ -56,14 +56,14 @@ class sfp_webserver(SpiderFootPlugin):
eventData = event.data
eventSource = event.actualSource
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventSource in self.results:
return
self.results[eventSource] = True
if not self.getTarget().matches(self.sf.urlFQDN(eventSource)):
- self.sf.debug("Not collecting web server information for external sites.")
+ self.debug("Not collecting web server information for external sites.")
return
try:
@@ -71,7 +71,7 @@ class sfp_webserver(SpiderFootPlugin):
if jdata is None:
return
except Exception:
- self.sf.error("Received HTTP headers from another module in an unexpected format.")
+ self.error("Received HTTP headers from another module in an unexpected format.")
return
# Check location header for linked URLs
@@ -102,7 +102,7 @@ class sfp_webserver(SpiderFootPlugin):
# and other errors to see what the header looks like.
server = jdata.get('server')
if server:
- self.sf.info(f"Found web server: {server} ({eventSource})")
+ self.info(f"Found web server: {server} ({eventSource})")
evt = SpiderFootEvent("WEBSERVER_BANNER", server, self.__name__, event)
self.notifyListeners(evt)
diff --git a/modules/sfp_whatcms.py b/modules/sfp_whatcms.py
index 71f394c9..8c42b826 100644
--- a/modules/sfp_whatcms.py
+++ b/modules/sfp_whatcms.py
@@ -120,69 +120,69 @@ class sfp_whatcms(SpiderFootPlugin):
# Parse API response
def parseApiResponse(self, res):
if res['content'] is None:
- self.sf.debug('No response from WhatCMS.org')
+ self.debug('No response from WhatCMS.org')
return None
if res['code'] != '200':
- self.sf.error('Unexpected reply from WhatCMS.org: ' + res['code'])
+ self.error('Unexpected reply from WhatCMS.org: ' + res['code'])
self.errorState = True
return None
try:
data = json.loads(res['content'])
except Exception as e:
- self.sf.debug(f"Error processing JSON response: {e}")
+ self.debug(f"Error processing JSON response: {e}")
return None
result = data.get('result')
if result is None:
- self.sf.error('API error: no results')
+ self.error('API error: no results')
return None
code = str(result.get('code'))
if code == '0':
- self.sf.error('API error: Server failure')
+ self.error('API error: Server failure')
self.errorState = True
return None
if code == '101':
- self.sf.error('API error: Invalid API Key')
+ self.error('API error: Invalid API Key')
self.errorState = True
return None
if code == '102':
- self.sf.error('API error: Unauthenticated request. Invalid API key?')
+ self.error('API error: Unauthenticated request. Invalid API key?')
self.errorState = True
return None
if code == '111':
- self.sf.error('API error: Invalid URL')
+ self.error('API error: Invalid URL')
self.errorState = True
return None
if code == '120':
- self.sf.error('API error: Too many requests')
+ self.error('API error: Too many requests')
self.errorState = True
return None
if code == '121':
- self.sf.error('API error: You have exceeded your monthly request quota')
+ self.error('API error: You have exceeded your monthly request quota')
self.errorState = True
return None
if code == '123':
- self.sf.error('API error: Account disabled per violation of Terms and Conditions')
+ self.error('API error: Account disabled per violation of Terms and Conditions')
self.errorState = True
return None
if code == '201':
- self.sf.error('API error: CMS or Host not found')
+ self.error('API error: CMS or Host not found')
self.errorState = True
return None
if code != '200':
- self.sf.error('Unexpected status code from WhatCMS.org: ' + code)
+ self.error('Unexpected status code from WhatCMS.org: ' + code)
self.errorState = True
return None
@@ -198,7 +198,7 @@ class sfp_whatcms(SpiderFootPlugin):
return
if self.opts['api_key'] == '':
- self.sf.error('You enabled sfp_whatcms but did not set an API key!')
+ self.error('You enabled sfp_whatcms but did not set an API key!')
self.errorState = True
return
@@ -207,18 +207,18 @@ class sfp_whatcms(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
data = self.queryCmsTechnology(eventData)
if data is None:
- self.sf.debug('No web technology found for ' + eventData)
+ self.debug('No web technology found for ' + eventData)
return
results = data.get('results')
if results is None:
- self.sf.debug('No web technology found for ' + eventData)
+ self.debug('No web technology found for ' + eventData)
return
evt = SpiderFootEvent('RAW_RIR_DATA', str(results), self.__name__, event)
@@ -230,6 +230,6 @@ class sfp_whatcms(SpiderFootPlugin):
evt = SpiderFootEvent('WEBSERVER_TECHNOLOGY', software, self.__name__, event)
self.notifyListeners(evt)
else:
- self.sf.debug('No web technology found for ' + eventData)
+ self.debug('No web technology found for ' + eventData)
# End of sfp_whatcms class
diff --git a/modules/sfp_whois.py b/modules/sfp_whois.py
index 8247e28c..c479e356 100644
--- a/modules/sfp_whois.py
+++ b/modules/sfp_whois.py
@@ -69,7 +69,7 @@ class sfp_whois(SpiderFootPlugin):
self.results[eventData] = True
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventName.startswith("DOMAIN_NAME"):
typ = "DOMAIN_WHOIS"
@@ -82,7 +82,7 @@ class sfp_whois(SpiderFootPlugin):
elif eventName == "SIMILARDOMAIN":
typ = "SIMILARDOMAIN_WHOIS"
else:
- self.sf.error(f"Invalid event type: {eventName}")
+ self.error(f"Invalid event type: {eventName}")
return
data = None
@@ -91,33 +91,33 @@ class sfp_whois(SpiderFootPlugin):
try:
netblock = netaddr.IPNetwork(eventData)
except Exception as e:
- self.sf.error(f"Invalid netblock {eventData}: {e}")
+ self.error(f"Invalid netblock {eventData}: {e}")
return
ip = netblock[0]
- self.sf.debug(f"Sending RDAP query for IP address: {ip}")
+ self.debug(f"Sending RDAP query for IP address: {ip}")
try:
# TODO: this should use the configured proxy
r = ipwhois.IPWhois(ip)
data = str(r.lookup_rdap(depth=1))
except Exception as e:
- self.sf.error(f"Unable to perform WHOIS query on {ip}: {e}")
+ self.error(f"Unable to perform WHOIS query on {ip}: {e}")
else:
- self.sf.debug(f"Sending WHOIS query for domain: {eventData}")
+ self.debug(f"Sending WHOIS query for domain: {eventData}")
try:
whoisdata = whois.whois(eventData)
data = str(whoisdata.text)
except Exception as e:
- self.sf.error(f"Unable to perform WHOIS query on {eventData}: {e}")
+ self.error(f"Unable to perform WHOIS query on {eventData}: {e}")
if not data:
- self.sf.error(f"No WHOIS record for {eventData}")
+ self.error(f"No WHOIS record for {eventData}")
return
# This is likely to be an error about being throttled rather than real data
if len(str(data)) < 250:
- self.sf.error(f"WHOIS data ({len(data)} bytes) is smaller than 250 bytes. Throttling from WHOIS server is probably happening. Ignoring response.")
+ self.error(f"WHOIS data ({len(data)} bytes) is smaller than 250 bytes. Throttling from WHOIS server is probably happening. Ignoring response.")
return
rawevt = SpiderFootEvent(typ, data, self.__name__, event)
diff --git a/modules/sfp_whoisology.py b/modules/sfp_whoisology.py
index ac6e0bf7..81997f16 100644
--- a/modules/sfp_whoisology.py
+++ b/modules/sfp_whoisology.py
@@ -88,27 +88,27 @@ class sfp_whoisology(SpiderFootPlugin):
useragent="SpiderFoot")
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("Whoisology API key seems to have been rejected or you have exceeded usage limits.")
+ self.error("Whoisology API key seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info(f"No Whoisology info found for {qry}")
+ self.info(f"No Whoisology info found for {qry}")
return None
try:
info = json.loads(res['content'])
if info.get("domains") is None:
- self.sf.error("Error querying Whoisology: " + info.get("status_reason", "Unknown"))
+ self.error("Error querying Whoisology: " + info.get("status_reason", "Unknown"))
return None
if len(info.get("domains", [])) == 0:
- self.sf.debug(f"No data found in Whoisology for {qry}")
+ self.debug(f"No data found in Whoisology for {qry}")
return None
return info.get('domains')
except Exception as e:
- self.sf.error(f"Error processing JSON response from Whoisology: {e}")
+ self.error(f"Error processing JSON response from Whoisology: {e}")
return None
# Handle events sent to this module
@@ -120,15 +120,15 @@ class sfp_whoisology(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_whoisology but did not set an API key!")
+ self.error("You enabled sfp_whoisology but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_whoxy.py b/modules/sfp_whoxy.py
index cb0989a7..482011d0 100644
--- a/modules/sfp_whoxy.py
+++ b/modules/sfp_whoxy.py
@@ -91,18 +91,18 @@ class sfp_whoxy(SpiderFootPlugin):
useragent="SpiderFoot")
if res['code'] in ["400", "429", "500", "403"]:
- self.sf.error("Whoxy API key seems to have been rejected or you have exceeded usage limits.")
+ self.error("Whoxy API key seems to have been rejected or you have exceeded usage limits.")
self.errorState = True
return None
if res['content'] is None:
- self.sf.info("No Whoxy info found for " + qry)
+ self.info("No Whoxy info found for " + qry)
return None
try:
info = json.loads(res['content'])
if info.get("status", 0) == 0:
- self.sf.error("Error querying Whoxy: " + info.get("status_reason", "Unknown"))
+ self.error("Error querying Whoxy: " + info.get("status_reason", "Unknown"))
self.errorState = True
return None
if info.get("total_pages", 1) > 1:
@@ -119,7 +119,7 @@ class sfp_whoxy(SpiderFootPlugin):
else:
return info.get('search_result', [])
except Exception as e:
- self.sf.error("Error processing JSON response from Whoxy: " + str(e))
+ self.error("Error processing JSON response from Whoxy: " + str(e))
return None
# Handle events sent to this module
@@ -131,15 +131,15 @@ class sfp_whoxy(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['api_key'] == "":
- self.sf.error("You enabled sfp_whoxy but did not set an API key!")
+ self.error("You enabled sfp_whoxy but did not set an API key!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
diff --git a/modules/sfp_wigle.py b/modules/sfp_wigle.py
index f62a579b..4c1da139 100644
--- a/modules/sfp_wigle.py
+++ b/modules/sfp_wigle.py
@@ -108,7 +108,7 @@ class sfp_wigle(SpiderFootPlugin):
return None
if "too many queries" in res['content']:
- self.sf.error("Wigle.net query limit reached for the day.")
+ self.error("Wigle.net query limit reached for the day.")
return None
try:
@@ -117,7 +117,7 @@ class sfp_wigle(SpiderFootPlugin):
return None
return info['results'][0]['boundingbox']
except Exception as e:
- self.sf.error(f"Error processing JSON response from Wigle.net: {e}")
+ self.error(f"Error processing JSON response from Wigle.net: {e}")
return None
def getnetworks(self, coords):
@@ -153,7 +153,7 @@ class sfp_wigle(SpiderFootPlugin):
return None
if "too many queries" in res['content']:
- self.sf.error("Wigle.net query limit reached for the day.")
+ self.error("Wigle.net query limit reached for the day.")
return None
ret = list()
@@ -169,7 +169,7 @@ class sfp_wigle(SpiderFootPlugin):
return ret
except Exception as e:
- self.sf.error(f"Error processing JSON response from WiGLE: {e}")
+ self.error(f"Error processing JSON response from WiGLE: {e}")
return None
# Handle events sent to this module
@@ -182,26 +182,26 @@ class sfp_wigle(SpiderFootPlugin):
return
if self.opts['api_key_encoded'] == "":
- self.sf.error("You enabled sfp_wigle but did not set an API key!")
+ self.error("You enabled sfp_wigle but did not set an API key!")
self.errorState = True
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
coords = self.getcoords(eventData)
if not coords:
- self.sf.error("Couldn't get coordinates for address from Wigle.net.")
+ self.error("Couldn't get coordinates for address from Wigle.net.")
return
nets = self.getnetworks(coords)
if not nets:
- self.sf.error("Couldn't get networks for coordinates from Wigle.net.")
+ self.error("Couldn't get networks for coordinates from Wigle.net.")
return
for n in nets:
diff --git a/modules/sfp_wikileaks.py b/modules/sfp_wikileaks.py
index b8287647..e394fb69 100644
--- a/modules/sfp_wikileaks.py
+++ b/modules/sfp_wikileaks.py
@@ -76,10 +76,10 @@ class sfp_wikileaks(SpiderFootPlugin):
eventData = event.data
self.currentEventSrc = event
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -102,7 +102,7 @@ class sfp_wikileaks(SpiderFootPlugin):
"https://search.wikileaks.org/?" + wlurl
)
if res['content'] is None:
- self.sf.error("Unable to fetch Wikileaks content.")
+ self.error("Unable to fetch Wikileaks content.")
return
# Fetch the paste site content
@@ -133,7 +133,7 @@ class sfp_wikileaks(SpiderFootPlugin):
if "wikileaks.org/" not in link and "cryptome.org/" not in link:
continue
else:
- self.sf.debug("Found a link: " + link)
+ self.debug("Found a link: " + link)
if self.checkForStop():
return
diff --git a/modules/sfp_wikipediaedits.py b/modules/sfp_wikipediaedits.py
index df1e5b3d..3d27d9e5 100644
--- a/modules/sfp_wikipediaedits.py
+++ b/modules/sfp_wikipediaedits.py
@@ -86,7 +86,7 @@ class sfp_wikipediaedits(SpiderFootPlugin):
)
if res['code'] in ["404", "403", "500"]:
- self.sf.debug(f"Unexpected response code {res['code']} from Wikipedia")
+ self.debug(f"Unexpected response code {res['code']} from Wikipedia")
return None
if not res['content']:
@@ -106,7 +106,7 @@ class sfp_wikipediaedits(SpiderFootPlugin):
links.append(d)
return set(links)
except Exception as e:
- self.sf.error(f"Error processing response from Wikipedia: {e}")
+ self.error(f"Error processing response from Wikipedia: {e}")
return None
def handleEvent(self, event):
@@ -114,10 +114,10 @@ class sfp_wikipediaedits(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -125,7 +125,7 @@ class sfp_wikipediaedits(SpiderFootPlugin):
data = self.query(eventData)
if data is None:
- self.sf.debug(f"No results from Wikipedia for {eventData}")
+ self.debug(f"No results from Wikipedia for {eventData}")
return
for link in data:
diff --git a/modules/sfp_xforce.py b/modules/sfp_xforce.py
index 3c6bba84..86491da6 100644
--- a/modules/sfp_xforce.py
+++ b/modules/sfp_xforce.py
@@ -138,46 +138,46 @@ class sfp_xforce(SpiderFootPlugin):
# https://exchange.xforce.ibmcloud.com/api/doc/
def parseAPIResponse(self, res):
if res['content'] is None:
- self.sf.info("No X-Force Exchange information found")
+ self.info("No X-Force Exchange information found")
return None
if res['code'] == '400':
- self.sf.error("Bad request")
+ self.error("Bad request")
return None
if res['code'] == '404':
- self.sf.info("No X-Force Exchange information found")
+ self.info("No X-Force Exchange information found")
return None
if res['code'] == '401':
- self.sf.error("X-Force Exchange API key seems to have been rejected.")
+ self.error("X-Force Exchange API key seems to have been rejected.")
self.errorState = True
return None
if res['code'] == '402':
- self.sf.error("X-Force Exchange monthly quota exceeded")
+ self.error("X-Force Exchange monthly quota exceeded")
self.errorState = True
return None
if res['code'] == '403':
- self.sf.error("Access denied")
+ self.error("Access denied")
self.errorState = True
return None
if res['code'] == '429':
- self.sf.error("Rate limit exceeded")
+ self.error("Rate limit exceeded")
self.errorState = True
return None
# Catch all non-200 status codes, and presume something went wrong
if res['code'] != '200':
- self.sf.error("Failed to retrieve content from X-Force Exchange")
+ self.error("Failed to retrieve content from X-Force Exchange")
return None
try:
return json.loads(res['content'])
except Exception as e:
- self.sf.error(f"Error processing JSON response from X-Force Exchange: {e}")
+ self.error(f"Error processing JSON response from X-Force Exchange: {e}")
return None
@@ -192,15 +192,15 @@ class sfp_xforce(SpiderFootPlugin):
if self.errorState:
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts['xforce_api_key'] == "" or self.opts['xforce_api_key_password'] == "":
- self.sf.error("You enabled sfp_xforce but did not set an API key/password!")
+ self.error("You enabled sfp_xforce but did not set an API key/password!")
self.errorState = True
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -210,9 +210,9 @@ class sfp_xforce(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxnetblock']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxnetblock']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxnetblock']))
return
if eventName == 'NETBLOCK_MEMBER':
@@ -220,9 +220,9 @@ class sfp_xforce(SpiderFootPlugin):
return
else:
if IPNetwork(eventData).prefixlen < self.opts['maxsubnet']:
- self.sf.debug("Network size bigger than permitted: "
- + str(IPNetwork(eventData).prefixlen) + " > "
- + str(self.opts['maxsubnet']))
+ self.debug("Network size bigger than permitted: "
+ + str(IPNetwork(eventData).prefixlen) + " > "
+ + str(self.opts['maxsubnet']))
return
if eventName.startswith('AFFILIATE_') and not self.opts.get('checkaffiliates', False):
@@ -243,9 +243,9 @@ class sfp_xforce(SpiderFootPlugin):
ret = self.query(eventData, "resolve")
if ret is None:
- self.sf.info("No Passive DNS info for " + eventData)
+ self.info("No Passive DNS info for " + eventData)
elif "Passive" in ret:
- self.sf.debug("Found passive DNS results in Xforce")
+ self.debug("Found passive DNS results in Xforce")
res = ret["Passive"]['records']
for rec in res:
if rec['recordType'] == "A":
@@ -258,12 +258,12 @@ class sfp_xforce(SpiderFootPlugin):
host = rec['value']
if self.opts['age_limit_days'] > 0 and last_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({last_dt}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
if not self.opts["cohostsamedomain"]:
if self.getTarget().matches(host, includeParents=True):
- self.sf.debug(
+ self.debug(
f"Skipping {host} because it is on the same domain."
)
continue
@@ -288,7 +288,7 @@ class sfp_xforce(SpiderFootPlugin):
if rec is not None:
rec_history = rec.get("history", list())
if len(rec_history) > 0:
- self.sf.debug("Found history results in XForce")
+ self.debug("Found history results in XForce")
for result in rec_history:
created = result.get("created", None)
# 2014-11-06T10:45:00.000Z
@@ -298,14 +298,14 @@ class sfp_xforce(SpiderFootPlugin):
created_ts = int(time.mktime(created_dt.timetuple()))
age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])
if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({created_dt}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
reason = result.get("reason", "")
score = result.get("score", 0)
cats = result.get("cats", None)
cats_description = ""
if int(score) < 2:
- self.sf.debug("Non-malicious results, skipping.")
+ self.debug("Non-malicious results, skipping.")
continue
if cats is not None:
@@ -321,7 +321,7 @@ class sfp_xforce(SpiderFootPlugin):
if rec is not None:
rec_malware = rec.get("malware", list())
if len(rec_malware) > 0:
- self.sf.debug("Found malware results in XForce")
+ self.debug("Found malware results in XForce")
for result in rec_malware:
origin = result.get("origin", "")
domain = result.get("domain", "")
@@ -350,7 +350,7 @@ class sfp_xforce(SpiderFootPlugin):
host = rec['value']
if self.opts['age_limit_days'] > 0 and last_ts < age_limit_ts:
- self.sf.debug(f"Record found but too old ({last_ts}), skipping.")
+ self.debug("Record found but too old, skipping.")
continue
e = SpiderFootEvent(evtType, entry, self.__name__, event)
diff --git a/modules/sfp_yandexdns.py b/modules/sfp_yandexdns.py
index 5733a5db..fbcf9c4f 100644
--- a/modules/sfp_yandexdns.py
+++ b/modules/sfp_yandexdns.py
@@ -74,9 +74,9 @@ class sfp_yandexdns(SpiderFootPlugin):
try:
addrs = res.resolve(qaddr)
- self.sf.debug(f"Addresses returned: {addrs}")
+ self.debug(f"Addresses returned: {addrs}")
except Exception:
- self.sf.debug(f"Unable to resolve {qaddr}")
+ self.debug(f"Unable to resolve {qaddr}")
return False
if addrs:
@@ -91,7 +91,7 @@ class sfp_yandexdns(SpiderFootPlugin):
parentEvent = event
resolved = False
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if eventData in self.results:
return
@@ -104,7 +104,7 @@ class sfp_yandexdns(SpiderFootPlugin):
if self.sf.resolveHost(eventData) or self.sf.resolveHost6(eventData):
resolved = True
except Exception:
- self.sf.debug(f"Unable to resolve {eventData}")
+ self.debug(f"Unable to resolve {eventData}")
return
if not resolved:
diff --git a/modules/sfp_zetalytics.py b/modules/sfp_zetalytics.py
index d5a049ca..59768724 100644
--- a/modules/sfp_zetalytics.py
+++ b/modules/sfp_zetalytics.py
@@ -75,7 +75,7 @@ class sfp_zetalytics(SpiderFootPlugin):
return False
if self.opts["verify"] and not self.sf.resolveHost(hostname) and not self.sf.resolveHost6(hostname):
- self.sf.debug(f"Host {hostname} could not be resolved")
+ self.debug(f"Host {hostname} could not be resolved")
self.emit("INTERNET_NAME_UNRESOLVED", hostname, pevent)
return True
@@ -95,13 +95,13 @@ class sfp_zetalytics(SpiderFootPlugin):
)
if res["content"] is None:
- self.sf.info(f"No Zetalytics info found for {path}?{qs}")
+ self.info(f"No Zetalytics info found for {path}?{qs}")
return None
try:
return json.loads(res["content"])
except Exception as e:
- self.sf.error(f"Error processing JSON response from Zetalytics: {e}")
+ self.error(f"Error processing JSON response from Zetalytics: {e}")
return None
def query_subdomains(self, domain):
@@ -184,17 +184,17 @@ class sfp_zetalytics(SpiderFootPlugin):
if self.checkForStop():
return
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
- self.sf.error(
+ self.error(
f"You enabled {self.__class__.__name__} but did not set an API key!"
)
self.errorState = True
return
if f"{eventName}:{eventData}" in self.results:
- self.sf.debug(f"Skipping {eventName}:{eventData}, already checked.")
+ self.debug(f"Skipping {eventName}:{eventData}, already checked.")
return
self.results[f"{eventName}:{eventData}"] = True
diff --git a/modules/sfp_zoneh.py b/modules/sfp_zoneh.py
index 685a9769..ca6c4807 100644
--- a/modules/sfp_zoneh.py
+++ b/modules/sfp_zoneh.py
@@ -90,7 +90,7 @@ class sfp_zoneh(SpiderFootPlugin):
grps = re.findall(r"<title><\!\[CDATA\[(.[^\]]*)\]\]></title>\s+<link><\!\[CDATA\[(.[^\]]*)\]\]></link>", content)
for m in grps:
if target in m[0]:
- self.sf.info("Found zoneh site: " + m[0])
+ self.info("Found zoneh site: " + m[0])
return m[0] + "\n<SFURL>" + m[1] + "</SFURL>"
return False
@@ -101,13 +101,13 @@ class sfp_zoneh(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
+ self.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.errorState:
return
if eventData in self.results:
- self.sf.debug(f"Skipping {eventData}, already checked.")
+ self.debug(f"Skipping {eventData}, already checked.")
return
self.results[eventData] = True
@@ -129,7 +129,7 @@ class sfp_zoneh(SpiderFootPlugin):
elif eventName in ['AFFILIATE_IPADDR', 'AFFILIATE_IPV6_ADDRESS']:
evtType = 'DEFACED_AFFILIATE_IPADDR'
else:
- self.sf.debug(f"Unexpected event type {eventName}, skipping")
+ self.debug(f"Unexpected event type {eventName}, skipping")
if self.checkForStop():
return
@@ -139,7 +139,7 @@ class sfp_zoneh(SpiderFootPlugin):
if content is None:
data = self.sf.fetchUrl(url, useragent=self.opts['_useragent'])
if data['content'] is None:
- self.sf.error("Unable to fetch " + url)
+ self.error("Unable to fetch " + url)
self.errorState = True
return
diff --git a/sflib.py b/sflib.py
index b70558d4..53d5726b 100644
--- a/sflib.py
+++ b/sflib.py
@@ -226,23 +226,7 @@ class SpiderFoot:
if not self.opts['__logging']:
return
- frm = inspect.stack()[1]
- mod = inspect.getmodule(frm[0])
-
- if mod is None:
- modName = "Unknown"
- else:
- if mod.__name__ == "sflib":
- frm = inspect.stack()[2]
- mod = inspect.getmodule(frm[0])
- if mod is None:
- modName = "Unknown"
- else:
- modName = mod.__name__
- else:
- modName = mod.__name__
-
- self.log.info(f"{modName} : {message}", extra={'scanId': self._scanId, 'component': modName})
+ self.log.info(f"{message}", extra={'scanId': self._scanId})
def debug(self, message: str) -> None:
"""Log and print a debug message.
@@ -254,23 +238,8 @@ class SpiderFoot:
return
if not self.opts['__logging']:
return
- frm = inspect.stack()[1]
- mod = inspect.getmodule(frm[0])
-
- if mod is None:
- modName = "Unknown"
- else:
- if mod.__name__ == "sflib":
- frm = inspect.stack()[2]
- mod = inspect.getmodule(frm[0])
- if mod is None:
- modName = "Unknown"
- else:
- modName = mod.__name__
- else:
- modName = mod.__name__
- self.log.debug(f"{modName} : {message}", extra={'scanId': self._scanId})
+ self.log.debug(f"{message}", extra={'scanId': self._scanId})
@staticmethod
def myPath() -> str:
diff --git a/sfscan.py b/sfscan.py
index fbc3cada..a0d64dfc 100644
--- a/sfscan.py
+++ b/sfscan.py
@@ -302,9 +302,9 @@ class SpiderFootScanner():
# clear any listener relationships from the past
mod.clearListeners()
+ mod.setScanId(self.__scanId)
mod.setup(self.__sf, self.__modconfig[modName])
mod.setDbh(self.__dbh)
- mod.setScanId(self.__scanId)
except Exception:
self.__sf.error(f"Module {modName} initialization failed: {traceback.format_exc()}")
mod.errorState = True
diff --git a/spiderfoot/logger.py b/spiderfoot/logger.py
index e9ac0c4d..a0dd7289 100644
--- a/spiderfoot/logger.py
+++ b/spiderfoot/logger.py
@@ -33,7 +33,7 @@ class SpiderFootSqliteLogHandler(logging.Handler):
# Create a new database handle when the first log record is received
self.makeDbh()
scanId = getattr(record, "scanId", None)
- component = getattr(record, "component", None)
+ component = getattr(record, "module", None)
if scanId:
level = ("STATUS" if record.levelname == "INFO" else record.levelname)
logResult = self.dbh.scanLogEvent(scanId, level, record.getMessage(), component=component)
@@ -93,10 +93,11 @@ def logListenerSetup(loggingQueue, opts: dict = None) -> 'logging.handlers.Queue
error_handler.addFilter(lambda x: x.levelno >= logging.WARN)
# Set log format
- log_format = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s")
+ log_format = logging.Formatter("%(asctime)s [%(levelname)s] %(module)s : %(message)s")
+ debug_format = logging.Formatter("%(asctime)s [%(levelname)s] %(filename)s:%(lineno)s : %(message)s")
console_handler.setFormatter(log_format)
- debug_handler.setFormatter(log_format)
- error_handler.setFormatter(log_format)
+ debug_handler.setFormatter(debug_format)
+ error_handler.setFormatter(debug_format)
if doLogging:
handlers = [console_handler, debug_handler, error_handler]
diff --git a/spiderfoot/plugin.py b/spiderfoot/plugin.py
index 60621f86..b160181e 100644
--- a/spiderfoot/plugin.py
+++ b/spiderfoot/plugin.py
@@ -1,8 +1,76 @@
from contextlib import suppress
+import io
import logging
+import os
import queue
+import sys
import threading
from time import sleep
+import traceback
+
+# begin logging overrides
+# these are copied from the python logging module
+# https://github.com/python/cpython/blob/main/Lib/logging/__init__.py
+
+if hasattr(sys, 'frozen'): # support for py2exe
+ _srcfile = f"logging{os.sep}__init__{__file__[-4:]}"
+elif __file__[-4:].lower() in ['.pyc', '.pyo']:
+ _srcfile = __file__[:-4] + '.py'
+else:
+ _srcfile = __file__
+_srcfile = os.path.normcase(_srcfile)
+
+
+class SpiderFootPluginLogger(logging.Logger):
+ """Used only in SpiderFootPlugin to prevent modules
+ from having to initialize their own loggers.
+
+ Preserves filename, module, line numbers, etc. from the caller.
+ """
+
+ def findCaller(self, stack_info=False, stacklevel=1):
+ """Find the stack frame of the caller so that we can note the source
+ file name, line number and function name.
+
+ Args:
+ stack_info: boolean
+ stacklevel: int
+
+ Returns:
+ rv: tuple, filename, line number, module name, and stack trace
+ """
+ f = logging.currentframe()
+ # On some versions of IronPython, currentframe() returns None if
+ # IronPython isn't run with -X:Frames.
+ if f is not None:
+ f = f.f_back
+ orig_f = f
+ while f and stacklevel > 1:
+ f = f.f_back
+ stacklevel -= 1
+ if not f:
+ f = orig_f
+ rv = "(unknown file)", 0, "(unknown function)", None
+ while hasattr(f, "f_code"):
+ co = f.f_code
+ filename = os.path.normcase(co.co_filename)
+ if filename in (logging._srcfile, _srcfile): # This is the only change
+ f = f.f_back
+ continue
+ sinfo = None
+ if stack_info:
+ sio = io.StringIO()
+ sio.write('Stack (most recent call last):\n')
+ traceback.print_stack(f, file=sio)
+ sinfo = sio.getvalue()
+ if sinfo[-1] == '\n':
+ sinfo = sinfo[:-1]
+ sio.close()
+ rv = (co.co_filename, f.f_lineno, co.co_name, sinfo)
+ break
+ return rv # noqa R504
+
+# end of logging overrides
class SpiderFootPlugin():
@@ -61,14 +129,20 @@ class SpiderFootPlugin():
opts = dict()
def __init__(self):
- """Not really needed in most cases."""
-
# Whether the module is currently processing data
self._running = False
# Holds the thread object when module threading is enabled
self.thread = None
+ # logging overrides
+ self._log = None
- self.log = logging.getLogger(f"spiderfoot.{__name__}")
+ @property
+ def log(self):
+ if self._log is None:
+ logging.setLoggerClass(SpiderFootPluginLogger) # temporarily set logger class
+ self._log = logging.getLogger(f"spiderfoot.{self.__name__}") # init SpiderFootPluginLogger
+ logging.setLoggerClass(logging.Logger) # reset logger class to default
+ return self._log
def _updateSocket(self, socksProxy):
"""Hack to override module's use of socket, replacing it with
@@ -95,6 +169,36 @@ class SpiderFootPlugin():
"""
pass
+ def debug(self, *args, **kwargs):
+ """For logging.
+ A wrapper around logging.debug() that adds the scanId to LogRecord
+
+ Args:
+ *args: passed through to logging.debug()
+ *kwargs: passed through to logging.debug()
+ """
+ self.log.debug(*args, extra={'scanId': self.__scanId__}, **kwargs)
+
+ def info(self, *args, **kwargs):
+ """For logging.
+ A wrapper around logging.info() that adds the scanId to LogRecord
+
+ Args:
+ *args: passed through to logging.info()
+ *kwargs: passed through to logging.info()
+ """
+ self.log.info(*args, extra={'scanId': self.__scanId__}, **kwargs)
+
+ def error(self, *args, **kwargs):
+ """For logging.
+ A wrapper around logging.error() that adds the scanId to LogRecord
+
+ Args:
+ *args: passed through to logging.error()
+ *kwargs: passed through to logging.error()
+ """
+ self.log.error(*args, extra={'scanId': self.__scanId__}, **kwargs)
+
def enrichTarget(self, target):
"""Find aliases for a target.
@@ -561,16 +665,14 @@ class SpiderFootPlugin():
@property
def finished(self):
if self.sfp.checkForStop():
- finished = True
+ return True
else:
finishedThreads = [not t.busy for t in self.pool if t is not None]
try:
inputThreadAlive = self.inputThread.is_alive()
except AttributeError:
inputThreadAlive = False
- finished = not inputThreadAlive and self.inputQueue.empty() and all(finishedThreads)
- self.sfp.sf.debug(f'Finished: {finished}')
- return finished
+ return not inputThreadAlive and self.inputQueue.empty() and all(finishedThreads)
def __enter__(self):
return self
diff --git a/test/integration/test_sf.py b/test/integration/test_sf.py
index 9ad00fa7..de20473a 100644
--- a/test/integration/test_sf.py
+++ b/test/integration/test_sf.py
@@ -76,7 +76,7 @@ class TestSf(unittest.TestCase):
def test_debug_arg_should_enable_and_print_debug_output(self):
out, err, code = self.execute([sys.executable, "sf.py", "-d", "-m", "example module", "-s", "spiderfoot.net"])
self.assertIn(b"[DEBUG]", err)
- self.assertIn(b"modules.sfp__stor_db : Storing an event: ROOT", err)
+ self.assertIn(b"sfp__stor_db : Storing an event: ROOT", err)
self.assertEqual(0, code)
def test_quiet_arg_should_hide_debug_output(self):