Add more error handling
parent
ffb54a13fe
commit
e1d76b8ff6
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue