MCPcopy Create free account
hub / github.com/bvcyber/RedWizard / initial_menu

Function initial_menu

step-2-create-inventory.py:699–734  ·  view source on GitHub ↗

The main menu

(hosts_yaml, hosts_yaml_location)

Source from the content-addressed store, hash-verified

697 print(f"{BOLD_CYAN}- relays_phishing, relays_nginx to {relay_value_set['ansible_host']}{RESET}")
698
699def initial_menu(hosts_yaml, hosts_yaml_location):
700 """ The main menu """
701 while True:
702 menu = {f"Add Server{BOLD_GREY} (Basic Building Block){RESET}": "Add_Server"}
703
704 # Show an option to add server roles if a server is already defined
705 if get_server_nr('backends', hosts_yaml) + get_server_nr('relays', hosts_yaml) > 0:
706 menu["Add Phishing Campaign"] = "Add_Phish"
707 menu["Add Webcatcher Campaign"] = "Add_Webcatcher"
708 menu["Add OSINT Campaign"] = "Add_OSINT"
709 menu["Add CobaltStrike Campaign"] = "Add_CobaltStrike"
710 menu["Add Dropbox Campaign"] = "Add_Dropbox"
711 menu["Show Current Inventory"] = "Show"
712 menu["Save Updated Inventory"] = "Save"
713
714 choice = show_menu(menu, "Please choose your action")
715 if choice == "Add_Server":
716 add_server_menu(hosts_yaml)
717 elif choice == "Save":
718 create_hosts_template(hosts_yaml_location, hosts_yaml)
719 elif choice == "Add_Phish":
720 add_phish_menu(hosts_yaml)
721 elif choice == "Add_Webcatcher":
722 add_webcatcher_menu(hosts_yaml)
723 elif choice == "Add_OSINT":
724 add_osint_menu(hosts_yaml)
725 elif choice == "Add_CobaltStrike":
726 add_cobaltstrike_menu(hosts_yaml)
727 elif choice == "Add_Dropbox":
728 add_dropbox_menu(hosts_yaml)
729 elif choice == "Show":
730 show_inventory(hosts_yaml)
731 elif choice == "Exit":
732 confirmation = input(f"Are you sure? You might want to safe first. {BOLD_YELLOW} y/n{RESET}\n")
733 if confirmation == 'Y' or confirmation == 'y':
734 break
735
736###############################################################################
737# Main functions

Callers 1

mainFunction · 0.85

Calls 10

get_server_nrFunction · 0.85
show_menuFunction · 0.85
add_server_menuFunction · 0.85
create_hosts_templateFunction · 0.85
add_phish_menuFunction · 0.85
add_webcatcher_menuFunction · 0.85
add_osint_menuFunction · 0.85
add_cobaltstrike_menuFunction · 0.85
add_dropbox_menuFunction · 0.85
show_inventoryFunction · 0.85

Tested by

no test coverage detected