diff --git a/nselib/bitcoin.lua b/nselib/bitcoin.lua index 5d3cd3dd1..51ef289e7 100644 --- a/nselib/bitcoin.lua +++ b/nselib/bitcoin.lua @@ -136,7 +136,7 @@ Request = { local header = bin.pack("ICCCCIIIAIA", self.id, self.resp_expected, pad, pad, pad, @@ -347,8 +346,7 @@ Packet.GIOP._is_a = UNKNOWN, #self.key_addr, self.key_addr, #self.op, self.op, UNKNOWN2, #self.sc ) for i=1, #self.sc do - local tmp = tostring( self.sc[i]) - data = data .. bin.pack("A", tmp ) + data = data .. tostring( self.sc[i]) end data = data .. bin.pack(">IA", #TYPE_ID, TYPE_ID) @@ -403,8 +401,7 @@ Packet.GIOP.list = #self.op, self.op, RESERVED, RESERVED, UNKNOWN2, #self.sc ) for i=1, #self.sc do - local tmp = tostring( self.sc[i]) - data = data .. bin.pack("A", tmp ) + data = data .. tostring( self.sc[i]) end data = data .. bin.pack(">II", UNKNOWN3, self.how_many ) diff --git a/nselib/ldap.lua b/nselib/ldap.lua index cdfa68ed3..f10b78d56 100644 --- a/nselib/ldap.lua +++ b/nselib/ldap.lua @@ -203,7 +203,7 @@ function encodeLDAPOp( appno, isConstructed, data ) local encoded_str = "" local asn1_type = asn1.BERtoInt( asn1.BERCLASS.Application, isConstructed, appno ) - encoded_str = encode( { _ldaptype = bin.pack("A", string.format("%X", asn1_type)), data } ) + encoded_str = encode( { _ldaptype = string.format("%X", asn1_type), data } ) return encoded_str end @@ -512,7 +512,7 @@ function createFilter( filter ) filter_str = filter_str .. obj .. val end - return encode( { _ldaptype=bin.pack("A", string.format("%X", asn1_type)), filter_str } ) + return encode( { _ldaptype=string.format("%X", asn1_type), filter_str } ) end --- Converts a search result as received from searchRequest to a "result" table diff --git a/nselib/pppoe.lua b/nselib/pppoe.lua index 63dffb2e0..2d7d4e58a 100644 --- a/nselib/pppoe.lua +++ b/nselib/pppoe.lua @@ -448,7 +448,7 @@ PPPoE = { header = PPPoE.Header:new(PPPoE.Code.PADI), tags = tags or { PPPoE.Tag:new(PPPoE.TagType.SERVICE_NAME), - PPPoE.Tag:new(PPPoE.TagType.HOST_UNIQUE, bin.pack("A", c)) + PPPoE.Tag:new(PPPoE.TagType.HOST_UNIQUE, c) } } setmetatable(o, self) @@ -950,7 +950,7 @@ Helper = { local auth_proposed = config_req.options:getById(LCP.ConfigOption.AUTH_PROTO) if ( auth_proposed.raw ~= auth_data ) then - local options = { LCP.ConfigOption:new(LCP.ConfigOption.AUTH_PROTO, nil, bin.pack("A", auth_data)) } + local options = { LCP.ConfigOption:new(LCP.ConfigOption.AUTH_PROTO, nil, auth_data) } local lcp_req = LCP.ConfigNak:new(self.identifier, options) local sess_req = PPPoE.SessionData:new(self.session, tostring(lcp_req)) local status, resp = self.comm:exch(sess_req) diff --git a/nselib/rpc.lua b/nselib/rpc.lua index 7ddcfc032..7bead8ec3 100644 --- a/nselib/rpc.lua +++ b/nselib/rpc.lua @@ -1945,9 +1945,8 @@ NFS = { return false, "FsStat: No filehandle received" end - data = bin.pack("A", file_handle) packet = comm:EncodePacket(nil, NFS.Procedure[comm.version].FSSTAT, - {type = Portmap.AuthType.UNIX}, data) + {type = Portmap.AuthType.UNIX}, file_handle) if (not(comm:SendPacket(packet))) then return false, "FsStat: Failed to send data" diff --git a/scripts/path-mtu.nse b/scripts/path-mtu.nse index c679e4992..4614f8d21 100644 --- a/scripts/path-mtu.nse +++ b/scripts/path-mtu.nse @@ -154,7 +154,7 @@ end -- different hosts local check = function(layer3) local ip = packet.Packet:new(layer3, layer3:len()) - return bin.pack('A', ip.ip_bin_dst) + return ip.ip_bin_dst end -- Updates a packet's info and calculates checksum @@ -341,7 +341,7 @@ action = function(host) end end - local test = bin.pack('A', pkt.ip_bin_src) + local test = pkt.ip_bin_src local status, length, _, layer3 = pcap:pcap_receive() while status and test ~= check(layer3) do status, length, _, layer3 = pcap:pcap_receive()