1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-12 10:49:02 +00:00

Fixes script output

This commit is contained in:
paulino
2014-10-19 20:29:10 +00:00
parent c372f9823b
commit 92dc4564db

View File

@@ -41,11 +41,9 @@ action = function(host, port)
local _, http_status, _ = http.identify_404(host,port) local _, http_status, _ = http.identify_404(host,port)
if ( http_status == 200 ) then if ( http_status == 200 ) then
stdnse.debug1("Exiting due to ambiguous response from web server on %s:%s. All URIs return status 200.", host.ip, port.number) stdnse.debug1("Exiting due to ambiguous response from web server on %s:%s. All URIs return status 200.", host.ip, port.number)
return false return
end end
local output = stdnse.output_table() local output = stdnse.output_table()
output.title = "Avaya IP Office User Listing"
output.users = {}
local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port) local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port)
local open_session = http.get(host.ip, port, "/system/user/scn_user_list") local open_session = http.get(host.ip, port, "/system/user/scn_user_list")
if open_session and open_session.status == 200 then if open_session and open_session.status == 200 then
@@ -54,7 +52,9 @@ action = function(host, port)
stdnse.debug(1, "Pattern not found. Exiting") stdnse.debug(1, "Pattern not found. Exiting")
return return
end end
output.data_source = source output.title = "Avaya IP Office User Listing"
output.users = {}
output.data_source = source
--match the string data_source and print it //Avaya IP Office 7.0(27) --match the string data_source and print it //Avaya IP Office 7.0(27)
for user_block in string.gmatch(open_session.body, "<user>(.-)</user>") do for user_block in string.gmatch(open_session.body, "<user>(.-)</user>") do
stdnse.debug(1, "User block found!") stdnse.debug(1, "User block found!")
@@ -70,6 +70,7 @@ action = function(host, port)
table.insert(output.users, user) table.insert(output.users, user)
end end
end end
return output
end end
return output return
end end