From fe13b00d84defce10b4177fde648829b2ae78c77 Mon Sep 17 00:00:00 2001 From: William Vu Date: Tue, 17 Jul 2018 14:33:32 -0500 Subject: [PATCH] Land #10309, PID check for self-migrate --- .../post/meterpreter/ui/console/command_dispatcher/core.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb index 6b813f0daa..99564b22ed 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb @@ -1114,6 +1114,11 @@ class Console::CommandDispatcher::Core end end + if pid == server.pid + print_error("Process already running at PID #{pid}") + return + end + server ? print_status("Migrating from #{server.pid} to #{pid}...") : print_status("Migrating to #{pid}") # Do this thang.