diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index 94cb457067..9673ad6ee3 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -379,11 +379,14 @@ class Core # Instructs the driver to stop executing. # def cmd_exit(*args) - if(framework.sessions.count() > 0 and - (args.length < 1 or (args[0] =~ /\-Y/i) == nil)) - print_status("You have active sessions open, to exit anyway type \"exit -y\"") - return + forced = false + forced = true if (args[0] and args[0] =~ /-y/i) + + if(framework.sessions.length > 0 and not forced) + print_status("You have active sessions open, to exit anyway type \"exit -y\"") + return end + driver.stop end