From a606766d88277caab07c3f281d04372769a60176 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 26 Apr 2013 12:14:40 +0000 Subject: [PATCH] Allow dns-brute.hostlist to be a relative path --- scripts/dns-brute.nse | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/dns-brute.nse b/scripts/dns-brute.nse index fff11ceed..94b7eadbc 100644 --- a/scripts/dns-brute.nse +++ b/scripts/dns-brute.nse @@ -195,7 +195,7 @@ action = function(host) dosrv = stdnse.get_script_args("dns-brute.srv") or false stdnse.print_debug("THREADS: "..max_threads) local fileName = stdnse.get_script_args('dns-brute.hostlist') - local commFile = fileName and nmap.fetchfile(fileName) + local commFile = (fileName and nmap.fetchfile(fileName)) or fileName local hostlist if commFile then local file = io.open(commFile) @@ -211,12 +211,10 @@ action = function(host) end end file:close() - end - else - if fileName then + else print("dns-brute: Hostlist file not found. Will use default list.") end - end + end if (not hostlist) then hostlist = HOST_LIST end local srvlist = SRV_LIST