46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
from menu import MenuState, LeafMenu
|
|
from sniff import udp
|
|
from common import config_loader, log
|
|
|
|
def init_menus():
|
|
main_menu = MenuState("NOS0S\nselect an option", "NOS0S MAIN")
|
|
net = MenuState("net recon", "tools to gain intel on network devices")
|
|
sniffer = LeafMenu("Sniffer", "Sniffs for network traffic. CTRL+C to cancel.")
|
|
sniffer.set_action(udp.sniff, (config_loader.config['sniff']['host'], log.warning))
|
|
net.add_submenu(sniffer)
|
|
main_menu.add_submenu(net)
|
|
return main_menu
|
|
|
|
|
|
|
|
def main():
|
|
log.set_lvl(log.LogLevel.DEBUG)
|
|
main_menu = init_menus()
|
|
current_menu = main_menu
|
|
while current_menu != None:
|
|
display, return_to_parent = current_menu.display_CLI()
|
|
print(display)
|
|
|
|
if(return_to_parent):
|
|
current_menu = current_menu.nav_to_parent()
|
|
continue
|
|
|
|
res = input('> ')
|
|
if res == 'q':
|
|
break
|
|
elif res == 'b':
|
|
current_menu = current_menu.nav_to_parent()
|
|
else:
|
|
try:
|
|
selection = int(res)
|
|
current_menu = current_menu.nav_to_sub(selection)
|
|
except:
|
|
print("Invalid input. Please try again.")
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|
|
|