Skip to content

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

Filter junk e-mails.

Steve Micallef1909fbb47583
diff --git a/modules/sfp_builtwith.py b/modules/sfp_builtwith.py
index 46811beb..f6499d50 100644
--- a/modules/sfp_builtwith.py
+++ b/modules/sfp_builtwith.py
@@ -12,6 +12,7 @@
import sys
import json
import time
+import re
from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
class sfp_builtwith(SpiderFootPlugin):
@@ -33,7 +34,7 @@ class sfp_builtwith(SpiderFootPlugin):
# Be sure to completely clear any class variables in setup()
# or you run the risk of data persisting between scan runs.
- results = dict()
+ results = None
errorState = False
def setup(self, sfc, userOpts=dict()):
@@ -106,21 +107,25 @@ class sfp_builtwith(SpiderFootPlugin):
return None
if "Meta" in data:
+ # Verify any email addresses as we sometimes get junk from BuiltWith
+ pat = re.compile("([\%a-zA-Z\.0-9_\-\+]+@[a-zA-Z\.0-9\-]+\.[a-zA-Z\.0-9\-]+)")
if data['Meta'].get("Names", []):
for nb in data['Meta']['Names']:
e = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + nb['Name'],
self.__name__, event)
self.notifyListeners(e)
if nb.get('Email', None):
- e = SpiderFootEvent("EMAILADDR", nb['Email'],
- self.__name__, event)
- self.notifyListeners(e)
+ if (re.match(pat, nb['Email'])):
+ e = SpiderFootEvent("EMAILADDR", nb['Email'],
+ self.__name__, event)
+ self.notifyListeners(e)
if data['Meta'].get("Emails", []):
for email in data['Meta']['Emails']:
- e = SpiderFootEvent("EMAILADDR", email,
- self.__name__, event)
- self.notifyListeners(e)
+ if (re.match(pat, email)):
+ e = SpiderFootEvent("EMAILADDR", email,
+ self.__name__, event)
+ self.notifyListeners(e)
if data['Meta'].get("Telephones", []):
for phone in data['Meta']['Telephones']:
diff --git a/modules/sfp_emailformat.py b/modules/sfp_emailformat.py
index d4b8efab..99d82deb 100644
--- a/modules/sfp_emailformat.py
+++ b/modules/sfp_emailformat.py
@@ -19,7 +19,7 @@ class sfp_emailformat(SpiderFootPlugin):
"""EmailFormat:Footprint,Investigate,Passive:Search Engines::Look up e-mail addresses on email-format.com."""
- results = dict()
+ results = None
# Default options
opts = {
@@ -78,6 +78,10 @@ class sfp_emailformat(SpiderFootPlugin):
self.sf.debug("Likely invalid address.")
continue
+ if "..." in match:
+ self.sf.debug("Incomplete e-mail address, skipping.")
+ continue
+
# Handle messed up encodings
if "%" in match:
self.sf.debug("Skipped address: " + match)