Skip to content

Commit 3fc5710

Browse files
committed
Dont rescue Exception
1 parent 3a41bd9 commit 3fc5710

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

lib/msf/base/sessions/scriptable.rb

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,13 @@ def execute_script(script_name, *args)
100100
# session
101101
local_exploit_opts = local_exploit_opts.merge(opts)
102102

103-
# try to run this local exploit, which is likely to be exception prone
104-
begin
105-
new_session = mod.exploit_simple(
106-
'Payload' => local_exploit_opts.delete('payload'),
107-
'Target' => local_exploit_opts.delete('target'),
108-
'LocalInput' => self.user_input,
109-
'LocalOutput' => self.user_output,
110-
'Options' => local_exploit_opts
111-
)
112-
rescue ::Interrupt
113-
raise $!
114-
rescue ::Exception => e
115-
print_error("Local exploit exception (#{mod.refname}): " +
116-
"#{e.class} #{e}")
117-
if(e.class.to_s != 'Msf::OptionValidateError')
118-
print_error("Call stack:")
119-
e.backtrace.each do |line|
120-
break if line =~ /lib.msf.base.simple/
121-
print_error(" #{line}")
122-
end
123-
end
124-
end # end rescue
103+
new_session = mod.exploit_simple(
104+
'Payload' => local_exploit_opts.delete('payload'),
105+
'Target' => local_exploit_opts.delete('target'),
106+
'LocalInput' => self.user_input,
107+
'LocalOutput' => self.user_output,
108+
'Options' => local_exploit_opts
109+
)
125110

126111
end # end if local
127112
end # end if exploit

0 commit comments

Comments
 (0)