1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-11 10:19:03 +00:00

Rectifies a recently introduced bug that impacted fingerprint loading.

Incorrect registry entry was tested for cached fingerprints, which was
preventing the script to run against more than one target host/port.
This commit is contained in:
nnposter
2018-07-15 23:14:04 +00:00
parent aaf5075c67
commit 78601bc7c3
2 changed files with 13 additions and 8 deletions

View File

@@ -1,5 +1,8 @@
#Nmap Changelog ($Id$); -*-text-*- #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 o [NSE][GH#1251] New script-arg `http.host` allows users to force a particular
value for the Host header in all HTTP requests. value for the Host header in all HTTP requests.

View File

@@ -190,15 +190,17 @@ local function load_fingerprints(filename, cat)
-- Check if fingerprints are cached -- Check if fingerprints are cached
local mutex = nmap.mutex("http_default_accounts_fingerprints") local mutex = nmap.mutex("http_default_accounts_fingerprints")
mutex "lock" mutex "lock"
if nmap.registry.http_default_accounts_fingerprints then local cached_fingerprints = nmap.registry.http_default_accounts_fingerprints
if type(nmap.registry.http_fingerprints) == "table" then if type(cached_fingerprints) == "table" then
stdnse.debug(1, "Loading cached fingerprints") stdnse.debug(1, "Loading cached fingerprints")
mutex "done" mutex "done"
return true, nmap.registry.http_default_accounts_fingerprints return true, cached_fingerprints
else
return bad_prints(mutex, nmap.registry.http_default_accounts_fingerprints)
end
end 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 -- Try and find the file
-- If it isn't in Nmap's directories, take it as a direct path -- If it isn't in Nmap's directories, take it as a direct path