diff --git a/lib/nessus/nessus-xmlrpc.rb b/lib/nessus/nessus-xmlrpc.rb index 58e48e15c0..075e951b00 100644 --- a/lib/nessus/nessus-xmlrpc.rb +++ b/lib/nessus/nessus-xmlrpc.rb @@ -181,12 +181,7 @@ module Nessus request = Net::HTTP::Get.new("/scans/#{scan_id}/export/#{file_id}/status") request.add_field("X-Cookie", @token) res = @connection.request(request) - if res.code == "200" - return "ready" - else - res = JSON.parse(res.body) - return res - end + return res.code, JSON.parse(res.body) end def policy_delete(policy_id) diff --git a/modules/exploits/windows/antivirus/symantec_workspace_streaming_exec.rb b/modules/exploits/windows/antivirus/symantec_workspace_streaming_exec.rb index 6cadfaee79..d215a55d1a 100644 --- a/modules/exploits/windows/antivirus/symantec_workspace_streaming_exec.rb +++ b/modules/exploits/windows/antivirus/symantec_workspace_streaming_exec.rb @@ -22,7 +22,7 @@ class Metasploit3 < Msf::Exploit::Remote as_agent.exe service, which allows for uploading arbitrary files under the server root. This module abuses the auto deploy feature in the JBoss as_ste.exe instance in order to achieve remote code execution. This module has been tested successfully on Symantec - Workspace Streaming 6.1 SP8 and Windows 2003 SP2, and reported to affect 7.5.0.x. + Workspace Streaming 6.1 SP8 and Windows 2003 SP2, and reported to affect 7.5.0.x. Abused services listen on a single-machine deployment and also in the backend role in a multiple-machine deployment. }, diff --git a/plugins/nessus.rb b/plugins/nessus.rb index 289a6237ac..9402dc9613 100644 --- a/plugins/nessus.rb +++ b/plugins/nessus.rb @@ -10,6 +10,10 @@ module Msf "Nessus" end + def desc + "Nessus Bridge for Metasploit" + end + def desc "Nessus Bridge for Metasploit" end @@ -451,7 +455,7 @@ module Msf print_status("Returns a list of information about the scan or policy templates..") return end - if type.in?(['scan', 'policy']) + if type.downcase.in?(['scan', 'policy']) list=@n.list_template(type) else print_error("Only scan and policy are valid templates") @@ -1184,7 +1188,7 @@ module Msf when 2 scan_id = args[0] category = args[1] - if category.in?(['info', 'hosts', 'vulnerabilities', 'history']) + if category.downcase.in?(['info', 'hosts', 'vulnerabilities', 'history']) category = args[1] else print_error("Invalid category. The available categories are info, hosts, vulnerabilities, and history") @@ -1261,7 +1265,7 @@ module Msf case args.length when 2 scan_id = args[0] - format = args[1].downcase + format = args[1] else print_status("Usage: ") print_status("nessus_scan_export ") @@ -1269,15 +1273,19 @@ module Msf print_status("Use nessus_scan_list to list all available scans with their corresponding scan IDs") return end - if format.in?(['nessus','html','pdf','csv','db']) + if format.downcase.in?(['nessus','html','pdf','csv','db']) export = @n.scan_export(scan_id, format) if export["file"] file_id = export["file"] print_good("The export file ID for scan ID #{scan_id} is #{file_id}") print_status("Checking export status...") - status = @n.scan_export_status(scan_id, file_id) - if status == "ready" - print_good("The status of scan ID #{scan_id} export is ready") + code, body = @n.scan_export_status(scan_id, file_id) + if code == "200" + if body =~ /ready/ + print_good("The status of scan ID #{scan_id} export is ready") + else + print_status("Scan result not ready for download. Please check again after a few seconds") + end else print_error("There was some problem in exporting the scan. The error message is #{status}") end @@ -1302,12 +1310,7 @@ module Msf when 2 scan_id = args[0] file_id = args[1] - status = @n.scan_export_status(scan_id, file_id) - if status == "ready" - print_status("The status of scan ID #{scan_id} export is ready") - else - print_error("There was some problem in exporting the scan. The error message is #{status}") - end + check_export_status(scan_id, file_id) else print_status("Usage: ") print_status("nessus_scan_export_status ") @@ -1315,6 +1318,25 @@ module Msf end end + def check_export_status(scan_id, file_id, attempt = 0) + code, body = @n.scan_export_status(scan_id, file_id) + if code == "200" + if body.to_s =~ /ready/ + print_status("The status of scan ID #{scan_id} export is ready") + else + if attempt < 3 + print_status("Scan result not ready for download. Checking again...") + select(nil, nil, nil, 1) + attempt = attempt + 1 + print_error("Current value of attempt is #{attempt}") + check_export_status(scan_id, file_id, attempt) + end + end + else + print_error("There was some problem in exporting the scan. The error message is #{body}") + end + end + def cmd_nessus_plugin_list(*args) if args[0] == "-h" print_status("nessus_plugin_list ")