mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 21:19:01 +00:00
Fix bugs where pos return value of bin.unpack was ignored
This commit is contained in:
@@ -61,7 +61,7 @@ ASN1Decoder = {
|
||||
|
||||
-- Boolean
|
||||
self.decoder["01"] = function( self, encStr, elen, pos )
|
||||
local val = bin.unpack("H", encStr, pos)
|
||||
local pos, val = bin.unpack("H", encStr, pos)
|
||||
if val ~= "FF" then
|
||||
return pos, true
|
||||
else
|
||||
|
||||
@@ -676,7 +676,7 @@ end
|
||||
-- local res
|
||||
-- res = versionQuery()
|
||||
-- print(type(res),res:len(),res)
|
||||
-- local out= bin.unpack('C'..#res,res)
|
||||
-- local _, out= bin.unpack('C'..#res,res)
|
||||
-- printBuffer(res)
|
||||
-- end
|
||||
--test()
|
||||
|
||||
@@ -932,7 +932,8 @@ function get_host_info_from_security_blob(security_blob)
|
||||
break
|
||||
elseif ( av_id == NTLM_AV_ID_VALUES.MsvAvTimestamp ) then
|
||||
-- this is a FILETIME value (see [MS-DTYP]), representing the time in 100-ns increments since 1/1/1601
|
||||
ntlm_challenge[ friendly_name ] = bin.unpack( "<L", value )
|
||||
local _
|
||||
_, ntlm_challenge[ friendly_name ] = bin.unpack( "<L", value )
|
||||
elseif ( friendly_name ) then
|
||||
ntlm_challenge[ friendly_name ] = unicode.utf16to8( value )
|
||||
end
|
||||
|
||||
@@ -466,7 +466,7 @@ StartTLS = {
|
||||
while optype ~= mssql.PreLoginPacket.OPTION_TYPE.Terminator do
|
||||
--stdnse.debug1("optype: %d, oppos: %x, oplen: %d", optype, oppos, oplen)
|
||||
if optype == mssql.PreLoginPacket.OPTION_TYPE.Encryption then
|
||||
encryption = bin.unpack('C', result, oppos + 1)
|
||||
pos, encryption = bin.unpack('C', result, oppos + 1)
|
||||
break
|
||||
end
|
||||
pos, optype, oppos, oplen = bin.unpack('>CSS', result, pos)
|
||||
|
||||
Reference in New Issue
Block a user