Skip to content

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

sfp_tool_dnstwist: Check for wildcard DNS before testing.

smicallef0ca99aaced4a
diff --git a/modules/sfp_tool_dnstwist.py b/modules/sfp_tool_dnstwist.py
index 178342b0..ec938c33 100644
--- a/modules/sfp_tool_dnstwist.py
+++ b/modules/sfp_tool_dnstwist.py
@@ -41,13 +41,15 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
# Default options
opts = {
'pythonpath': "python",
- 'dnstwistpath': ""
+ 'dnstwistpath': "",
+ 'skipwildcards': True
}
# Option descriptions
optdescs = {
'pythonpath': "Path to Python interpreter to use for DNSTwist. If just 'python' then it must be in your PATH.",
- 'dnstwistpath': "Path to the where the dnstwist.py file lives. Optional."
+ 'dnstwistpath': "Path to the where the dnstwist.py file lives. Optional.",
+ 'skipwildcards': "Skip TLDs and sub-TLDs that have wildcard DNS."
}
results = None
@@ -89,6 +91,15 @@ class sfp_tool_dnstwist(SpiderFootPlugin):
self.results[eventData] = True
+ dom = self.sf.domainKeyword(eventData, self.opts['_internettlds'])
+ if not dom:
+ return
+
+ tld = eventData.split(dom + ".")[-1]
+ # Check if the TLD has wildcards before testing
+ if self.opts['skipwildcards'] and self.sf.checkDnsWildcard(tld):
+ return
+
dnstwistLocation = which('dnstwist')
if dnstwistLocation and Path(dnstwistLocation).is_file():
cmd = ['dnstwist']