mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
nselib stdnse.print_debug -> stdnse.debug
Manual fixes.
This commit is contained in:
@@ -215,7 +215,7 @@ local function opencon(host, port, protocol, data, opts)
|
|||||||
status, response = sd:receive()
|
status, response = sd:receive()
|
||||||
else
|
else
|
||||||
if not (opts and opts.recv_before) then
|
if not (opts and opts.recv_before) then
|
||||||
stdnse.print_debug("Using comm.tryssl without either first data payload or opts.recv_before." ..
|
stdnse.debug1("Using comm.tryssl without either first data payload or opts.recv_before." ..
|
||||||
"\nImpossible to test the connection for the correct protocol!")
|
"\nImpossible to test the connection for the correct protocol!")
|
||||||
end
|
end
|
||||||
response = early_resp
|
response = early_resp
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ SERVICES = {
|
|||||||
|
|
||||||
if ( octet1 ~= 127 ) then
|
if ( octet1 ~= 127 ) then
|
||||||
-- This shouldn't happen :P
|
-- This shouldn't happen :P
|
||||||
stdnse.print_debug(
|
stdnse.debug1(
|
||||||
"The request made to dnsbl.httpbl.org was considered invalid (%i)",
|
"The request made to dnsbl.httpbl.org was considered invalid (%i)",
|
||||||
octet1)
|
octet1)
|
||||||
elseif ( "short" == self.mode ) then
|
elseif ( "short" == self.mode ) then
|
||||||
|
|||||||
@@ -2107,7 +2107,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
---Take the data returned from a HTTP request and return the status string.
|
---Take the data returned from a HTTP request and return the status string.
|
||||||
-- Useful for <code>stdnse.print_debug</code> messages and even advanced output.
|
-- Useful for <code>stdnse.debug</code> messages and even advanced output.
|
||||||
--
|
--
|
||||||
-- @param data The response table from any HTTP request
|
-- @param data The response table from any HTTP request
|
||||||
-- @return The best status string we could find: either the actual status string, the status code, or <code>"<unknown status>"</code>.
|
-- @return The best status string we could find: either the actual status string, the status code, or <code>"<unknown status>"</code>.
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ local function d3(str,...)
|
|||||||
if nmap.debugging() > 2 then dbg(str, ...) end
|
if nmap.debugging() > 2 then dbg(str, ...) end
|
||||||
end
|
end
|
||||||
|
|
||||||
--local dbg =stdnse.print_debug
|
--local dbg =stdnse.debug
|
||||||
local function dbg_err(str,...)
|
local function dbg_err(str,...)
|
||||||
stdnse.debug1("json-ERR:"..str, ...)
|
stdnse.debug1("json-ERR:"..str, ...)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ local arg_DB = stdnse.get_script_args("mongodb.db")
|
|||||||
local function dbg(str,...)
|
local function dbg(str,...)
|
||||||
stdnse.debug3("MngoDb:"..str, ...)
|
stdnse.debug3("MngoDb:"..str, ...)
|
||||||
end
|
end
|
||||||
--local dbg =stdnse.print_debug
|
--local dbg =stdnse.debug1
|
||||||
|
|
||||||
local err =stdnse.print_debug
|
local err =stdnse.debug1
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
-- First of all comes a Bson parsing library. This can easily be moved out into a separate library should other
|
-- First of all comes a Bson parsing library. This can easily be moved out into a separate library should other
|
||||||
|
|||||||
@@ -4855,7 +4855,7 @@ end
|
|||||||
--####################################################################--
|
--####################################################################--
|
||||||
--# 3) RRAS RASRPC OPERATIONS
|
--# 3) RRAS RASRPC OPERATIONS
|
||||||
--####################################################################--
|
--####################################################################--
|
||||||
local RRAS_DEBUG_LVL = 2 --debug level for rras operations when calling stdnse.print_debug
|
local RRAS_DEBUG_LVL = 2 --debug level for rras operations when calling stdnse.debug
|
||||||
|
|
||||||
--####################################################################--
|
--####################################################################--
|
||||||
--- RRAS operation numbers.
|
--- RRAS operation numbers.
|
||||||
@@ -4904,7 +4904,7 @@ function RRAS_SubmitRequest(smbstate, pReqBuffer, dwcbBufSize)
|
|||||||
req_blob = req_blob .. msrpctypes.marshall_int32(dwcbBufSize)
|
req_blob = req_blob .. msrpctypes.marshall_int32(dwcbBufSize)
|
||||||
--call the function
|
--call the function
|
||||||
local status, result
|
local status, result
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
RRAS_DEBUG_LVL,
|
RRAS_DEBUG_LVL,
|
||||||
"RRAS_SubmitRequest: Calling...")
|
"RRAS_SubmitRequest: Calling...")
|
||||||
status, result = call_function(
|
status, result = call_function(
|
||||||
@@ -4913,13 +4913,13 @@ function RRAS_SubmitRequest(smbstate, pReqBuffer, dwcbBufSize)
|
|||||||
req_blob)
|
req_blob)
|
||||||
--sanity check
|
--sanity check
|
||||||
if(status == false) then
|
if(status == false) then
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
RRAS_DEBUG_LVL,
|
RRAS_DEBUG_LVL,
|
||||||
"RRAS_SubmitRequest: Call function failed: %s",
|
"RRAS_SubmitRequest: Call function failed: %s",
|
||||||
result)
|
result)
|
||||||
return false, result
|
return false, result
|
||||||
end
|
end
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
RRAS_DEBUG_LVL,
|
RRAS_DEBUG_LVL,
|
||||||
"RRAS_SubmitRequest: Returned successfully")
|
"RRAS_SubmitRequest: Returned successfully")
|
||||||
--dissect the reply
|
--dissect the reply
|
||||||
@@ -4953,7 +4953,7 @@ DNSSERVER_ConfInfo =
|
|||||||
--####################################################################--
|
--####################################################################--
|
||||||
--# 3) DNS SERVER MANAGEMENT SERVICE OPERATIONS
|
--# 3) DNS SERVER MANAGEMENT SERVICE OPERATIONS
|
||||||
--####################################################################--
|
--####################################################################--
|
||||||
local DNSSERVER_DEBUG_LVL = 2 --debug level for dnsserver operations when calling stdnse.print_debug
|
local DNSSERVER_DEBUG_LVL = 2 --debug level for dnsserver operations when calling stdnse.debug
|
||||||
|
|
||||||
--####################################################################--
|
--####################################################################--
|
||||||
--- DNSSERVER operation numbers.
|
--- DNSSERVER operation numbers.
|
||||||
@@ -5042,7 +5042,7 @@ function DNSSERVER_Query(smbstate, server_name, zone, operation)
|
|||||||
get_pad(operation_ascii, 4))
|
get_pad(operation_ascii, 4))
|
||||||
|
|
||||||
local call_result
|
local call_result
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
DNSSERVER_DEBUG_LVL,
|
DNSSERVER_DEBUG_LVL,
|
||||||
"DNSSERVER_Query: Calling...")
|
"DNSSERVER_Query: Calling...")
|
||||||
status, call_result = call_function(
|
status, call_result = call_function(
|
||||||
@@ -5051,13 +5051,13 @@ function DNSSERVER_Query(smbstate, server_name, zone, operation)
|
|||||||
req_blob)
|
req_blob)
|
||||||
--sanity check
|
--sanity check
|
||||||
if(status == false) then
|
if(status == false) then
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
DNSSERVER_DEBUG_LVL,
|
DNSSERVER_DEBUG_LVL,
|
||||||
"DNSSERVER_Query: Call function failed: %s",
|
"DNSSERVER_Query: Call function failed: %s",
|
||||||
call_result)
|
call_result)
|
||||||
return false, call_result
|
return false, call_result
|
||||||
end
|
end
|
||||||
stdnse.print_debug(
|
stdnse.debug(
|
||||||
DNSSERVER_DEBUG_LVL,
|
DNSSERVER_DEBUG_LVL,
|
||||||
"DNSSERVER_Query: Returned successfully")
|
"DNSSERVER_Query: Returned successfully")
|
||||||
--dissect the reply
|
--dissect the reply
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
-- <code>
|
-- <code>
|
||||||
-- if not pcall(require, "openssl") then
|
-- if not pcall(require, "openssl") then
|
||||||
-- action = function(host, port)
|
-- action = function(host, port)
|
||||||
-- stdnse.print_debug(2, "Skipping \"%s\" because OpenSSL is missing.", id)
|
-- stdnse.debug2("Skipping \"%s\" because OpenSSL is missing.", id)
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
-- action = action or function(host, port)
|
-- action = action or function(host, port)
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ function socksHandshake(socket, version, hostname)
|
|||||||
local request_status = string.byte(response, 2)
|
local request_status = string.byte(response, 2)
|
||||||
local err = string.format("Unknown response (0x%02x)", request_status)
|
local err = string.format("Unknown response (0x%02x)", request_status)
|
||||||
if(request_status == 0x5a) then
|
if(request_status == 0x5a) then
|
||||||
stdnse.print_debug('Socks4: Received "Request Granted" from proxy server')
|
stdnse.debug1('Socks4: Received "Request Granted" from proxy server')
|
||||||
return true, socket
|
return true, socket
|
||||||
end
|
end
|
||||||
if(request_status == 0x5b) then
|
if(request_status == 0x5b) then
|
||||||
@@ -243,7 +243,7 @@ function socksHandshake(socket, version, hostname)
|
|||||||
elseif (request_status == 0x5d) then
|
elseif (request_status == 0x5d) then
|
||||||
err = "request failed because client program and identd report different user-ids"
|
err = "request failed because client program and identd report different user-ids"
|
||||||
end
|
end
|
||||||
stdnse.print_debug('Socks4: Received "%s" from proxy server', err)
|
stdnse.debug1('Socks4: Received "%s" from proxy server', err)
|
||||||
return false, err
|
return false, err
|
||||||
end
|
end
|
||||||
if version == 5 then
|
if version == 5 then
|
||||||
@@ -280,7 +280,7 @@ function socksHandshake(socket, version, hostname)
|
|||||||
local request_status = string.byte(z, 2)
|
local request_status = string.byte(z, 2)
|
||||||
err = string.format("Unknown response (0x%02x)", request_status)
|
err = string.format("Unknown response (0x%02x)", request_status)
|
||||||
if (request_status == 0x00) then
|
if (request_status == 0x00) then
|
||||||
stdnse.print_debug('Socks5: Received "Request Granted" from proxy server')
|
stdnse.debug1('Socks5: Received "Request Granted" from proxy server')
|
||||||
return true, socket
|
return true, socket
|
||||||
elseif(request_status == 0x01) then
|
elseif(request_status == 0x01) then
|
||||||
err = "General Failure"
|
err = "General Failure"
|
||||||
@@ -300,7 +300,7 @@ function socksHandshake(socket, version, hostname)
|
|||||||
err = "Address type not supported"
|
err = "Address type not supported"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
stdnse.print_debug('Socks5: Received "%s" from proxy server', err)
|
stdnse.debug1('Socks5: Received "%s" from proxy server', err)
|
||||||
return false, err
|
return false, err
|
||||||
end
|
end
|
||||||
return false, "Invalid SOCKS version"
|
return false, "Invalid SOCKS version"
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ StartTLS = {
|
|||||||
if status then
|
if status then
|
||||||
status,err = s:reconnect_ssl()
|
status,err = s:reconnect_ssl()
|
||||||
if not status then
|
if not status then
|
||||||
stdnse.print_debug(
|
stdnse.debug1("Could not establish SSL session after STARTTLS command.")
|
||||||
1, "Could not establish SSL session after STARTTLS command.")
|
|
||||||
s:close()
|
s:close()
|
||||||
return false, "Failed to connect to IMAP server"
|
return false, "Failed to connect to IMAP server"
|
||||||
else
|
else
|
||||||
@@ -217,8 +216,7 @@ StartTLS = {
|
|||||||
if status then
|
if status then
|
||||||
status,err = s:reconnect_ssl()
|
status,err = s:reconnect_ssl()
|
||||||
if not status then
|
if not status then
|
||||||
stdnse.print_debug(
|
stdnse.debug1("Could not establish SSL session after STARTTLS command.")
|
||||||
1,"Could not establish SSL session after STARTTLS command.")
|
|
||||||
s:close()
|
s:close()
|
||||||
return false, "Failed to connect to LDAP server"
|
return false, "Failed to connect to LDAP server"
|
||||||
else
|
else
|
||||||
@@ -268,8 +266,7 @@ StartTLS = {
|
|||||||
if status then
|
if status then
|
||||||
status,err = s:reconnect_ssl()
|
status,err = s:reconnect_ssl()
|
||||||
if not status then
|
if not status then
|
||||||
stdnse.print_debug(
|
stdnse.debug1("Could not establish SSL session after STARTTLS command.")
|
||||||
1, "Could not establish SSL session after STARTTLS command.")
|
|
||||||
s:close()
|
s:close()
|
||||||
return false, "Failed to connect to POP3 server"
|
return false, "Failed to connect to POP3 server"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -232,9 +232,9 @@ TestSuite = {
|
|||||||
failures = failures + 1
|
failures = failures + 1
|
||||||
end
|
end
|
||||||
if note then
|
if note then
|
||||||
stdnse.print_debug(lvl, "| \\_result: %s (%s)", result, note)
|
stdnse.debug(lvl, "| \\_result: %s (%s)", result, note)
|
||||||
else
|
else
|
||||||
stdnse.print_debug(lvl, "| \\_result: %s", result)
|
stdnse.debug(lvl, "| \\_result: %s", result)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
stdnse.debug1("|_%d of %d tests passed", passes, #self.tests)
|
stdnse.debug1("|_%d of %d tests passed", passes, #self.tests)
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ local setmetatable = setmetatable
|
|||||||
local string_format = string.format
|
local string_format = string.format
|
||||||
local string_upper = string.upper
|
local string_upper = string.upper
|
||||||
|
|
||||||
local print_debug = stdnse.print_debug
|
local debug = stdnse.debug
|
||||||
local compare_ip = ipOps.compare_ip
|
local compare_ip = ipOps.compare_ip
|
||||||
|
|
||||||
_ENV = stdnse.module("vulns", stdnse.seeall)
|
_ENV = stdnse.module("vulns", stdnse.seeall)
|
||||||
@@ -693,7 +693,7 @@ local l_update_id = function(fid_table, id_type, id, vuln_table)
|
|||||||
local target_key = l_get_host_port_key(vuln_table)
|
local target_key = l_get_host_port_key(vuln_table)
|
||||||
host_info = host_info..string_format(" %s)", target_key)
|
host_info = host_info..string_format(" %s)", target_key)
|
||||||
|
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Updating VULNS.FILTERS_IDS{} with '%s' ID:%s:%s %s",
|
"vulns.lua: Updating VULNS.FILTERS_IDS{} with '%s' ID:%s:%s %s",
|
||||||
vuln_table.title, id_type, id, host_info)
|
vuln_table.title, id_type, id, host_info)
|
||||||
push_table.HOSTS = push_table.HOSTS or {}
|
push_table.HOSTS = push_table.HOSTS or {}
|
||||||
@@ -702,7 +702,7 @@ local l_update_id = function(fid_table, id_type, id, vuln_table)
|
|||||||
push_table.HOSTS[vuln_table.host.ip][target_key] = vuln_table
|
push_table.HOSTS[vuln_table.host.ip][target_key] = vuln_table
|
||||||
return push_table.HOSTS[vuln_table.host.ip][target_key]
|
return push_table.HOSTS[vuln_table.host.ip][target_key]
|
||||||
else
|
else
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Updating VULNS.FILTERS_IDS{} with '%s' ID:%s:%s",
|
"vulns.lua: Updating VULNS.FILTERS_IDS{} with '%s' ID:%s:%s",
|
||||||
vuln_table.title, id_type, id)
|
vuln_table.title, id_type, id)
|
||||||
push_table.NETWORKS = push_table.NETWORKS or {}
|
push_table.NETWORKS = push_table.NETWORKS or {}
|
||||||
@@ -1024,7 +1024,7 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
-- variable false.
|
-- variable false.
|
||||||
local id_not_found = true
|
local id_not_found = true
|
||||||
|
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Searching VULNS.FILTERS_IDS[%d] for '%s' ID:%s:%s",
|
"vulns.lua: Searching VULNS.FILTERS_IDS[%d] for '%s' ID:%s:%s",
|
||||||
fid, vuln_table.title, id_type, id)
|
fid, vuln_table.title, id_type, id)
|
||||||
|
|
||||||
@@ -1040,7 +1040,7 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
local tmp_vuln = old_vuln_list[target_key]
|
local tmp_vuln = old_vuln_list[target_key]
|
||||||
|
|
||||||
if tmp_vuln then
|
if tmp_vuln then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: VULNS.FILTERS_IDS[%d] '%s' ID:%s:%s%s: FOUND",
|
"vulns.lua: VULNS.FILTERS_IDS[%d] '%s' ID:%s:%s%s: FOUND",
|
||||||
fid, vuln_table.title, id_type, id, host_info)
|
fid, vuln_table.title, id_type, id, host_info)
|
||||||
if old_entries[#old_entries] ~= tmp_vuln then
|
if old_entries[#old_entries] ~= tmp_vuln then
|
||||||
@@ -1061,7 +1061,7 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
-- in order to make it later reference the saved vulnerability
|
-- in order to make it later reference the saved vulnerability
|
||||||
-- entry (vulnerability table in the registry).
|
-- entry (vulnerability table in the registry).
|
||||||
if id_not_found then
|
if id_not_found then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: VULNS.FILTERS_IDS[%d] '%s' ID:%s:%s%s: NOT FOUND",
|
"vulns.lua: VULNS.FILTERS_IDS[%d] '%s' ID:%s:%s%s: NOT FOUND",
|
||||||
fid, vuln_table.title, id_type, id, host_info)
|
fid, vuln_table.title, id_type, id, host_info)
|
||||||
NEW_IDS[id_type] = {['id'] = id, ['fid'] = fid}
|
NEW_IDS[id_type] = {['id'] = id, ['fid'] = fid}
|
||||||
@@ -1078,17 +1078,17 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
-- Old entry, update the vulnerability information
|
-- Old entry, update the vulnerability information
|
||||||
if ids_found > 0 then
|
if ids_found > 0 then
|
||||||
if #old_entries > 1 then
|
if #old_entries > 1 then
|
||||||
print_debug(3, "vulns.lua: Warning at vuln '%s': "..
|
debug(3, "vulns.lua: Warning at vuln '%s': "..
|
||||||
"please check the vulnerability IDs field.", vuln_table.title)
|
"please check the vulnerability IDs field.", vuln_table.title)
|
||||||
for _, old_vuln in ipairs(old_entries) do
|
for _, old_vuln in ipairs(old_entries) do
|
||||||
print_debug(3, "vulns: Warning at vuln '%s': "..
|
debug(3, "vulns: Warning at vuln '%s': "..
|
||||||
"please check the vulnerability IDs field.", old_vuln.title)
|
"please check the vulnerability IDs field.", old_vuln.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print_debug(3,
|
debug(3,
|
||||||
"vulns.lua: Updating vulnerability entry: '%s'%s",
|
"vulns.lua: Updating vulnerability entry: '%s'%s",
|
||||||
vuln_table.title, host_info)
|
vuln_table.title, host_info)
|
||||||
print_debug(3,
|
debug(3,
|
||||||
"vulns.lua: Vulnerability '%s' referenced by %d IDs from %d (%s)",
|
"vulns.lua: Vulnerability '%s' referenced by %d IDs from %d (%s)",
|
||||||
vuln_table.title, ids_found, ids_count,
|
vuln_table.title, ids_found, ids_count,
|
||||||
ids_found < ids_count and "Bad" or "Good")
|
ids_found < ids_count and "Bad" or "Good")
|
||||||
@@ -1099,7 +1099,7 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
vuln_ref = l_update_vuln(vulndb, old_entries[1], vuln_table)
|
vuln_ref = l_update_vuln(vulndb, old_entries[1], vuln_table)
|
||||||
else
|
else
|
||||||
-- New vulnerability entry
|
-- New vulnerability entry
|
||||||
print_debug(3,
|
debug(3,
|
||||||
"vulns.lua: Adding new vulnerability entry: '%s'%s",
|
"vulns.lua: Adding new vulnerability entry: '%s'%s",
|
||||||
vuln_table.title, host_info)
|
vuln_table.title, host_info)
|
||||||
|
|
||||||
@@ -1116,7 +1116,7 @@ local l_add = function(vulndb, vuln_table)
|
|||||||
if new_entry['fid'] == fid then
|
if new_entry['fid'] == fid then
|
||||||
-- Add the ID couple (id_type, id) to the
|
-- Add the ID couple (id_type, id) to the
|
||||||
-- VULNS.FILTERS_IDS[fid] table that lacks them
|
-- VULNS.FILTERS_IDS[fid] table that lacks them
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Updating VULNS.FILTERS_IDS[%d]", new_entry.fid)
|
"vulns.lua: Updating VULNS.FILTERS_IDS[%d]", new_entry.fid)
|
||||||
l_update_id(vulndb.FILTERS_IDS[new_entry['fid']],
|
l_update_id(vulndb.FILTERS_IDS[new_entry['fid']],
|
||||||
id_type, new_entry.id, vuln_ref)
|
id_type, new_entry.id, vuln_ref)
|
||||||
@@ -1217,13 +1217,13 @@ local l_find_by_id = function(fid_table, vuln_id_type, id)
|
|||||||
|
|
||||||
local db = l_lookup_id(fid_table, vuln_id_type, id)
|
local db = l_lookup_id(fid_table, vuln_id_type, id)
|
||||||
if db then
|
if db then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Lookup VULNS.FILTERS_IDS{} for ID:%s:%s: FOUND",
|
"vulns.lua: Lookup VULNS.FILTERS_IDS{} for ID:%s:%s: FOUND",
|
||||||
vuln_id_type, id)
|
vuln_id_type, id)
|
||||||
if db.ENTRIES and db.ENTRIES.HOSTS and next(db.ENTRIES.HOSTS) then
|
if db.ENTRIES and db.ENTRIES.HOSTS and next(db.ENTRIES.HOSTS) then
|
||||||
for _, vuln_list in pairs(db.ENTRIES.HOSTS) do
|
for _, vuln_list in pairs(db.ENTRIES.HOSTS) do
|
||||||
for _, vuln_table in pairs(vuln_list) do
|
for _, vuln_table in pairs(vuln_list) do
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s' (host:%s): FOUND",
|
"vulns.lua: Vulnerability '%s' (host:%s): FOUND",
|
||||||
vuln_table.title, vuln_table.host.ip)
|
vuln_table.title, vuln_table.host.ip)
|
||||||
out[#out + 1] = vuln_table
|
out[#out + 1] = vuln_table
|
||||||
@@ -1233,7 +1233,7 @@ local l_find_by_id = function(fid_table, vuln_id_type, id)
|
|||||||
|
|
||||||
if db.ENTRIES.NETWORKS and next(db.ENTRIES.NETWORKS) then
|
if db.ENTRIES.NETWORKS and next(db.ENTRIES.NETWORKS) then
|
||||||
for _, vuln_table in ipairs(db.ENTRIES.NETWOKRS) do
|
for _, vuln_table in ipairs(db.ENTRIES.NETWOKRS) do
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
||||||
out[#out + 1] = vuln_table
|
out[#out + 1] = vuln_table
|
||||||
end
|
end
|
||||||
@@ -1262,7 +1262,7 @@ local l_find_vulns = function(fid_table, entries, filter)
|
|||||||
for host_ip, vulns_list in pairs(entries.HOSTS) do
|
for host_ip, vulns_list in pairs(entries.HOSTS) do
|
||||||
for _, vuln_table in ipairs(vulns_list) do
|
for _, vuln_table in ipairs(vulns_list) do
|
||||||
if check_vuln(vuln_table, fid_table, filter) then
|
if check_vuln(vuln_table, fid_table, filter) then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s' (host: %s): FOUND",
|
"vulns.lua: Vulnerability '%s' (host: %s): FOUND",
|
||||||
vuln_table.title, vuln_table.host.ip)
|
vuln_table.title, vuln_table.host.ip)
|
||||||
out[#out + 1] = vuln_table
|
out[#out + 1] = vuln_table
|
||||||
@@ -1272,7 +1272,7 @@ local l_find_vulns = function(fid_table, entries, filter)
|
|||||||
|
|
||||||
for _, vuln_table in ipairs(entries.NETWORKS) do
|
for _, vuln_table in ipairs(entries.NETWORKS) do
|
||||||
if check_vuln(vuln_table, fid_table, filter) then
|
if check_vuln(vuln_table, fid_table, filter) then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
||||||
out[#out + 1] = vuln_table
|
out[#out + 1] = vuln_table
|
||||||
end
|
end
|
||||||
@@ -1329,7 +1329,7 @@ local l_make_output = function(fid_table, entries, filter)
|
|||||||
|
|
||||||
for _, vuln_table in ipairs(vulns_list) do
|
for _, vuln_table in ipairs(vulns_list) do
|
||||||
if check_vuln(vuln_table, fid_table, filter) then
|
if check_vuln(vuln_table, fid_table, filter) then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s' (host: %s): FOUND",
|
"vulns.lua: Vulnerability '%s' (host: %s): FOUND",
|
||||||
vuln_table.title, vuln_table.host.ip)
|
vuln_table.title, vuln_table.host.ip)
|
||||||
|
|
||||||
@@ -1348,7 +1348,7 @@ local l_make_output = function(fid_table, entries, filter)
|
|||||||
|
|
||||||
for _, vuln_table in ipairs(entries.NETWORKS) do
|
for _, vuln_table in ipairs(entries.NETWORKS) do
|
||||||
if check_vuln(vuln_table, fid_table, filter) then
|
if check_vuln(vuln_table, fid_table, filter) then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
"vulns.lua: Vulnerability '%s': FOUND", vuln_table.title)
|
||||||
if bit.band(vuln_table.state, STATE.NOT_VULN) == 0 then
|
if bit.band(vuln_table.state, STATE.NOT_VULN) == 0 then
|
||||||
networks.vulns[#networks.vulns + 1] = vuln_table
|
networks.vulns[#networks.vulns + 1] = vuln_table
|
||||||
@@ -1443,7 +1443,7 @@ end
|
|||||||
--- Find vulnerabilities by ID wrapper
|
--- Find vulnerabilities by ID wrapper
|
||||||
local registry_find_by_id = function(fid, vuln_id_type, id)
|
local registry_find_by_id = function(fid, vuln_id_type, id)
|
||||||
if registry_lookup_id(fid, vuln_id_type, id) then
|
if registry_lookup_id(fid, vuln_id_type, id) then
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
||||||
fid)
|
fid)
|
||||||
|
|
||||||
@@ -1458,7 +1458,7 @@ local registry_find_vulns = function(fid, selection_filter)
|
|||||||
if fid_table and next(fid_table) then
|
if fid_table and next(fid_table) then
|
||||||
-- Normalize the 'selection_filter' fields
|
-- Normalize the 'selection_filter' fields
|
||||||
local filter = l_normalize_selection_filter(selection_filter)
|
local filter = l_normalize_selection_filter(selection_filter)
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
||||||
fid)
|
fid)
|
||||||
|
|
||||||
@@ -1472,7 +1472,7 @@ local registry_make_output = function(fid, selection_filter)
|
|||||||
|
|
||||||
if fid_table and next(fid_table) then
|
if fid_table and next(fid_table) then
|
||||||
local filter = l_normalize_selection_filter(selection_filter)
|
local filter = l_normalize_selection_filter(selection_filter)
|
||||||
print_debug(5,
|
debug(5,
|
||||||
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
"vulns.lua: Lookup VULNS.FILTERS_IDS[%d] for vulnerabilities",
|
||||||
fid)
|
fid)
|
||||||
|
|
||||||
@@ -1495,7 +1495,7 @@ local registry_add_vulns = function(script_name, ...)
|
|||||||
if validate_vuln(vuln_table) then
|
if validate_vuln(vuln_table) then
|
||||||
normalize_vuln_info(vuln_table)
|
normalize_vuln_info(vuln_table)
|
||||||
vuln_table.script_name = script_name
|
vuln_table.script_name = script_name
|
||||||
print_debug(3,
|
debug(3,
|
||||||
"vulns.lua: *** New Vuln '%s' %sreported by '%s' script ***",
|
"vulns.lua: *** New Vuln '%s' %sreported by '%s' script ***",
|
||||||
vuln_table.title,
|
vuln_table.title,
|
||||||
vuln_table.host and
|
vuln_table.host and
|
||||||
@@ -1799,7 +1799,7 @@ local format_vuln_base = function(vuln_table, showall)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not showall and bit.band(vuln_table.state, STATE.NOT_VULN) ~= 0 then
|
if not showall and bit.band(vuln_table.state, STATE.NOT_VULN) ~= 0 then
|
||||||
print_debug(2, "vulns.lua: vulnerability '%s'%s: %s.",
|
debug(2, "vulns.lua: vulnerability '%s'%s: %s.",
|
||||||
vuln_table.title,
|
vuln_table.title,
|
||||||
vuln_table.host and
|
vuln_table.host and
|
||||||
string_format(" (host:%s%s)", vuln_table.host.ip,
|
string_format(" (host:%s%s)", vuln_table.host.ip,
|
||||||
@@ -2092,7 +2092,7 @@ save_reports = function(filter_callback)
|
|||||||
|
|
||||||
local fid = register_filter(VULNS.FILTERS_FUNCS, filter_callback)
|
local fid = register_filter(VULNS.FILTERS_FUNCS, filter_callback)
|
||||||
VULNS.FILTERS_IDS[fid] = {}
|
VULNS.FILTERS_IDS[fid] = {}
|
||||||
print_debug(3,
|
debug(3,
|
||||||
"vulns.lua: New Filter table: VULNS.FILTERS_IDS[%d]", fid)
|
"vulns.lua: New Filter table: VULNS.FILTERS_IDS[%d]", fid)
|
||||||
return fid
|
return fid
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user