1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

o Improved the mysql library to handle multiple columns with the same name,

added a formatResultset function to format a query response to a table
  suitable for script output. [Patrik Karlsson]
This commit is contained in:
patrik
2012-05-19 12:23:41 +00:00
parent 660cb42825
commit 425ced35ab
7 changed files with 69 additions and 36 deletions

View File

@@ -86,7 +86,7 @@ require 'shortport'
require 'mysql'
portrule = shortport.port_or_service(3306, "mysql")
local TEMPLATE_NAME = ""
local TEMPLATE_NAME, ADMIN_ACCOUNTS = "", ""
local function loadAuditRulebase( filename )
@@ -103,6 +103,7 @@ local function loadAuditRulebase( filename )
file()
TEMPLATE_NAME = getfenv(file)["TEMPLATE_NAME"]
ADMIN_ACCOUNTS = getfenv(file)["ADMIN_ACCOUNTS"]
return true, rules
end
@@ -121,7 +122,7 @@ action = function( host, port )
end
local status, tests = loadAuditRulebase( filename )
if( not(status) ) then return rules end
if( not(status) ) then return tests end
local socket = nmap.new_socket()
status = socket:connect(host, port)
@@ -166,7 +167,10 @@ action = function( host, port )
socket:close()
results.name = TEMPLATE_NAME
table.insert(results, {"", ("The audit was performed using the db-account: %s"):format(username)})
table.insert(results, "")
table.insert(results, {name = "Additional information", ("The audit was performed using the db-account: %s"):format(username),
("The following admin accounts were excluded from the audit: %s"):format(stdnse.strjoin(",", ADMIN_ACCOUNTS))
})
return stdnse.format_output(true, { results })
end