From cc0661fb34a6d0ab23f41ab1ffaf4fb18b5f1489 Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 14 Feb 2017 05:46:40 +0000 Subject: [PATCH] Fix more non-explicit endianness things --- nselib/mssql.lua | 2 +- scripts/metasploit-info.nse | 2 +- scripts/metasploit-msgrpc-brute.nse | 4 ++-- scripts/smb-print-text.nse | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nselib/mssql.lua b/nselib/mssql.lua index efec5cdce..034832b2b 100644 --- a/nselib/mssql.lua +++ b/nselib/mssql.lua @@ -810,7 +810,7 @@ ColumnInfo = pos, colinfo.unknown, colinfo.codepage, colinfo.flags, colinfo.charset = bin.unpack("s",string.len(data)) end end diff --git a/scripts/metasploit-msgrpc-brute.nse b/scripts/metasploit-msgrpc-brute.nse index 65aac4d67..ff780dba9 100644 --- a/scripts/metasploit-msgrpc-brute.nse +++ b/scripts/metasploit-msgrpc-brute.nse @@ -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 username_prefix = bin.pack("C",0xa0 + string.len(username)) 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 if string.len(password) <= 31 then password_prefix = bin.pack("C",0xa0 + string.len(password)) else - password_prefix = "\xda" .. bin.pack("s",string.len(password)) + password_prefix = "\xda" .. bin.pack(">s",string.len(password)) end return "\x93\xaa" .. method .. username_prefix .. username .. password_prefix .. password diff --git a/scripts/smb-print-text.nse b/scripts/smb-print-text.nse index b318e0132..d0b662012 100644 --- a/scripts/smb-print-text.nse +++ b/scripts/smb-print-text.nse @@ -77,7 +77,7 @@ action = function(host,port) local lanman_result local REMSmb_NetShareEnum_P = "WrLeh" 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("