mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 15:39:03 +00:00
Change calls in these forms:
socket:connect(host.ip, port.number) socket:connect(host.ip, port.number, port.protocol) to this: socket:connect(host, port) connect can take host and port tables now, and the default protocol is taken from the port table if possible.
This commit is contained in:
@@ -21,7 +21,7 @@ function capabilities(host, port)
|
||||
local capas = {}
|
||||
socket:set_timeout(10000)
|
||||
local proto = (port.version and port.version.service_tunnel == "ssl" and "ssl") or "tcp"
|
||||
if not socket:connect(host.ip, port.number, proto) then return nil, "Could Not Connect" end
|
||||
if not socket:connect(host, port, proto) then return nil, "Could Not Connect" end
|
||||
|
||||
local status, line = socket:receive_lines(1)
|
||||
if not string.match(line, "^[%*] OK") then return nil, "No Response" end
|
||||
|
||||
Reference in New Issue
Block a user