Add more error handling

bug/bundler_fix
Josh Hale 2017-02-27 17:06:16 -06:00
parent ffb54a13fe
commit e1d76b8ff6
1 changed files with 6 additions and 2 deletions

View File

@ -107,9 +107,13 @@ class MetasploitModule < Msf::Post
client.core.migrate(target_pid) client.core.migrate(target_pid)
print_good("Successfully migrated to #{client.sys.process.open.name} (#{client.sys.process.open.pid}) as: #{client.sys.config.getuid}") print_good("Successfully migrated to #{client.sys.process.open.name} (#{client.sys.process.open.pid}) as: #{client.sys.config.getuid}")
return true return true
rescue ::Rex::Post::Meterpreter::RequestError => error rescue ::Rex::Post::Meterpreter::RequestError => req_error
print_error("Could not migrate to #{proc_name}.") print_error("Could not migrate to #{proc_name}.")
print_error(error.to_s) print_error(req_error.to_s)
return false
rescue ::Rex::RuntimeError => run_error
print_error("Could not migrate to #{proc_name}.")
print_error(run_error.to_s)
return false return false
end end
end end