mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix VS scan results. (#7865)
This commit is contained in:
parent
193ff19f7b
commit
68ab1bd7c0
1 changed files with 17 additions and 10 deletions
|
|
@ -720,6 +720,20 @@ function vs_utils.load_module(name)
|
|||
return(require(name):new())
|
||||
end
|
||||
|
||||
local function format_port_list_to_string(ports)
|
||||
local scan_ports
|
||||
for index,port in ipairs(ports) do
|
||||
if (index == 1) then
|
||||
scan_ports = ""..port
|
||||
else
|
||||
scan_ports = scan_ports .. ","..port
|
||||
end
|
||||
end
|
||||
|
||||
return scan_ports
|
||||
|
||||
end
|
||||
|
||||
function vs_utils.discover_open_ports(host)
|
||||
|
||||
local result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports, scan_ports
|
||||
|
|
@ -728,15 +742,8 @@ function vs_utils.discover_open_ports(host)
|
|||
result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports = scan_module:scan_host(host, ports)
|
||||
|
||||
-- FIX ME -> only tcp for now
|
||||
for _,port in ipairs(tcp_ports) do
|
||||
if (_ == 1) then
|
||||
scan_ports = ""..port
|
||||
else
|
||||
scan_ports = scan_ports .. ","..port
|
||||
end
|
||||
end
|
||||
|
||||
return scan_ports
|
||||
|
||||
return format_port_list_to_string(tcp_ports)
|
||||
end
|
||||
|
||||
-- **********************************************************
|
||||
|
|
@ -758,7 +765,7 @@ function vs_utils.scan_host(scan_type, host, ports, scan_id)
|
|||
local result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports = scan_module:scan_host(host, ports)
|
||||
|
||||
-- FIX HERE UDP ports
|
||||
tcp_ports = {ports = ports, num_ports = num_open_ports}
|
||||
tcp_ports = {ports = format_port_list_to_string(tcp_ports), num_ports = #tcp_ports}
|
||||
if scan_result then
|
||||
scan_result = vs_utils.scan_status.ok
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue