log errors into framework.log

bug/bundler_fix
Christian Mehlmauer 2014-12-29 00:20:26 +01:00
parent 01daadcc49
commit 7b52bcb657
No known key found for this signature in database
GPG Key ID: BCFF4FA966BC32C7
3 changed files with 21 additions and 10 deletions

View File

@ -151,16 +151,18 @@ protected
rescue ::Exception => e
mod.error = e
mod.print_error("Auxiliary failed: #{e.class} #{e}")
elog("Auxiliary failed: #{e.class} #{e}", 'core', LEV_0)
if(e.class.to_s != 'Msf::OptionValidateError')
mod.print_error("Call stack:")
e.backtrace.each do |line|
break if line =~ /lib.msf.base.simple.auxiliary.rb/
mod.print_error(" #{line}")
end
end
elog("Auxiliary failed: #{e.class} #{e}", 'core', LEV_0)
elog("Call stack:\n#{$@.join("\n")}", 'core', LEV_0)
else
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_3)
end
mod.cleanup
@ -182,4 +184,3 @@ end
end
end

View File

@ -147,8 +147,18 @@ module Exploit
exploit.error = e
exploit.print_error("Exploit failed: #{e}")
elog("Exploit failed (#{exploit.refname}): #{e}", 'core', LEV_0)
if(e.class.to_s != 'Msf::OptionValidateError')
mod.print_error("Call stack:")
e.backtrace.each do |line|
break if line =~ /lib.msf.base.simple.exploit.rb/
mod.print_error(" #{line}")
end
elog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_0)
else
dlog("Call stack:\n#{e.backtrace.join("\n")}", 'core', LEV_3)
end
end
return driver.session if driver
nil
@ -199,4 +209,3 @@ end
end
end

View File

@ -121,16 +121,18 @@ protected
rescue ::Exception => e
mod.error = e
mod.print_error("Post failed: #{e.class} #{e}")
elog("Post failed: #{e.class} #{e}", 'core', LEV_0)
if(e.class.to_s != 'Msf::OptionValidateError')
mod.print_error("Call stack:")
e.backtrace.each do |line|
break if line =~ /lib.msf.base.simple.post.rb/
mod.print_error(" #{line}")
end
end
elog("Post failed: #{e.class} #{e}", 'core', LEV_0)
elog("Call stack:\n#{$@.join("\n")}", 'core', LEV_0)
else
dlog("Call stack:\n#{$@.join("\n")}", 'core', LEV_3)
end
mod.cleanup
@ -154,4 +156,3 @@ end
end
end