1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix some incorrect conversions from bin to string unpacking

This commit is contained in:
dmiller
2018-09-20 02:19:53 +00:00
parent 00ec940ead
commit 7819453af5
5 changed files with 6 additions and 6 deletions

View File

@@ -405,7 +405,7 @@ Packet.GIOP.list =
local UNKNOWN, UNKNOWN2, UNKNOWN3 = 2, 1, 6
local data = {
string.pack(">I4BxxxI2I2s4s4xxCI", self.id, self.flags,
string.pack(">I4BxxxI2I2s4s4xxBI4", self.id, self.flags,
self.target_addr, UNKNOWN, self.key_addr,
self.op, UNKNOWN2, #self.sc )
}

View File

@@ -847,7 +847,7 @@ function unmarshall_int32(data, pos)
stdnse.debug1("MSRPC: ERROR: Ran off the end of a packet in unmarshall_int32(). Please report!")
return pos, nil
end
pos, value = string.unpack("<I4", data, pos)
value, pos = string.unpack("<I4", data, pos)
return pos, value
end

View File

@@ -909,11 +909,11 @@ NCP = {
-- a bunch of unknowns
local u2, u3, u4, u5, u6, u7, u8, u9 = 0, 0, 2, 2, 0, 0x10, 0, 0x11
local data = string.pack("<I4I4I4 I2I2I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 AI4 I4 I4 A",
local data = string.pack("<I4I4I4 I2I2I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 s4 I4 I4 s4",
frag_handle, frag_size, msg_size, unknown, proto_flags,
nds_verb, nds_reply_buf, version, flags, iter_handle,
base.id, repl_type, numobjs, info_types, info_flags, u2, u3, u4,
u5, u6, u7, #w_name, w_name, u8, u9, #w_class, w_class )
u5, u6, u7, w_name, u8, u9, w_class )
p:setData(data)
return self:Exch( p )
end,

View File

@@ -127,7 +127,7 @@ function smb2_send(smb, header, data, overrides)
local attempts = 5
local status, err
local out = string.pack(">I<c" .. #body, #body, body)
local out = string.pack(">s4", body)
repeat
attempts = attempts - 1
stdnse.debug3("SMB: Sending SMB packet (len: %d, attempts remaining: %d)", #out, attempts)

View File

@@ -63,7 +63,7 @@ local function processOptions(data)
return false, "Failed to parse options"
end
else
pos, option = string.unpack("B", data, pos)
option, pos = string.unpack("B", data, pos)
result[option] = result[option] or {}
table.insert(result[option], cmd)
end