Land #9848, handle 'check' command on modules that do not implement it
commit
c525bc3c0a
|
@ -217,9 +217,16 @@ module ModuleCommandDispatcher
|
|||
end
|
||||
|
||||
begin
|
||||
if instance.respond_to?(:check_simple)
|
||||
code = instance.check_simple(
|
||||
'LocalInput' => driver.input,
|
||||
'LocalOutput' => driver.output)
|
||||
'LocalOutput' => driver.output
|
||||
)
|
||||
else
|
||||
msg = "Check failed: #{instance.type.capitalize} modules do not support check."
|
||||
raise NotImplementedError, msg
|
||||
end
|
||||
|
||||
if (code and code.kind_of?(Array) and code.length > 1)
|
||||
if (code == Msf::Exploit::CheckCode::Vulnerable)
|
||||
print_good("#{peer} #{code[1]}")
|
||||
|
@ -240,6 +247,9 @@ module ModuleCommandDispatcher
|
|||
rescue ::RuntimeError => e
|
||||
# Some modules raise RuntimeError but we don't necessarily care about those when we run check()
|
||||
elog("#{e.message}\n#{e.backtrace.join("\n")}")
|
||||
rescue ::NotImplementedError => e
|
||||
print_error(e.message)
|
||||
elog("#{e.message}\n#{e.backtrace.join("\n")}")
|
||||
rescue ::Exception => e
|
||||
print_error("Check failed: #{e.class} #{e}")
|
||||
elog("#{e.message}\n#{e.backtrace.join("\n")}")
|
||||
|
|
Loading…
Reference in New Issue