1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 20:51:30 +00:00

Fix more non-explicit endianness things

This commit is contained in:
dmiller
2017-02-14 05:46:40 +00:00
parent f20589ca09
commit cc0661fb34
4 changed files with 5 additions and 5 deletions

View File

@@ -810,7 +810,7 @@ ColumnInfo =
pos, colinfo.unknown, colinfo.codepage, colinfo.flags, colinfo.charset = bin.unpack("<ISSC", data, pos ) pos, colinfo.unknown, colinfo.codepage, colinfo.flags, colinfo.charset = bin.unpack("<ISSC", data, pos )
pos, colinfo.tablenamelen = bin.unpack("s", data, pos ) pos, colinfo.tablenamelen = bin.unpack("<s", data, pos )
pos, colinfo.tablename = bin.unpack("A" .. (colinfo.tablenamelen * 2), data, pos) pos, colinfo.tablename = bin.unpack("A" .. (colinfo.tablenamelen * 2), data, pos)
pos, colinfo.msglen = bin.unpack("<C", data, pos ) pos, colinfo.msglen = bin.unpack("<C", data, pos )
pos, tmp = bin.unpack("A" .. (colinfo.msglen * 2), data, pos) pos, tmp = bin.unpack("A" .. (colinfo.msglen * 2), data, pos)

View File

@@ -57,7 +57,7 @@ local get_prefix = function(data)
if string.len(data) <= 31 then if string.len(data) <= 31 then
return bin.pack("C",0xa0 + string.len(data)) return bin.pack("C",0xa0 + string.len(data))
else else
return "\xda" .. bin.pack("s",string.len(data)) return "\xda" .. bin.pack(">s",string.len(data))
end end
end end

View File

@@ -48,12 +48,12 @@ local encode = function(username, password)
if string.len(username) <= 31 then -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-fixraw if string.len(username) <= 31 then -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-fixraw
username_prefix = bin.pack("C",0xa0 + string.len(username)) username_prefix = bin.pack("C",0xa0 + string.len(username))
else -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-raw16 else -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-raw16
username_prefix = "\xda" .. bin.pack("s",string.len(username)) username_prefix = "\xda" .. bin.pack(">s",string.len(username))
end end
if string.len(password) <= 31 then if string.len(password) <= 31 then
password_prefix = bin.pack("C",0xa0 + string.len(password)) password_prefix = bin.pack("C",0xa0 + string.len(password))
else else
password_prefix = "\xda" .. bin.pack("s",string.len(password)) password_prefix = "\xda" .. bin.pack(">s",string.len(password))
end end
return "\x93\xaa" .. method .. username_prefix .. username .. password_prefix .. password return "\x93\xaa" .. method .. username_prefix .. username .. password_prefix .. password

View File

@@ -77,7 +77,7 @@ action = function(host,port)
local lanman_result local lanman_result
local REMSmb_NetShareEnum_P = "WrLeh" local REMSmb_NetShareEnum_P = "WrLeh"
local REMSmb_share_info_1 = "B13BWz" local REMSmb_share_info_1 = "B13BWz"
status, lanman_result = msrpc.call_lanmanapi(smbstate,0,REMSmb_NetShareEnum_P,REMSmb_share_info_1,bin.pack("ss",0x01,65406)) status, lanman_result = msrpc.call_lanmanapi(smbstate,0,REMSmb_NetShareEnum_P,REMSmb_share_info_1,bin.pack("<ss",0x01,65406))
if status == false then if status == false then
stdnse.debug1("SMB: " .. lanman_result) stdnse.debug1("SMB: " .. lanman_result)
stdnse.debug1("SMB: Looks like LANMAN API is not available. Try setting printer script arg.") stdnse.debug1("SMB: Looks like LANMAN API is not available. Try setting printer script arg.")