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
|
module Simple
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -93,10 +92,12 @@ protected
|
||||||
mod.framework.events.on_module_run(mod)
|
mod.framework.events.on_module_run(mod)
|
||||||
mod.run
|
mod.run
|
||||||
rescue ::Interrupt
|
rescue ::Interrupt
|
||||||
|
mod.error = $!
|
||||||
mod.print_error("Auxiliary interrupted by the console user")
|
mod.print_error("Auxiliary interrupted by the console user")
|
||||||
mod.cleanup
|
mod.cleanup
|
||||||
return
|
return
|
||||||
rescue ::Exception => e
|
rescue ::Exception => e
|
||||||
|
mod.error = e
|
||||||
mod.print_error("Auxiliary failed: #{e.class} #{e}")
|
mod.print_error("Auxiliary failed: #{e.class} #{e}")
|
||||||
if(e.class.to_s != 'Msf::OptionValidateError')
|
if(e.class.to_s != 'Msf::OptionValidateError')
|
||||||
mod.print_error("Call stack:")
|
mod.print_error("Call stack:")
|
||||||
|
|
|
@ -130,8 +130,10 @@ module Exploit
|
||||||
return session
|
return session
|
||||||
|
|
||||||
rescue ::Interrupt
|
rescue ::Interrupt
|
||||||
|
exploit.error = $!
|
||||||
raise $!
|
raise $!
|
||||||
rescue ::Exception => e
|
rescue ::Exception => e
|
||||||
|
exploit.error = e
|
||||||
exploit.print_error("Exploit failed: #{e}")
|
exploit.print_error("Exploit failed: #{e}")
|
||||||
elog("Exploit failed (#{exploit.refname}): #{e}", 'core', LEV_0)
|
elog("Exploit failed (#{exploit.refname}): #{e}", 'core', LEV_0)
|
||||||
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
|
||||||
|
|
|
@ -600,6 +600,11 @@ class Module
|
||||||
#
|
#
|
||||||
attr_accessor :module_store
|
attr_accessor :module_store
|
||||||
|
|
||||||
|
#
|
||||||
|
# The last exception to occur using this module
|
||||||
|
#
|
||||||
|
attr_accessor :error
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue