Log the exploit name when the module raises an exception, helps track down bugs during automation

git-svn-id: file:///home/svn/framework3/trunk@7529 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-11-16 15:08:58 +00:00
parent 7fb9c4a791
commit ba5da501bf
3 changed files with 28 additions and 25 deletions

View File

@ -129,7 +129,7 @@ module Exploit
raise $!
rescue ::Exception => e
exploit.print_error("Exploit failed: #{e}")
elog("Exploit failed: #{e}", 'core', LEV_0)
elog("Exploit failed (#{exploit.refname}): #{e}", 'core', LEV_0)
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
return
end
@ -178,3 +178,4 @@ end
end
end

View File

@ -184,7 +184,7 @@ protected
rescue ::Exception
exploit.print_error("Exploit failed: #{$!}")
elog("Exploit failed: #{$!}", 'core', LEV_0)
elog("Exploit failed (#{exploit.refname}): #{$!}", 'core', LEV_0)
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_3)
payload.stop_handler
@ -209,3 +209,4 @@ protected
end
end

View File

@ -136,7 +136,7 @@ class Exploit
rescue ::Interrupt
raise $!
rescue ::Exception => e
print_error("Exploit failed: #{e.class} #{e}")
print_error("Exploit failed (#{mod.refname}): #{e.class} #{e}")
if(e.class.to_s != 'Msf::OptionValidateError')
print_error("Call stack:")
e.backtrace.each do |line|
@ -215,3 +215,4 @@ class Exploit
end
end end end end