mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Enabled UDP and TCP scan on linux VS
This commit is contained in:
parent
a3bc601628
commit
b98a100871
5 changed files with 72 additions and 21 deletions
|
|
@ -179,29 +179,29 @@ function vs_utils.cleanup_nmap_result(scan_result, scan_type)
|
|||
scan_result = scan_result:gsub("|", "")
|
||||
scan_result = scan_result:gsub("_", "")
|
||||
|
||||
scan_result = lines(scan_result)
|
||||
|
||||
scan_result = lines(scan_result)
|
||||
|
||||
for i=1,4 do
|
||||
table.remove(scan_result, 1)
|
||||
end
|
||||
|
||||
for i=1,3 do
|
||||
table.remove(scan_result, #scan_result)
|
||||
end
|
||||
|
||||
|
||||
table.remove(scan_result, #scan_result)
|
||||
|
||||
local num_open_ports = 0
|
||||
local num_vulnerabilities = 0
|
||||
local cve = {}
|
||||
local scan_out = {}
|
||||
|
||||
for _,l in pairs(scan_result) do
|
||||
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
|
||||
if(string.find(l, "open") ~= nil) then
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if(string.sub(l, 1, 2) == " [") then
|
||||
local c = string.split(string.sub(l,3), "]")
|
||||
|
||||
|
|
@ -544,7 +544,7 @@ end
|
|||
|
||||
-- **********************************************************
|
||||
|
||||
function vs_utils.schedule_all_hosts_scan(scan_type, host, ports)
|
||||
function vs_utils.schedule_all_hosts_scan()
|
||||
local host_to_scan_list = vs_utils.retrieve_hosts_to_scan()
|
||||
|
||||
if #host_to_scan_list > 0 then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue