mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 13:41:29 +00:00
Solve "unexpected signature" message in SMB extended session setup (NTLM type 2 message only sent once)
This commit is contained in:
@@ -1319,6 +1319,7 @@ local function start_session_extended(smb, log_errors, overrides)
|
||||
sp_nego = ( oid == "\x2b\x06\x01\x05\x05\x02" ) -- check for SPNEGO OID 1.3.6.1.5.5.2
|
||||
end
|
||||
|
||||
local ntlm_challenge_accepted = false
|
||||
while result ~= false do
|
||||
-- These are loop variables
|
||||
local security_blob = nil
|
||||
@@ -1427,6 +1428,7 @@ local function start_session_extended(smb, log_errors, overrides)
|
||||
-- Parse the data
|
||||
pos, security_blob, os, lanmanager = bin.unpack(string.format("<A%dzz", security_blob_length), data)
|
||||
|
||||
if not ntlm_challenge_accepted then
|
||||
if ( status_name == "NT_STATUS_MORE_PROCESSING_REQUIRED" and sp_nego ) then
|
||||
local start = security_blob:find("NTLMSSP")
|
||||
security_blob = security_blob:sub(start)
|
||||
@@ -1446,6 +1448,8 @@ local function start_session_extended(smb, log_errors, overrides)
|
||||
smb['server'] = host_info['netbios_computer_name']
|
||||
smb['domain'] = host_info['netbios_domain_name']
|
||||
end
|
||||
ntlm_challenge_accepted = true
|
||||
end
|
||||
|
||||
|
||||
-- If it's ok, do a cleanup and return true
|
||||
|
||||
Reference in New Issue
Block a user