def list_tools(self): # show title bar messages.title_screen() # Loop over all tools loaded into Veil, print name and description # Function for listing all payloads tool_counter = 1 print(helpers.color(' [*] Available Tools:\n')) for key, tool in sorted(self.imported_tools.items()): print('\t' + str(tool_counter) + ")\t" + tool.cli_name) tool_counter += 1 print() return
def list_tools(self, show_header = True): # Did we run a command? if show_header: # show title bar messages.title_screen() print(helpers.color(' [*] Available Tools:\n')) else: print("Available Tools:\n") # Loop over all tools loaded into Veil, print name and description # Function for listing all payloads tool_counter = 1 for key, tool in sorted(self.imported_tools.items()): print('\t' + str(tool_counter) + ")\t" + tool.cli_name) tool_counter += 1 print() return
def list_tools(self, show_header=True): # Did we run a command? if show_header: # show title bar print() messages.title_screen() print() print(helpers.color(' [*] Available Tools:\n')) else: print("Available Tools:\n") # Loop over all tools loaded into Veil, print name and description # Function for listing all payloads tool_counter = 1 for key, tool in sorted(self.imported_tools.items()): print('\t' + str(tool_counter) + ")\t" + tool.cli_name) tool_counter += 1 print() return
ordnance_encoder.add_argument( '--print-stats', default=False, action='store_true', help='Print information about the encoded shellcode') args = parser.parse_args() the_conductor = orchestra.Conductor(args) if args.h: parser.print_help() sys.exit() if args.version: messages.title_screen() sys.exit() if args.update: the_conductor.update_veil() sys.exit() if args.setup: the_conductor.setup_veil() sys.exit() if args.config: the_conductor.config_veil() sys.exit() if args.list_tools:
def main_menu(self): # default blank command for the main menu loop main_menu_command = "" show_header = True # Try except to catch keyboard interrupts try: # Loop for the main menu, will always loop as long as command is '' while True: comp = completer.VeilMainMenuCompleter(self.mainmenu_commands, self.imported_tools) readline.set_completer_delims(' \t\n;') readline.parse_and_bind("tab: complete") readline.set_completer(comp.complete) if show_header: messages.title_screen() print("Main Menu") print("\n\t" + helpers.color(len(self.imported_tools)) + " tools loaded\n") # List tools, but don't show the header self.list_tools(False) print("Available Commands:\n") for command in sorted(self.mainmenu_commands.keys()): print("\t" + helpers.color(command) + '\t\t\t' + self.mainmenu_commands[command]) print() show_header = False main_menu_command = input('Veil>: ').strip() if main_menu_command.startswith('use'): # Check to make sure a tool is provided with use command if len(main_menu_command.split()) == 1: # List tools, don't show header, loop back in main menu self.list_tools() show_header = False elif len(main_menu_command.split()) == 2: # Grab the command, either the number or word tool_choice = main_menu_command.split()[1] # If we're choosing the payload by numbers if tool_choice.isdigit() and\ 0 < int(tool_choice) <= len(self.imported_tools): tool_number = 1 for key, tool_object in sorted( self.imported_tools.items()): # if the entered number matches the payload, use that payload if int(tool_choice) == tool_number: tool_object.tool_main_menu() tool_number += 1 show_header = True # Else if selecting payload by name else: for key, tool_object in sorted( self.imported_tools.items()): # if the entered number matches the payload, use that payload if tool_choice.lower( ) == tool_object.cli_name.lower(): tool_object.tool_main_menu() show_header = True # Once done with tool, clear main menu command show_header = True elif main_menu_command.startswith('list'): # List tools, don't show header, loop back in main menu self.list_tools() elif main_menu_command.startswith('info'): if len(main_menu_command.split()) == 1: show_header = True elif len(main_menu_command.split()) == 2: # Grab the command, either the number or word info_choice = main_menu_command.split()[1] # If we're choosing the payload by numbers if info_choice.isdigit() and\ 0 < int(info_choice) <= len(self.imported_tools): tool_number = 1 for key, tool_object in sorted( self.imported_tools.items()): # If the entered number matches the tool, use that tool if int(info_choice) == tool_number: print() print( helpers.color(tool_object.cli_name) + " => " + tool_object.description) print() tool_number += 1 # If the entered name matches the tool, use that tool else: for key, tool_object in sorted( self.imported_tools.items()): if main_menu_command.split()[1].lower( ) == tool_object.cli_name.lower(): print() print( helpers.color(tool_object.cli_name) + " => " + tool_object.description) print() else: show_header = True elif main_menu_command.startswith('option'): self.options_veil() # Hidden menu option elif main_menu_command.startswith('config'): self.config_veil() # Hidden menu option elif main_menu_command.startswith('setup'): self.setup_veil() elif main_menu_command.startswith('update'): self.update_veil() elif main_menu_command.startswith( 'exit') or main_menu_command.startswith('quit'): sys.exit() except KeyboardInterrupt: print("\n\n" + helpers.color("^C. Quitting...", warning=True)) sys.exit()
def main_menu(self): # default blank command for the main menu loop main_menu_command = "" show_header = True # Try except to catch keyboard interrupts try: # Loop for the main menu, will always loop as long as command is '' while True: comp = completer.VeilMainMenuCompleter(self.mainmenu_commands, self.imported_tools) readline.set_completer_delims(' \t\n;') readline.parse_and_bind("tab: complete") readline.set_completer(comp.complete) if show_header: messages.title_screen() print("Main Menu") print("\n\t" + helpers.color(len(self.imported_tools)) + " tools loaded\n") # List tools, but don't show the header self.list_tools(False) print("Available Commands:\n") for command in sorted(self.mainmenu_commands.keys()): print("\t" + helpers.color(command) + '\t\t\t' + self.mainmenu_commands[command]) print() show_header = False main_menu_command = input('Veil>: ').strip() if main_menu_command.startswith('use'): # Check to make sure a tool is provided with use command if len(main_menu_command.split()) == 1: # List tools, don't show header, loop back in main menu self.list_tools() show_header = False elif len(main_menu_command.split()) == 2: # Grab the command, either the number or word tool_choice = main_menu_command.split()[1] # If we're choosing the payload by numbers if tool_choice.isdigit() and\ 0 < int(tool_choice) <= len(self.imported_tools): tool_number = 1 for key, tool_object in sorted(self.imported_tools.items()): # if the entered number matches the payload, use that payload if int(tool_choice) == tool_number: tool_object.tool_main_menu() tool_number += 1 show_header = True # Else if selecting payload by name else: for key, tool_object in sorted(self.imported_tools.items()): # if the entered number matches the payload, use that payload if tool_choice.lower() == tool_object.cli_name.lower(): tool_object.tool_main_menu() show_header = True # Once done with tool, clear main menu command show_header = True elif main_menu_command.startswith('list'): # List tools, don't show header, loop back in main menu self.list_tools() elif main_menu_command.startswith('info'): if len(main_menu_command.split()) == 1: show_header = True elif len(main_menu_command.split()) == 2: # Grab the command, either the number or word info_choice = main_menu_command.split()[1] # If we're choosing the payload by numbers if info_choice.isdigit() and\ 0 < int(info_choice) <= len(self.imported_tools): tool_number = 1 for key, tool_object in sorted(self.imported_tools.items()): # If the entered number matches the tool, use that tool if int(info_choice) == tool_number: print() print(helpers.color(tool_object.cli_name) + " => " + tool_object.description) print() tool_number += 1 # If the entered name matches the tool, use that tool else: for key, tool_object in sorted(self.imported_tools.items()): if main_menu_command.split()[1].lower() == tool_object.cli_name.lower(): print() print(helpers.color(tool_object.cli_name) + " => " + tool_object.description) print() else: show_header = True elif main_menu_command.startswith('option'): self.options_veil() # Hidden menu option elif main_menu_command.startswith('config'): self.config_veil() # Hidden menu option elif main_menu_command.startswith('setup'): self.setup_veil() elif main_menu_command.startswith('update'): self.update_veil() elif main_menu_command.startswith('exit') or main_menu_command.startswith('quit'): sys.exit() except KeyboardInterrupt: print("\n\n" + helpers.color("^C. Quitting...", warning=True)) sys.exit()
ordnance_encoder.add_argument( '--print-stats', default=False, action='store_true', help='Print information about the encoded shellcode') args = parser.parse_args() the_conductor = orchestra.Conductor(args) # --help if args.h: parser.print_help() sys.exit() # --version if args.version: messages.title_screen() sys.exit() # --update if args.update: the_conductor.update_veil() sys.exit() # --setup if args.setup: the_conductor.setup_veil() sys.exit() # --config if args.config: the_conductor.config_veil()