Skip to content

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

Bug fix.

smicallefb97489e4c630
diff --git a/modules/sfp_dnsbrute.py b/modules/sfp_dnsbrute.py
index 09e3275a..6870cdc7 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 list(userOpts.keys()):
+ for opt in 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) != str:
- eventData = str(eventData, "utf-8", errors='replace').encode("idna")
+ if type(eventData) != unicode:
+ eventData = unicode(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(list(nextsubs.keys()), event)
+ self.tryHostWrapper(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(list(nextsubs.keys())) >= self.opts['_maxthreads']:
- self.tryHostWrapper(list(nextsubs.keys()), event)
+ if len(nextsubs.keys()) >= self.opts['_maxthreads']:
+ self.tryHostWrapper(nextsubs.keys(), event)
nextsubs = dict()
# Scan whatever may be left over.
if len(nextsubs) > 0:
- self.tryHostWrapper(list(nextsubs.keys()), event)
+ self.tryHostWrapper(nextsubs.keys(), event)
# End of sfp_dnsbrute class
diff --git a/modules/sfp_dnszonexfer.py b/modules/sfp_dnszonexfer.py
index 22c81787..bfaf4b47 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 list(userOpts.keys()):
+ for opt in userOpts.keys():
self.opts[opt] = userOpts[opt]
# What events is this module interested in for input
@@ -80,6 +80,9 @@ class sfp_dnszonexfer(SpiderFootPlugin):
# the zone transfer.
if not self.sf.validIP(eventData):
nsips = self.sf.resolveHost(eventData)
+ if not nsips:
+ return None
+
if len(nsips) > 0:
for n in nsips:
if self.sf.validIP(n):
@@ -97,7 +100,7 @@ class sfp_dnszonexfer(SpiderFootPlugin):
try:
ret = list()
z = dns.zone.from_xfr(dns.query.xfr(nsip, name))
- names = list(z.nodes.keys())
+ names = z.nodes.keys()
for n in names:
ret.append(z[n].to_text(n))