From 1468a904a779f250ef6dce98d84966507988f9b9 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Wed, 20 Jun 2012 13:34:31 -0500 Subject: [PATCH] More error cleanup --- lib/msf/core/exploit_driver.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/exploit_driver.rb b/lib/msf/core/exploit_driver.rb index 1e31eb75d1..5c1eb79ed1 100644 --- a/lib/msf/core/exploit_driver.rb +++ b/lib/msf/core/exploit_driver.rb @@ -211,7 +211,10 @@ protected end # Build a user-friendly error message - msg = "#{e.class} #{e}" + msg = "#{e}" + unless e.class == Msf::Exploit::Failed + msg = "#{e.class} #{e}" + end exploit.error = e @@ -233,13 +236,13 @@ protected when Rex::ConnectionError exploit.fail_reason = Msf::Exploit::Failure::Unreachable - exploit.print_error("Exploit failed: [#{exploit.fail_reason}] #{msg}") + exploit.print_error("Exploit failed [#{exploit.fail_reason}]: #{msg}") elog("Exploit failed (#{exploit.refname}): #{msg}", 'core', LEV_0) dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3) when Timeout::Error exploit.fail_reason = Msf::Exploit::Failure::TimeoutExpired - exploit.print_error("Exploit failed: [#{exploit.fail_reason}] #{msg}") + exploit.print_error("Exploit failed [#{exploit.fail_reason}]: #{msg}") elog("Exploit failed (#{exploit.refname}): #{msg}", 'core', LEV_0) dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3) else @@ -268,7 +271,7 @@ protected if exploit.fail_reason == Msf::Exploit::Failure::Unknown exploit.print_error("Exploit failed: #{msg}") else - exploit.print_error("Exploit failed: [#{exploit.fail_reason}] #{msg}") + exploit.print_error("Exploit failed [#{exploit.fail_reason}]: #{msg}") end elog("Exploit failed (#{exploit.refname}): #{msg}", 'core', LEV_0)