Store the last generated error
git-svn-id: file:///home/svn/framework3/trunk@8927 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
52da4d13bf
commit
ee2e796a19
|
@ -1,4 +1,3 @@
|
|||
module Msf
|
||||
module Simple
|
||||
|
||||
###
|
||||
|
@ -93,10 +92,12 @@ protected
|
|||
mod.framework.events.on_module_run(mod)
|
||||
mod.run
|
||||
rescue ::Interrupt
|
||||
mod.error = $!
|
||||
mod.print_error("Auxiliary interrupted by the console user")
|
||||
mod.cleanup
|
||||
return
|
||||
rescue ::Exception => e
|
||||
mod.error = e
|
||||
mod.print_error("Auxiliary failed: #{e.class} #{e}")
|
||||
if(e.class.to_s != 'Msf::OptionValidateError')
|
||||
mod.print_error("Call stack:")
|
||||
|
|
|
@ -130,8 +130,10 @@ module Exploit
|
|||
return session
|
||||
|
||||
rescue ::Interrupt
|
||||
exploit.error = $!
|
||||
raise $!
|
||||
rescue ::Exception => e
|
||||
exploit.error = e
|
||||
exploit.print_error("Exploit failed: #{e}")
|
||||
elog("Exploit failed (#{exploit.refname}): #{e}", 'core', LEV_0)
|
||||
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
||||
|
|
|
@ -600,6 +600,11 @@ class Module
|
|||
#
|
||||
attr_accessor :module_store
|
||||
|
||||
#
|
||||
# The last exception to occur using this module
|
||||
#
|
||||
attr_accessor :error
|
||||
|
||||
protected
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue