diff --git a/CHANGELOG b/CHANGELOG index 25a23550f..a105ac65a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ #Nmap Changelog ($Id$); -*-text-*- +o [NSE] Script http-default-accounts was not able to run against more than one + target host/port. [nnposter] + o [NSE][GH#1251] New script-arg `http.host` allows users to force a particular value for the Host header in all HTTP requests. diff --git a/scripts/http-default-accounts.nse b/scripts/http-default-accounts.nse index 17685cf3f..e7d7051f0 100644 --- a/scripts/http-default-accounts.nse +++ b/scripts/http-default-accounts.nse @@ -190,15 +190,17 @@ local function load_fingerprints(filename, cat) -- Check if fingerprints are cached local mutex = nmap.mutex("http_default_accounts_fingerprints") mutex "lock" - if nmap.registry.http_default_accounts_fingerprints then - if type(nmap.registry.http_fingerprints) == "table" then - stdnse.debug(1, "Loading cached fingerprints") - mutex "done" - return true, nmap.registry.http_default_accounts_fingerprints - else - return bad_prints(mutex, nmap.registry.http_default_accounts_fingerprints) - end + local cached_fingerprints = nmap.registry.http_default_accounts_fingerprints + if type(cached_fingerprints) == "table" then + stdnse.debug(1, "Loading cached fingerprints") + mutex "done" + return true, cached_fingerprints end + if type(cached_fingerprints) == "string" then + -- cached_fingerprints contains an error message from a prior load attempt + return bad_prints(mutex, cached_fingerprints) + end + 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