Fix for IPv6 scan

This commit is contained in:
Luca Deri 2023-11-29 11:40:46 +01:00
parent d8c41081f4
commit 309e025c59
2 changed files with 4 additions and 5 deletions

View file

@ -2482,9 +2482,10 @@ function vs_utils.nmap_check_host(host_ip, use_coroutines)
local nmap = vs_utils.get_nmap_path()
local scan_command = nmap.." -sn"
-- IPv6 check
if(string.contains(host_ip, ':')) then scan_command = scan_command .. " -6" end
-- IPv6 check (need to use --privileged otherwise nmap will report hosts are down even if up)
if(string.contains(host_ip, ':')) then scan_command = scan_command .. " --privileged -6" end
scan_command = string.format("%s %s",scan_command,host_ip)
if(debug_me) then traceError(TRACE_NORMAL, TRACE_CONSOLE, "Executing: "..scan_command.."\n") end
local start_scan = os.time()
@ -2492,8 +2493,6 @@ function vs_utils.nmap_check_host(host_ip, use_coroutines)
local end_scan = os.time()
local scan_duration = end_scan - start_scan
local is_up = vs_utils.cleanup_nmap_check_host_result(result)
if(debug_me) then traceError(TRACE_NORMAL, TRACE_CONSOLE, "Host is up: "..tostring(is_up).."\n") end