mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-19 16:13:43 +00:00
43 lines
1.2 KiB
Lua
43 lines
1.2 KiB
Lua
--
|
|
-- (C) 2020-23 - ntop.org
|
|
--
|
|
|
|
-- https://vulners.com/
|
|
|
|
local vs_module = {}
|
|
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/vulnerability_scan/?.lua;" .. package.path
|
|
local vs_utils = require("vs_utils")
|
|
|
|
-- ##############################################
|
|
|
|
function vs_module:new()
|
|
local obj = { name = "vulners" }
|
|
|
|
setmetatable(obj, self)
|
|
self.__index = self
|
|
|
|
return obj
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
function vs_module:is_enabled()
|
|
return(vs_utils.is_nmap_installed())
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
-- NOTE: ports are comma separated (e.g 80,443)
|
|
|
|
function vs_module:scan_host(host_ip, ports, use_coroutines)
|
|
local nmap = vs_utils.get_nmap_path()
|
|
local command = nmap.." -sV --script=vulscan/vulscan.nse" -- <target> -p 80,233
|
|
local now,result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports = vs_utils.nmap_scan_host(command, host_ip, ports, use_coroutines, self.name)
|
|
return now,result,duration,scan_result,num_open_ports,num_vulnerabilities_found, cve, udp_ports, tcp_ports
|
|
end
|
|
|
|
-- ##############################################
|
|
|
|
return vs_module
|
|
|