SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Py2->Py3 changes.
smicallefbe4b895e023e
diff --git a/sflib.py b/sflib.pyindex 242a03fc..377bea80 100644--- a/sflib.py+++ b/sflib.py@@ -32,6 +32,7 @@ import ioimport threadingimport tracebackimport OpenSSL+import uuidimport cryptographyimport dns.resolverfrom networkx import nx@@ -298,9 +299,7 @@ class SpiderFoot:# str(time.time() * 1000) +# str(random.SystemRandom().randint(100000, 999999))# ).hexdigest()- rstr = str(time.time()) + str(random.SystemRandom().randint(100000, 999999))- hashStr = "%08X" % int(binascii.crc32(rstr) & 0xffffffff)- return hashStr+ return str(uuid.uuid4()).split("-")[0].upper()def _dblog(self, level, message, component=None):#print(str(self.GUID) + ":" + str(level) + ":" + str(message) + ":" + str(component))@@ -425,20 +424,21 @@ class SpiderFoot:# Store data to the cachedef cachePut(self, label, data):- pathLabel = hashlib.sha224(label).hexdigest()+ pathLabel = hashlib.sha224(label.encode('utf-8')).hexdigest()cacheFile = self.cachePath() + "/" + pathLabel- fp = file(cacheFile, "w")+ fp = open(cacheFile, "w")if type(data) is list:for line in data:- fp.write(line + '\n')+ fp.write(line.decode('utf-8') + '\n')+ elif type(data) is bytes:+ fp.write(data.decode('utf-8'))else:- data = data.encode('utf-8')fp.write(data)fp.close()# Retreive data from the cachedef cacheGet(self, label, timeoutHrs):- pathLabel = hashlib.sha224(label).hexdigest()+ pathLabel = hashlib.sha224(label.encode('utf-8')).hexdigest()cacheFile = self.cachePath() + "/" + pathLabeltry:(m, i, d, n, u, g, sz, atime, mtime, ctime) = os.stat(cacheFile)diff --git a/sfwebui.py b/sfwebui.pyindex 75c3c3c8..a5708ade 100644--- a/sfwebui.py+++ b/sfwebui.py@@ -935,7 +935,7 @@ class SpiderFootWebUi:for row in data:generated = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(row[0] / 1000))retdata.append([generated, row[1],- cgi.escape(str(row[2], errors='replace'))])+ cgi.escape(str(row[2]))])return json.dumps(retdata)scanerrors.exposed = True