[VS] Add open ports page. (#7825)

This commit is contained in:
Nicolo Maio 2023-09-15 23:23:35 +02:00
parent 7e28fe2be2
commit 925a94659b
6 changed files with 327 additions and 5 deletions

View file

@ -383,9 +383,11 @@ function vs_utils.save_host_to_scan(scan_type, host, scan_result, last_scan_time
id = epoch_id,
is_ok_last_scan = is_ok_last_scan
}
if tcp_ports ~= nil then
new_item.tcp_ports = #tcp_ports
new_item.tcp_ports = tcp_ports.num_ports
new_item.tcp_ports_list = tcp_ports.ports
end
if udp_ports ~= nil then
@ -736,9 +738,12 @@ function vs_utils.scan_host(scan_type, host, ports, scan_id)
ports = vs_utils.discover_open_ports(host)
end
local scan_module = vs_utils.load_module(scan_type)
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}
if scan_result then
scan_result = vs_utils.scan_status.ok
@ -747,6 +752,7 @@ function vs_utils.scan_host(scan_type, host, ports, scan_id)
if debug_print then
traceError(TRACE_NORMAL,TRACE_CONSOLE,"End scan Host ".. host .. ", result: " .. result .. "\n")
end
if (isAlreadyPresent({host= host, scan_type= scan_type})) then
vs_utils.save_host_to_scan(scan_type, host, result, now, duration, scan_result,
ports, nil, num_open_ports, num_vulnerabilities_found, cve, scan_id, false, udp_ports, tcp_ports)