mirror of
https://github.com/nmap/nmap.git
synced 2026-02-12 16:36:34 +00:00
open / open|filtered tables work for shortport.service now
This commit is contained in:
@@ -44,11 +44,19 @@ service = function(service, _proto, _state)
|
||||
service_table = service
|
||||
end
|
||||
|
||||
if(type(state) == "string") then
|
||||
state_table = {state}
|
||||
elseif(type(state) == "table") then
|
||||
state_table = state
|
||||
end
|
||||
|
||||
return function(host, port)
|
||||
if(port.protocol == proto and port.state == state) then
|
||||
for _, service in ipairs(service_table) do
|
||||
if(port.service == service) then
|
||||
return true
|
||||
for _, state in pairs(state_table) do
|
||||
if(port.protocol == proto and port.state == state) then
|
||||
for _, service in ipairs(service_table) do
|
||||
if(port.service == service) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user