def tool_main_menu(self): # This is the main function where everything is called from # Iterate over payloads and find the user selected payload module evasion_main_command = "" show_evasion_menu = True while True: # set out tab completion for the appropriate modules on each run # as other modules sometimes reset this comp = completer.MainMenuCompleter(self.evasion_main_menu_commands, self.active_payloads) readline.set_completer_delims(' \t\n;') readline.parse_and_bind("tab: complete") readline.set_completer(comp.complete) if show_evasion_menu: evasion_helpers.title_screen() print("Veil-Evasion Menu") print("\n\t" + helpers.color(len(self.active_payloads)) + " payloads loaded\n") print("Available Commands:\n") for command in sorted(self.evasion_main_menu_commands.keys()): print("\t" + helpers.color(command) + '\t\t\t' + self.evasion_main_menu_commands[command]) print() show_evasion_menu = False evasion_main_command = input('Veil/Evasion>: ').strip().lower() if evasion_main_command.startswith("back") or evasion_main_command.startswith("main") or evasion_main_command.startswith("menu"): break elif evasion_main_command.startswith("checkvt"): self.check_vt() elif evasion_main_command.startswith("clean"): self.clean_artifacts() elif evasion_main_command.startswith("exit") or evasion_main_command.startswith("quit"): sys.exit(0) elif evasion_main_command.startswith('info'): if len(evasion_main_command.split()) == 2: payload_selected = evasion_main_command.split()[1] selected_payload_module = self.return_payload_object(payload_selected) if not selected_payload_module: print() print(helpers.color(" [!] ERROR: You did not provide a valid payload selection!", warning=True)) print(helpers.color(" [*] Ex: info 2 OR info lua/shellcode_inject/flat.py", warning=True)) print() else: self.print_options_screen(selected_payload_module) else: print() print(helpers.color(" [!] ERROR: You did not provide a valid payload selection!", warning=True)) print(helpers.color(" [*] Ex: info 2 OR info lua/shellcode_inject/flat.py", warning=True)) print() elif evasion_main_command.startswith('list'): evasion_helpers.title_screen() self.list_loaded_payloads() elif evasion_main_command.startswith('use'): if len(evasion_main_command.split()) == 2: payload_selected = evasion_main_command.split()[1].lower() selected_payload_module = self.return_payload_object(payload_selected) if not selected_payload_module: print() print(helpers.color(" [!] ERROR: You did not provide a valid payload selection!", warning=True)) print(helpers.color(" [*] Ex: use 2 OR use lua/shellcode_inject/flat.py", warning=True)) print() else: self.use_payload(selected_payload_module) show_evasion_menu = True else: print() print(helpers.color(" [!] ERROR: You did not provide a valid payload selection!", warning=True)) print(helpers.color(" [*] Ex: use 2 OR use lua/shellcode_inject/flat.py", warning=True)) print() return
def tool_main_menu(self): # This is the main function where everything is called from # Iterate over payloads and find the user selected payload module bypass_main_command = '' show_bypass_menu = True while bypass_main_command == '': # set out tab completion for the appropriate modules on each run # as other modules sometimes reset this comp = completer.MainMenuCompleter(self.bypass_main_menu_commands, self.active_payloads) readline.set_completer_delims(' \t\n;') readline.parse_and_bind("tab: complete") readline.set_completer(comp.complete) if show_bypass_menu: bypass_helpers.title_screen() print("GreatSCT-Bypass Menu") print("\n\t" + helpers.color(len(self.active_payloads)) + " payloads loaded\n") print("Available Commands:\n") for command in sorted(self.bypass_main_menu_commands.keys()): print("\t" + helpers.color(command) + '\t\t\t' + self.bypass_main_menu_commands[command]) print() show_bypass_menu = True bypass_main_command = input('GreatSCT-Bypass command: ').strip() if bypass_main_command.lower() == "back": bypass_main_command = '' break elif bypass_main_command.lower() == "checkvt": self.check_vt() bypass_main_command = '' elif bypass_main_command.lower() == "clean": self.clean_artifacts() bypass_main_command = '' elif bypass_main_command.lower() == "exit": sys.exit(0) elif bypass_main_command.lower().startswith('info'): if len(bypass_main_command.split()) == 2: payload_selected = bypass_main_command.split()[1] selected_payload_module = self.return_payload_object( payload_selected) if not selected_payload_module: print() print( helpers.color( "[*] Error: You did not provide a valid payload selection!", warning=True)) print( helpers.color( "[*] Ex: info 2 or info msbuild/shellcode_inject/virtual.py", warning=True)) print() bypass_main_command = '' show_bypass_menu = False else: self.print_options_screen(selected_payload_module) bypass_main_command = '' show_bypass_menu = False else: print() print( helpers.color( "[*] Error: You did not provide a valid payload selection!", warning=True)) print( helpers.color( "[*] Ex: info 2 or info msbuild/shellcode_inject/virtual.py", warning=True)) print() bypass_main_command = '' show_bypass_menu = False elif bypass_main_command.lower().startswith('list'): bypass_helpers.title_screen() self.list_loaded_payloads() show_bypass_menu = False print() bypass_main_command = '' elif bypass_main_command.lower().startswith('use'): if len(bypass_main_command.split()) == 2: payload_selected = bypass_main_command.split()[1] selected_payload_module = self.return_payload_object( payload_selected) if not selected_payload_module: print() print( helpers.color( "[*] Error: You did not provide a valid payload selection!", warning=True)) print( helpers.color( "[*] Ex: info 2 or info msbuild/shellcode_inject/virtual.py", warning=True)) print() bypass_main_command = '' show_bypass_menu = False else: self.use_payload(selected_payload_module) bypass_main_command = '' show_bypass_menu = True else: print() print( helpers.color( "[*] Error: You did not provide a valid payload selection!", warning=True)) print( helpers.color( "[*] Ex: use 2 or use msbuild/shellcode_inject/virtual.py", warning=True)) print() bypass_main_command = '' show_bypass_menu = False else: bypass_main_command = '' return