Skip to content

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

sfp_spamhaus: Initialise errorState (#1530)

bcoles4072f0502bbc
diff --git a/modules/sfp_spamhaus.py b/modules/sfp_spamhaus.py
index c889d83b..6b2f2740 100644
--- a/modules/sfp_spamhaus.py
+++ b/modules/sfp_spamhaus.py
@@ -62,6 +62,7 @@ class sfp_spamhaus(SpiderFootPlugin):
}
results = None
+ errorState = False
checks = {
'127.0.0.2': "Spamhaus (Zen) - Spammer",
@@ -76,6 +77,7 @@ class sfp_spamhaus(SpiderFootPlugin):
def setup(self, sfc, userOpts=dict()):
self.sf = sfc
+ self.errorState = False
self.results = self.tempStorage()
for opt in list(userOpts.keys()):
@@ -191,7 +193,7 @@ class sfp_spamhaus(SpiderFootPlugin):
if not res:
continue
- self.debug(f"{addr} found in Spaumhaus Zen DNS")
+ self.debug(f"{addr} found in Spamhaus Zen DNS")
for result in res:
k = str(result)
@@ -211,8 +213,9 @@ class sfp_spamhaus(SpiderFootPlugin):
continue
if k not in self.checks:
- # This is an error. The "checks" dict may need to be updated.
- self.error(f"Spamhaus Zen resolved address {addr} to unknown IP address {result} not found in Spamhaus Zen list.")
+ if not k.endswith('.zen.spamhaus.org'):
+ # This is an error. The "checks" dict may need to be updated.
+ self.error(f"Spamhaus Zen resolved address {addr} to unknown IP address {result} not found in Spamhaus Zen list.")
continue
evt = SpiderFootEvent(blacklist_type, f"{self.checks[k]} [{addr}]", self.__name__, event)