1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-16 04:39:03 +00:00

No longer erroring if a server leaves out the 'domain' section of packets (some configurations of Samba seem to do this)

This commit is contained in:
ron
2008-12-24 20:36:30 +00:00
parent 38394e9f24
commit 67f9577de9

View File

@@ -1030,21 +1030,16 @@ function negotiate_protocol(smb)
return false, "SMB: ERROR: Ran off the end of SMB packet; likely due to server truncation [12]"
end
-- Get the domain as a Unicode string
local ch, dummy
domain = ""
server = ""
-- Get the domain as a Unicode string
-- Note: This can be null, some configurations of Samba leave this off
pos, ch, dummy = bin.unpack("<CC", data, pos)
if(dummy == nil) then
return false, "SMB: ERROR: Ran off the end of SMB packet; likely due to server truncation [13]"
end
while ch ~= nil and ch ~= 0 do
domain = domain .. string.char(ch)
pos, ch, dummy = bin.unpack("<CC", data, pos)
if(dummy == nil) then
return false, "SMB: ERROR: Ran off the end of SMB packet; likely due to server truncation [14]"
end
end
-- Get the server name as a Unicode string