mirror of
https://github.com/nmap/nmap.git
synced 2026-01-16 03:19:01 +00:00
Remove redundant 'proto=port.protocol' from comm.lua calls
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user