1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Re-indent some scripts. Whitespace-only commit

https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
dmiller
2014-01-31 13:02:29 +00:00
parent 64fb5b3482
commit d36c08dcf5
137 changed files with 3977 additions and 3977 deletions

View File

@@ -31,35 +31,35 @@ portrule = shortport.port_or_service(3306, "mysql")
action = function( host, port )
local socket = nmap.new_socket()
local result = {}
local users = {"", "root"}
local socket = nmap.new_socket()
local result = {}
local users = {"", "root"}
-- set a reasonable timeout value
socket:set_timeout(5000)
-- set a reasonable timeout value
socket:set_timeout(5000)
for _, v in ipairs( users ) do
local status, response = socket:connect(host, port)
if( not(status) ) then return " \n ERROR: Failed to connect to mysql server" end
for _, v in ipairs( users ) do
local status, response = socket:connect(host, port)
if( not(status) ) then return " \n ERROR: Failed to connect to mysql server" end
status, response = mysql.receiveGreeting( socket )
if ( not(status) ) then
stdnse.print_debug(3, SCRIPT_NAME)
socket:close()
return response
end
status, response = mysql.receiveGreeting( socket )
if ( not(status) ) then
stdnse.print_debug(3, SCRIPT_NAME)
socket:close()
return response
end
status, response = mysql.loginRequest( socket, { authversion = "post41", charset = response.charset }, v, nil, response.salt )
if response.errorcode == 0 then
table.insert(result, string.format("%s account has empty password", ( v=="" and "anonymous" or v ) ) )
if nmap.registry.mysqlusers == nil then
nmap.registry.mysqlusers = {}
end
nmap.registry.mysqlusers[v=="" and "anonymous" or v] = ""
end
socket:close()
end
status, response = mysql.loginRequest( socket, { authversion = "post41", charset = response.charset }, v, nil, response.salt )
if response.errorcode == 0 then
table.insert(result, string.format("%s account has empty password", ( v=="" and "anonymous" or v ) ) )
if nmap.registry.mysqlusers == nil then
nmap.registry.mysqlusers = {}
end
nmap.registry.mysqlusers[v=="" and "anonymous" or v] = ""
end
socket:close()
end
return stdnse.format_output(true, result)
return stdnse.format_output(true, result)
end