diff --git a/scripts/broadcast-dhcp-discover.nse b/scripts/broadcast-dhcp-discover.nse index b8f87efdb..7ae771971 100644 --- a/scripts/broadcast-dhcp-discover.nse +++ b/scripts/broadcast-dhcp-discover.nse @@ -1,4 +1,3 @@ -local bin = require "bin" local coroutine = require "coroutine" local dhcp = require "dhcp" local ipOps = require "ipOps" @@ -180,7 +179,7 @@ action = function() if( not(interfaces) ) then return fail("Failed to retrieve interfaces (try setting one explicitly using -e)") end - local transaction_id = bin.pack("I", bin.pack("H", addr) ) - local ip = ipOps.fromdword(dw_addr) + local ip = ipOps.str_to_ip(stdnse.fromhex(addr)) if ( not(ips[ip]) ) then table.insert(addrs, ip) diff --git a/scripts/broadcast-wake-on-lan.nse b/scripts/broadcast-wake-on-lan.nse index e54988e79..54e69f80f 100644 --- a/scripts/broadcast-wake-on-lan.nse +++ b/scripts/broadcast-wake-on-lan.nse @@ -1,4 +1,3 @@ -local bin = require "bin" local nmap = require "nmap" local stdnse = require "stdnse" local string = require "string" @@ -36,7 +35,7 @@ end -- @param mac string containing the MAC without delimiters -- @return packet string containing the raw packet local function createWOLPacket(mac) - return "\xff\xff\xff\xff\xff\xff" .. string.rep(bin.pack("H", mac), 16) + return "\xff\xff\xff\xff\xff\xff" .. string.rep(stdnse.fromhex(mac), 16) end local function fail (err) return stdnse.format_output(false, err) end diff --git a/scripts/cups-info.nse b/scripts/cups-info.nse index d17586c7b..f9c99bef0 100644 --- a/scripts/cups-info.nse +++ b/scripts/cups-info.nse @@ -1,7 +1,7 @@ -local bin = require "bin" local ipp = require "ipp" local shortport = require "shortport" local stdnse = require "stdnse" +local string = require "string" local table = require "table" description = [[ @@ -62,7 +62,7 @@ action = function(host, port) [ipp.IPP.PrinterState.IPP_PRINTER_PROCESSING] = "Processing", [ipp.IPP.PrinterState.IPP_PRINTER_STOPPED] = "Stopped", } - local pos, state = bin.unpack(">I", printer.state) + local pos, state = string.unpack(">I4", printer.state) table.insert(output, { name = printer.name, ("DNS-SD Name: %s"):format(printer.dns_sd_name or ""), diff --git a/scripts/eap-info.nse b/scripts/eap-info.nse index 1a04780fc..5741f4cac 100644 --- a/scripts/eap-info.nse +++ b/scripts/eap-info.nse @@ -1,4 +1,3 @@ -local bin = require "bin" local eap = require "eap" local nmap = require "nmap" local stdnse = require "stdnse" @@ -156,7 +155,7 @@ action = function() -- mac spoofing to avoid to wait too much local d = string.byte(iface.mac,6) d = (d + 1) % 256 - iface.mac = iface.mac:sub(1,5) .. bin.pack("C",d) + iface.mac = iface.mac:sub(1,5) .. string.pack("B",d) tried_all = true for i,v in pairs(identity.auth) do diff --git a/scripts/epmd-info.nse b/scripts/epmd-info.nse index e510bc820..2a6dfddf8 100644 --- a/scripts/epmd-info.nse +++ b/scripts/epmd-info.nse @@ -1,4 +1,3 @@ -local bin = require "bin" local nmap = require "nmap" local shortport = require "shortport" local stdnse = require "stdnse" @@ -50,7 +49,7 @@ action = function(host, port) return nil end - local pos, realport = bin.unpack(">I", data) + local pos, realport = string.unpack(">I4", data) data = string.sub(data, pos) local nodes = stdnse.output_table()