SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Multi-lingual dictionary support.
Steveb78970a78201
diff --git a/modules/sfp_binstring.py b/modules/sfp_binstring.pyindex c11924cc..b4be6eb0 100644--- a/modules/sfp_binstring.py+++ b/modules/sfp_binstring.py@@ -63,9 +63,7 @@ class sfp_binstring(SpiderFootPlugin):self.sf = sfcself.results = list()- self.d = self.builddict(["english.0", "english.2", "english.4",- "british.0", "british.2", "british.4",- "american.0", "american.2", "american.4"])+ self.d = self.sf.dictwords()for opt in userOpts.keys():self.opts[opt] = userOpts[opt]diff --git a/modules/sfp_names.py b/modules/sfp_names.pyindex e01c3b12..2f35612d 100644--- a/modules/sfp_names.py+++ b/modules/sfp_names.py@@ -32,32 +32,15 @@ class sfp_names(SpiderFootPlugin):results = dict()d = Nonen = None- fq = None-- def builddict(self, files):- wd = dict()-- for f in files:- wdct = open(self.sf.myPath() + "/ext/ispell/" + f, 'r')- dlines = wdct.readlines()-- for w in dlines:- w = w.strip().lower()- wd[w.split('/')[0]] = True-- return wd.keys()def setup(self, sfc, userOpts=dict()):self.sf = sfcself.results = dict()- d = self.builddict(["english.0", "english.2", "english.4",- "british.0", "british.2", "british.4",- "american.0", "american.2", "american.4"])- self.n = self.builddict(["names.list"])- self.fq = ["north", "south", "east", "west", "santa", "san", "blog", "sao"]+ d = self.sf.dictwords()+ self.n = self.sf.dictnames()# Take dictionary words out of the names list to keep things clean- self.d = list(set(d) - set(self.n))+ self.d = set(set(d) - set(self.n))# Clear / reset any other class member variables here# or you risk them persisting between threads.@@ -129,10 +112,6 @@ class sfp_names(SpiderFootPlugin):if len(first) == 2 or len(second) == 2:p -= 50- # If the first word is in our cue list, knock out more points.- if first in self.fq:- p -= 50-# If the first word is in the dictionary but the second isn't,# subtract 40 points.if not notindict:diff --git a/sflib.py b/sflib.pyindex 2f085f67..4f0da18e 100644--- a/sflib.py+++ b/sflib.py@@ -728,6 +728,39 @@ class SpiderFoot:ret.append(addr)return ret+ # Return dictionary words and/or names+ def dictwords(self):+ wd = dict()++ dicts = [ "english", "german", "french", "spanish" ]++ for d in dicts:+ wdct = open(self.myPath() + "/ext/ispell/" + d + ".dict", 'r')+ dlines = wdct.readlines()++ for w in dlines:+ w = w.strip().lower()+ wd[w.split('/')[0]] = True++ return wd.keys()++ # Return dictionary names+ def dictnames(self):+ wd = dict()++ dicts = [ "names" ]++ for d in dicts:+ wdct = open(self.myPath() + "/ext/ispell/" + d + ".dict", 'r')+ dlines = wdct.readlines()++ for w in dlines:+ w = w.strip().lower()+ wd[w.split('/')[0]] = True++ return wd.keys()++# Converts a dictionary of k -> array to a nested# tree that can be digested by d3 for visualizations.def dataParentChildToTree(self, data):