1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 11:29:01 +00:00

Correct the return value of smb2.negotiate_v2

As documented, the function should return the negotiated SMB2 dialect,
not just reflect back the dialect override table.
This commit is contained in:
nnposter
2020-12-16 17:54:15 +00:00
parent 57b7e56a68
commit 1b39988bf9
2 changed files with 2 additions and 2 deletions

View File

@@ -371,7 +371,7 @@ function negotiate_v2(smb, overrides)
local security_buffer_offset, security_buffer_length, neg_context_offset
security_buffer_offset, security_buffer_length, neg_context_offset = string.unpack("<I2 I2 I4", data)
if status == 0 then
return true, overrides['Dialects']
return true, smb['dialect']
else
return false, string.format("Status error code:%s",status)
end

View File

@@ -77,7 +77,7 @@ action = function(host,port)
elseif not(signing_enabled) and signing_required then
table.insert(message_signing, "Message signing is disabled!")
end
output[stdnse.tohex(dialect[1], {separator = ".", group = 2})] = message_signing
output[stdnse.tohex(dialect, {separator = ".", group = 2})] = message_signing
-- We exit after first accepted dialect,
-- SMB signing configuration appears to be global so
-- there is no point of trying other dialects.