mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Optimized load port
This commit is contained in:
parent
4577d4fe1e
commit
ad3e4273a2
1 changed files with 12 additions and 7 deletions
|
|
@ -942,9 +942,9 @@ function vs_utils.load_module(name)
|
|||
return(require(name):new())
|
||||
end
|
||||
|
||||
-- **********************************************************
|
||||
|
||||
|
||||
function vs_utils.discover_open_ports(host)
|
||||
function vs_utils.discover_open_portsx(host)
|
||||
|
||||
local result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports, scan_ports, network_alert_store,now
|
||||
|
||||
|
|
@ -968,14 +968,19 @@ function vs_utils.scan_host(scan_type, host, ports, scan_id)
|
|||
end
|
||||
end
|
||||
|
||||
local ports_scan_param = ports
|
||||
if (isEmptyString(ports)) then
|
||||
ports = vs_utils.discover_open_ports(host)
|
||||
local ports_scan_param
|
||||
|
||||
if(string.contains(scan_type, '_openports') or string.contains(scan_type, '_portscan')) then
|
||||
-- Nothing to do
|
||||
else
|
||||
if (isEmptyString(ports)) then
|
||||
ports = vs_utils.discover_open_ports(host)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
ports_scan_param = ports
|
||||
vs_utils.set_status_scan(scan_type, host, ports_scan_param, id, nil, vs_utils.scan_status.scanning)
|
||||
|
||||
|
||||
local scan_module = vs_utils.load_module(scan_type)
|
||||
local now,result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports = scan_module:scan_host(host, ports)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue