mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 05:09:00 +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:
@@ -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]"
|
return false, "SMB: ERROR: Ran off the end of SMB packet; likely due to server truncation [12]"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get the domain as a Unicode string
|
|
||||||
local ch, dummy
|
local ch, dummy
|
||||||
domain = ""
|
domain = ""
|
||||||
server = ""
|
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)
|
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
|
while ch ~= nil and ch ~= 0 do
|
||||||
domain = domain .. string.char(ch)
|
domain = domain .. string.char(ch)
|
||||||
pos, ch, dummy = bin.unpack("<CC", data, pos)
|
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
|
end
|
||||||
|
|
||||||
-- Get the server name as a Unicode string
|
-- Get the server name as a Unicode string
|
||||||
|
|||||||
Reference in New Issue
Block a user