fix nexpose plugin to handle exception on scan

launching a nexpose scan from the plugin no longer results
in a stack trace, it instead displays the nexpose error

MS-289
bug/bundler_fix
David Maloney 2016-10-31 13:54:05 -05:00
parent ac0984e8dd
commit 4285e4ce15
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 8 additions and 1 deletions

View File

@ -520,7 +520,14 @@ class Plugin::Nexpose < Msf::Plugin
print_status(" >> Created temporary report configuration ##{report.config_id}") if opt_verbose
# Run the scan
res = site.scanSite()
begin
res = site.scanSite()
rescue Nexpose::APIError => e
nexpose_error_message = e.message
nexpose_error_message.gsub!(/NexposeAPI: Action failed: /, '')
print_error "#{nexpose_error_message}"
return
end
sid = res[:scan_id]
print_status(" >> Scan has been launched with ID ##{sid}") if opt_verbose