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
|
-- Boolean
|
||||||
self.decoder["01"] = function( self, encStr, elen, pos )
|
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
|
if val ~= "FF" then
|
||||||
return pos, true
|
return pos, true
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -676,7 +676,7 @@ end
|
|||||||
-- local res
|
-- local res
|
||||||
-- res = versionQuery()
|
-- res = versionQuery()
|
||||||
-- print(type(res),res:len(),res)
|
-- print(type(res),res:len(),res)
|
||||||
-- local out= bin.unpack('C'..#res,res)
|
-- local _, out= bin.unpack('C'..#res,res)
|
||||||
-- printBuffer(res)
|
-- printBuffer(res)
|
||||||
-- end
|
-- end
|
||||||
--test()
|
--test()
|
||||||
|
|||||||
@@ -932,7 +932,8 @@ function get_host_info_from_security_blob(security_blob)
|
|||||||
break
|
break
|
||||||
elseif ( av_id == NTLM_AV_ID_VALUES.MsvAvTimestamp ) then
|
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
|
-- 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
|
elseif ( friendly_name ) then
|
||||||
ntlm_challenge[ friendly_name ] = unicode.utf16to8( value )
|
ntlm_challenge[ friendly_name ] = unicode.utf16to8( value )
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ StartTLS = {
|
|||||||
while optype ~= mssql.PreLoginPacket.OPTION_TYPE.Terminator do
|
while optype ~= mssql.PreLoginPacket.OPTION_TYPE.Terminator do
|
||||||
--stdnse.debug1("optype: %d, oppos: %x, oplen: %d", optype, oppos, oplen)
|
--stdnse.debug1("optype: %d, oppos: %x, oplen: %d", optype, oppos, oplen)
|
||||||
if optype == mssql.PreLoginPacket.OPTION_TYPE.Encryption then
|
if optype == mssql.PreLoginPacket.OPTION_TYPE.Encryption then
|
||||||
encryption = bin.unpack('C', result, oppos + 1)
|
pos, encryption = bin.unpack('C', result, oppos + 1)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
pos, optype, oppos, oplen = bin.unpack('>CSS', result, pos)
|
pos, optype, oppos, oplen = bin.unpack('>CSS', result, pos)
|
||||||
|
|||||||
Reference in New Issue
Block a user