def menu(self, err=""): while 1: try: h.clear() if err: print err if self.server.debug: print "Debug mode: on" sys.stdout.write(self.banner_text) show_graphic() option = raw_input(h.NES) choose = { "1": self.start_single_server, "2": self.start_multi_handler, "3": self.choose_payload, "4": self.clean_payloads, "5": self.clean_downloads, "6": self.update_mouse, "0": self.exit_menu } try: choose[option]() self.menu() except KeyError: if option: self.menu() else: self.menu() except KeyboardInterrupt: continue # TODO: quit socket listener except KeyboardInterrupt: exit()
def menu(self,err=""): while 1: try: h.clear() if err: print(err) if self.server.debug: print("Debug On") sys.stdout.write(self.banner_text) option = input(self.main_menu_text) choose = { "1" : self.start_single_server, "2" : self.start_multi_handler, "3" : self.choose_payload, "4" : self.exit_menu } try: choose[option]() self.menu() except KeyError: if option: self.menu("Oops: " + option + " is not an option") else: self.menu() except KeyboardInterrupt: continue # TODO: quit socket listener except KeyboardInterrupt: print("\nBye!") exit()
def menu(self, err=""): while 1: try: h.clear() if err: print err sys.stdout.write(self.banner_text) option = raw_input(self.main_menu_text) choose = { "1": self.start_single_server, "2": self.start_multi_handler, "3": self.choose_payload, "4": self.exit_menu } try: choose[option]() self.menu() except KeyError: if option: self.menu("Oops: " + option + " is not an option") else: self.menu() except KeyboardInterrupt: continue except KeyboardInterrupt: print "\nSayonara!\n" exit()