Fixed ports count

This commit is contained in:
Luca Deri 2023-08-03 15:44:36 +02:00
parent d8cb4bcfed
commit 2f009dd77c
2 changed files with 4 additions and 5 deletions

View file

@ -89,8 +89,7 @@ end
-- remove the first/last few lines that contain nmap information that change at each scan
function vs_utils.cleanup_nmap_result(scan_result, scan_type)
scan_result = scan_result:gsub("|", "")
scan_result = scan_result:gsub("^_", "")
scan_result = scan_result:gsub("_$", "")
scan_result = scan_result:gsub("_", "")
scan_result = lines(scan_result)
@ -108,8 +107,8 @@ function vs_utils.cleanup_nmap_result(scan_result, scan_type)
local scan_out = {}
for _,l in pairs(scan_result) do
local t = string.find(l, "/tcp open") or 0
local u = string.find(l, "/udp open") or 0
local t = string.find(l, "/tcp ") or 0
local u = string.find(l, "/udp ") or 0
if((t > 0) or (u > 0)) then
num_open_ports = num_open_ports + 1