Skip to content

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

Py2->3.

smicallef8e81a134750a
diff --git a/modules/sfp_dnsbrute.py b/modules/sfp_dnsbrute.py
index 6870cdc7..09e3275a 100644
--- a/modules/sfp_dnsbrute.py
+++ b/modules/sfp_dnsbrute.py
@@ -52,7 +52,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
self.__dataSource__ = "DNS"
self.lock = threading.Lock()
- for opt in userOpts.keys():
+ for opt in list(userOpts.keys()):
self.opts[opt] = userOpts[opt]
cslines = list()
@@ -150,8 +150,8 @@ class sfp_dnsbrute(SpiderFootPlugin):
# Handle Unicode characters in the name
try:
- if type(eventData) != unicode:
- eventData = unicode(eventData, "utf-8", errors='replace').encode("idna")
+ if type(eventData) != str:
+ eventData = str(eventData, "utf-8", errors='replace').encode("idna")
else:
eventData = eventData.encode("idna")
except BaseException as e:
@@ -183,7 +183,7 @@ class sfp_dnsbrute(SpiderFootPlugin):
nextsubs[h + "-0" + str(i) + dom] = True
nextsubs[h + "-00" + str(i) + dom] = True
- self.tryHostWrapper(nextsubs.keys(), event)
+ self.tryHostWrapper(list(nextsubs.keys()), event)
# The rest of the module is for handling targets only
return None
@@ -231,13 +231,13 @@ class sfp_dnsbrute(SpiderFootPlugin):
nextsubs[s + "-0" + str(i) + dom] = True
nextsubs[s + "-00" + str(i) + dom] = True
- if len(nextsubs.keys()) >= self.opts['_maxthreads']:
- self.tryHostWrapper(nextsubs.keys(), event)
+ if len(list(nextsubs.keys())) >= self.opts['_maxthreads']:
+ self.tryHostWrapper(list(nextsubs.keys()), event)
nextsubs = dict()
# Scan whatever may be left over.
if len(nextsubs) > 0:
- self.tryHostWrapper(nextsubs.keys(), event)
+ self.tryHostWrapper(list(nextsubs.keys()), event)
# End of sfp_dnsbrute class
diff --git a/modules/sfp_dnszonexfer.py b/modules/sfp_dnszonexfer.py
index bfaf4b47..3344c00b 100644
--- a/modules/sfp_dnszonexfer.py
+++ b/modules/sfp_dnszonexfer.py
@@ -37,7 +37,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
self.events = self.tempStorage()
self.__dataSource__ = "DNS"
- for opt in userOpts.keys():
+ for opt in list(userOpts.keys()):
self.opts[opt] = userOpts[opt]
# What events is this module interested in for input
@@ -100,7 +100,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
try:
ret = list()
z = dns.zone.from_xfr(dns.query.xfr(nsip, name))
- names = z.nodes.keys()
+ names = list(z.nodes.keys())
for n in names:
ret.append(z[n].to_text(n))