From 40652f215b2ea3369d40e2769e510f789eb6f5f8 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 5 Feb 2015 04:17:58 +0000 Subject: [PATCH] Remove redundant 'proto=port.protocol' from comm.lua calls --- scripts/daytime.nse | 2 +- scripts/finger.nse | 2 +- scripts/iax2-version.nse | 2 +- scripts/ntp-info.nse | 4 ++-- scripts/quake1-info.nse | 6 ++---- scripts/rfc868-time.nse | 2 +- scripts/skypev2-version.nse | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/daytime.nse b/scripts/daytime.nse index 171a85181..b9efbee88 100644 --- a/scripts/daytime.nse +++ b/scripts/daytime.nse @@ -21,7 +21,7 @@ categories = {"discovery", "safe"} portrule = shortport.port_or_service(13, "daytime", {"tcp", "udp"}) action = function(host, port) - local status, result = comm.exchange(host, port, "dummy", {lines=1, proto=port.protocol}) + local status, result = comm.exchange(host, port, "dummy", {lines=1}) if status then return result diff --git a/scripts/finger.nse b/scripts/finger.nse index b40135ea7..a8f90456c 100644 --- a/scripts/finger.nse +++ b/scripts/finger.nse @@ -33,5 +33,5 @@ action = function(host, port) local try = nmap.new_try() return try(comm.exchange(host, port, "\r\n", - {lines=100, proto=port.protocol, timeout=5000})) + {lines=100, timeout=5000})) end diff --git a/scripts/iax2-version.nse b/scripts/iax2-version.nse index a5f5260bf..3e304a0c6 100644 --- a/scripts/iax2-version.nse +++ b/scripts/iax2-version.nse @@ -29,7 +29,7 @@ action = function(host, port) -- see http://www.cornfed.com/iax.pdf for all options. local poke = "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x1e" - local status, recv = comm.exchange(host, port, poke, {proto=port.protocol,timeout=10000}) + local status, recv = comm.exchange(host, port, poke, {timeout=10000}) if not status then return diff --git a/scripts/ntp-info.nse b/scripts/ntp-info.nse index bedca4606..02f2fca8e 100644 --- a/scripts/ntp-info.nse +++ b/scripts/ntp-info.nse @@ -98,7 +98,7 @@ action = function(host, port) local rlreq = string.char(0x16, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) - status, buftres = comm.exchange(host, port, treq, {proto=port.protocol, timeout=TIMEOUT}) + status, buftres = comm.exchange(host, port, treq, {timeout=TIMEOUT}) if status then local _, sec, frac, tstamp @@ -111,7 +111,7 @@ action = function(host, port) output["receive time stamp"] = stdnse.format_timestamp(tstamp) end - status, bufrlres = comm.exchange(host, port, rlreq, {proto=port.protocol, timeout=TIMEOUT}) + status, bufrlres = comm.exchange(host, port, rlreq, {timeout=TIMEOUT}) if status then -- This only looks at the first fragment of what can possibly be several diff --git a/scripts/quake1-info.nse b/scripts/quake1-info.nse index a5f247376..60e8c09cc 100644 --- a/scripts/quake1-info.nse +++ b/scripts/quake1-info.nse @@ -135,8 +135,7 @@ local function get_player_info(host, port, id) id - 1) -- player number (0 indexed) -- iptables -m u32 --u32 '0x1c=0x80000006&&0x1d&0xff=0x03' - local status, rep_pl = comm.exchange(host, port, req_pl, - { proto = port.protocol }) + local status, rep_pl = comm.exchange(host, port, req_pl) assert_w_table(status, "No response to request for player info") player_info.player_ratio = string.format("%d/%d=%f", @@ -201,8 +200,7 @@ local function get_server_info(host, port) net_protocol_released) -- net protocol version -- iptables -m u32 --u32 '0x1c=0x8000000c&&0x20=0x02515541&&0x24=0x4b450003' - local status, rep_pl = comm.exchange(host, port, req_pl, - { proto = port.protocol }) + local status, rep_pl = comm.exchange(host, port, req_pl) assert_w_table(status, "No response to request for server info") nmap.set_port_state(host, port, 'open') diff --git a/scripts/rfc868-time.nse b/scripts/rfc868-time.nse index 994e5f507..7f77b1251 100644 --- a/scripts/rfc868-time.nse +++ b/scripts/rfc868-time.nse @@ -25,7 +25,7 @@ categories = {"discovery", "safe", "version"} portrule = shortport.version_port_or_service(37, "time", {"tcp", "udp"}) action = function(host, port) - local status, result = comm.exchange(host, port, "", {bytes=4, proto=port.protocol}) + local status, result = comm.exchange(host, port, "", {bytes=4}) if status then local _, stamp diff --git a/scripts/skypev2-version.nse b/scripts/skypev2-version.nse index c697b620d..f1b1c5cee 100644 --- a/scripts/skypev2-version.nse +++ b/scripts/skypev2-version.nse @@ -48,7 +48,7 @@ action = function(host, port) if not result then -- Have to send the probe ourselves. status, result = comm.exchange(host, port, - "GET / HTTP/1.0\r\n\r\n", {bytes=26, proto=port.protocol}) + "GET / HTTP/1.0\r\n\r\n", {bytes=26}) if (not status) then return nil @@ -62,7 +62,7 @@ action = function(host, port) -- So far so good, now see if we get random data for another request if not rand then status, rand = comm.exchange(host, port, - "random data\r\n\r\n", {bytes=15, proto=port.protocol}) + "random data\r\n\r\n", {bytes=15}) if (not status) then return