Skip to content

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

Unicode fixes.

Steve Micallef4c5030a11604
diff --git a/modules/sfp_dnsresolve.py b/modules/sfp_dnsresolve.py
index caf195ac..e83c886a 100644
--- a/modules/sfp_dnsresolve.py
+++ b/modules/sfp_dnsresolve.py
@@ -264,6 +264,9 @@ class sfp_dnsresolve(SpiderFootPlugin):
# Resolve a host
def resolveHost(self, hostname):
+ if not hostname:
+ return list()
+
if hostname in self.resolveCache:
self.sf.debug("Returning cached result for " + hostname + " (" +
str(self.resolveCache[hostname]) + ")")
diff --git a/sflib.py b/sflib.py
index 13d71073..558d203a 100644
--- a/sflib.py
+++ b/sflib.py
@@ -1553,7 +1553,9 @@ class SpiderFootPlugin(object):
try:
listener.handleEvent(sfEvent)
except BaseException as e:
- print "Module encountered an error: " + str(e)
+ f = open("/tmp/sferror", "a")
+ f.write("Module (" + listener.__module__ + ") encountered an error: " + str(e))
+ f.close()
# For modules to use to check for when they should give back control
def checkForStop(self):
@@ -1605,7 +1607,8 @@ class SpiderFootTarget(object):
def __init__(self, targetValue, typeName):
if typeName in self._validTypes:
self.targetType = typeName
- self.targetValue = unicode(targetValue.lower(), 'utf-8', errors='replace')
+ if type(targetValue) != unicode:
+ self.targetValue = unicode(targetValue, 'utf-8', errors='replace').lower()
self.targetAliases = list()
else:
print "Internal Error: Invalid target type."