diff --git a/scripts/http-default-accounts.nse b/scripts/http-default-accounts.nse index 5fbb86bcb..905baab13 100644 --- a/scripts/http-default-accounts.nse +++ b/scripts/http-default-accounts.nse @@ -312,11 +312,7 @@ local function load_fingerprints(filename, catlist, namelist) assert(type(cached_fingerprints) == "nil", "Unexpected cached fingerprints") -- Try and find the file - -- If it isn't in Nmap's directories, take it as a direct path - filename_full = nmap.fetchfile('nselib/data/' .. filename) - if(not(filename_full)) then - filename_full = filename - end + filename_full = filename or nmap.fetchfile('nselib/data/http-default-accounts-fingerprints.lua') -- Load the file stdnse.debug(1, "Loading fingerprints: %s", filename_full) @@ -483,7 +479,6 @@ end action = function(host, port) local fingerprint_filename = stdnse.get_script_args("http-default-accounts.fingerprintfile") - or "http-default-accounts-fingerprints.lua" local catlist = stdnse.get_script_args("http-default-accounts.category") local namelist = stdnse.get_script_args("http-default-accounts.name") local basepath = stdnse.get_script_args("http-default-accounts.basepath") or "/" diff --git a/scripts/http-devframework.nse b/scripts/http-devframework.nse index e655d7b82..5df427ff3 100644 --- a/scripts/http-devframework.nse +++ b/scripts/http-devframework.nse @@ -55,7 +55,9 @@ local function loadFingerprints(filename) local file, fingerprints -- Find the file - filename = nmap.fetchfile('nselib/data/' .. filename) or filename + if not filename then + filename = nmap.fetchfile('nselib/data/http-devframework-fingerprints.lua') + end -- Load the file stdnse.debug1("Loading fingerprints: %s", filename) @@ -76,7 +78,7 @@ end action = function(host, port) - local filename = stdnse.get_script_args("http-devframework.fingerprintfile") or "http-devframework-fingerprints.lua" + local filename = stdnse.get_script_args("http-devframework.fingerprintfile") local tools = loadFingerprints(filename) if not tools then stdnse.debug1("Failed to load fingerprints") diff --git a/scripts/http-enum.nse b/scripts/http-enum.nse index 237fe1eb2..80f13c07f 100644 --- a/scripts/http-enum.nse +++ b/scripts/http-enum.nse @@ -201,10 +201,7 @@ local function get_fingerprints(fingerprint_file, category) end -- Try and find the file; if it isn't in Nmap's directories, take it as a direct path - local filename_full = nmap.fetchfile('nselib/data/' .. fingerprint_file) - if(not(filename_full)) then - filename_full = fingerprint_file - end + local filename_full = fingerprint_file or nmap.fetchfile('nselib/data/http-fingerprints.lua') stdnse.debug1("Loading fingerprint database: %s", filename_full) local env = setmetatable({fingerprints = {}}, {__index = _G}) @@ -369,7 +366,7 @@ action = function(host, port) -- Read the script-args, keeping the old ones for reverse compatibility local basepath = stdnse.get_script_args({'http-enum.basepath', 'path'}) or '/' local displayall = stdnse.get_script_args({'http-enum.displayall', 'displayall'}) or false - local fingerprint_file = stdnse.get_script_args({'http-enum.fingerprintfile', 'fingerprints'}) or 'http-fingerprints.lua' + local fingerprint_file = stdnse.get_script_args({'http-enum.fingerprintfile', 'fingerprints'}) local category = stdnse.get_script_args('http-enum.category') -- local try_variations = stdnse.get_script_args({'http-enum.tryvariations', 'variations'}) or false -- local limit = tonumber(stdnse.get_script_args({'http-enum.limit', 'limit'})) or -1 diff --git a/scripts/mysql-audit.nse b/scripts/mysql-audit.nse index 32a1482ce..854da234c 100644 --- a/scripts/mysql-audit.nse +++ b/scripts/mysql-audit.nse @@ -102,7 +102,9 @@ local function loadAuditRulebase( filename ) test = function(t) table.insert(rules, t) end; }, {__index = _G}) - filename = nmap.fetchfile("nselib/data/" .. filename) or filename + if not filename then + filename = nmap.fetchfile("nselib/data/mysql-cis.audit") + end stdnse.debug(1, "Loading rules from: %s", filename) local file, err = loadfile(filename, "t", env) @@ -121,7 +123,7 @@ action = function( host, port ) local username = stdnse.get_script_args("mysql-audit.username") local password = stdnse.get_script_args("mysql-audit.password") - local filename = stdnse.get_script_args("mysql-audit.filename") or "mysql-cis.audit" + local filename = stdnse.get_script_args("mysql-audit.filename") if ( not(username) ) then return fail("No username was supplied (see mysql-audit.username)")