Skip to content

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

fix: convert byte target names to strings

Amr Awad2eff1b33e2f1
diff --git a/modules/sfp_email.py b/modules/sfp_email.py
index 5827238d..ba5b7113 100644
--- a/modules/sfp_email.py
+++ b/modules/sfp_email.py
@@ -12,7 +12,6 @@
# -------------------------------------------------------------------------------
import re
-
from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
class sfp_email(SpiderFootPlugin):
diff --git a/sflib.py b/sflib.py
index 9f55da96..f6cd5573 100644
--- a/sflib.py
+++ b/sflib.py
@@ -1833,7 +1833,11 @@ class SpiderFootTarget(object):
e = self._getEquivalents("INTERNET_NAME")
if self.targetType == "INTERNET_NAME" and self.targetValue.lower() not in e:
e.append(self.targetValue.lower())
- return e
+
+ names = list()
+ for name in e:
+ names.append(name.decode("utf-8") if type(name) == bytes else name)
+ return names
# Get all IP Subnets or IP Addresses associated with the target
def getAddresses(self):
@@ -1862,6 +1866,8 @@ class SpiderFootTarget(object):
def matches(self, value, includeParents=False, includeChildren=True):
value = value.lower()
+ value = value.decode("utf-8") if type(value) == bytes else value
+
if value is None or value == "":
return False