diff --git a/wifipumpkin3/core/common/console.py b/wifipumpkin3/core/common/console.py index 899bf520..3c3d10ce 100644 --- a/wifipumpkin3/core/common/console.py +++ b/wifipumpkin3/core/common/console.py @@ -475,6 +475,9 @@ def help_mode(self): def do_exit(self, args): """core: exit program and all threads""" - self.killThreads() + if len(self.threads["RogueAP"]) > 0: + user_input = input("Do you really want to quit? [y/n]: ").lower() + if user_input == 'y': + self.killThreads() print("Exiting...") raise SystemExit diff --git a/wifipumpkin3/core/common/terminal.py b/wifipumpkin3/core/common/terminal.py index 0749e329..cb2901d8 100644 --- a/wifipumpkin3/core/common/terminal.py +++ b/wifipumpkin3/core/common/terminal.py @@ -130,15 +130,12 @@ def __init__(self, parse_args=None): self.setOptions() def cmdloop(self, intro=None): - print(intro) doQuit = False while doQuit != True: try: super(ConsoleUI, self).cmdloop(intro="") - doQuit = True except KeyboardInterrupt: - print("caught ctrl+c, press return to exit") - self.do_exit([]) + pass def initialize_core(self): raise NotImplementedError() @@ -406,8 +403,13 @@ def onecmd(self, commands, separator=";"): if not str(command).startswith("use"): Cmd.onecmd(self, command) - def do_exit(self, args): - sys.exit(0) + def cmdloop(self, intro=None): + doQuit = False + while doQuit != True: + try: + super(ModuleUI, self).cmdloop(intro="") + except KeyboardInterrupt: + pass class ExtensionUI(ConsoleUIBase):