def main(): global settings global language settings = functions.get_settings() language = functions.get_lang(settings) functions.clear() print(language["client"]["first_setup"]) port = input(language["choice"]) if port == "": port = 4100 elif not 1025 <= int(port) <= 65535: print(language["client"]["error_port_range"]) else: port = int(port) connection_thread = threading.Thread(target=connection, args=[port], daemon=True) connection_thread.start() while True: x = input(language["client"]["stop_connection_question"]) if x.lower() == "stop": sys.exit()
def main(): global settings global language global scan_list global client_list settings = functions.get_settings() language = functions.get_lang(settings) client_list = [] scan_list = [] if settings["first_start"]: functions.clear() print(language["server"]["first_setup"]) input(language["pause"]) setup_qubo_command() settings["first_start"] = False functions.save_file(json.dumps(settings), "data/settings.json") print(language["server"]["close_warning"]) input(language["pause"]) functions.clear() if settings["load_last_session"]: load_last_session() try: main_menu() finally: close_and_save_all()
def dscanner_manager(): while True: functions.clear() print(language["server"]["dscanner_manager"]) x = input(language["choice"]) if x == "1": client_list.append(client()) elif x == "2": break
def scan_manager(): while True: functions.clear() print(language["server"]["scan_manager"]) x = input(language["choice"]) if x == "1": start_scan() elif x == "2": show_results() elif x == "3": break
def dscanner_settings(): while True: global language functions.clear() print(language["server"]["dscanner_settings"]) x = input(language["choice"]) if x == "1": setup_qubo_command() elif x == "2": language = functions.get_lang(settings, 1) elif x == "3": break
def main_menu(): while True: language = functions.get_lang(settings) functions.clear() print(language["server"]["menu"]) x = input(language["choice"]) if x == "1": scan_manager() elif x == "2": dscanner_manager() elif x == "3": dscanner_settings() elif x == "4": break
def load_last_session(): print(language["server"]["loading_last_session"]) settings["load_last_session"] = False functions.save_file(json.dumps(settings), "data/settings.json") last_session = functions.get_last_session() for x in last_session["clients"]: client_list.append(client(x)) for x in last_session["scans"]: scan_list.append(results(x, len(client_list))) i = 0 for x in last_session["scans_results"]: scan_list[i].result_list = x i += 1 sleep(2) functions.clear()
def main(): settings = functions.get_settings() language = functions.get_lang(settings) functions.clear() print(''' _____ | __ \ | | | | ___ ___ __ _ _ __ _ __ ___ _ __ | | | |/ __| / __|/ _` || '_ \ | '_ \ / _ \| '__| | |__| |\__ \| (__| (_| || | | || | | || __/| | |_____/ |___/ \___|\__,_||_| |_||_| |_| \___||_| Ver 0.2 ''') print(language["welcome"]) input(language["pause"]) if settings["modality"] is None: while True: functions.clear() print(language["modality_choice"]) x = input(language["choice"]) if x == "1": print(language["permanent_choice"]) x = input(language["choice"]) if x == "1": settings["modality"] = "server" functions.save_file(json.dumps(settings), "data/settings.json") server.main() elif x == "2": print(language["permanent_choice"]) x = input(language["choice"]) if x == "1": settings["modality"] = "client" functions.save_file(json.dumps(settings), "data/settings.json") client.main() elif settings["modality"] == "server": server.main() elif settings["modality"] == "client": client.main()
def setup_qubo_command(): while True: functions.clear() print(language["server"]["qubo_command_settings"]["pingcount"], settings["qubo_command"]["pingcount"]) print(language["server"]["qubo_command_settings"]["fulloutput"], settings["qubo_command"]["fulloutput"]) print(language["server"]["qubo_command_settings"]["filtermotd"], settings["qubo_command"]["filtermotd"]) print(language["server"]["qubo_command_settings"]["noping"], settings["qubo_command"]["noping"]) print(language["server"]["qubo_command_settings"]["minonline"], settings["qubo_command"]["minonline"]) print(language["server"]["qubo_command_settings"]["portrange"], settings["qubo_command"]["portrange"]) print(language["server"]["qubo_command_settings"]["threads"], settings["qubo_command"]["threads"]) print(language["server"]["qubo_command_settings"]["timeout"], settings["qubo_command"]["timeout"]) print(language["server"]["qubo_command_settings"]["filterversion"], settings["qubo_command"]["filterversion"]) print(language["server"]["qubo_command_settings"]["exit"]) x = int(input(language["choice"])) if 1 <= x <= 9: if x == 1: settings["qubo_command"]["pingcount"] = int( input(language["server"]["qubo_command_settings"] ["pingcount"])) elif x == 2: if settings["qubo_command"]["fulloutput"] is None: settings["qubo_command"]["fulloutput"] = True elif settings["qubo_command"]["fulloutput"]: settings["qubo_command"]["fulloutput"] = False else: settings["qubo_command"]["fulloutput"] = True elif x == 3: settings["qubo_command"]["filtermotd"] = input( language["server"]["qubo_command_settings"]["filtermotd"]) elif x == 4: if settings["qubo_command"]["noping"] is None: settings["qubo_command"]["noping"] = True elif settings["qubo_command"]["noping"]: settings["qubo_command"]["noping"] = False else: settings["qubo_command"]["noping"] = True elif x == 5: settings["qubo_command"]["minonline"] = int( input(language["server"]["qubo_command_settings"] ["minonline"])) elif x == 6: settings["qubo_command"]["portrange"] = input( language["server"]["qubo_command_settings"]["portrange"]) elif x == 7: settings["qubo_command"]["threads"] = int( input(language["server"]["qubo_command_settings"] ["threads"])) elif x == 8: settings["qubo_command"]["timeout"] = int( input(language["server"]["qubo_command_settings"] ["timeout"])) elif x == 9: settings["qubo_command"]["filterversion"] = input( language["server"]["qubo_command_settings"] ["filterversion"]) elif x == 10: if settings["qubo_command"]["portrange"] is None \ or settings["qubo_command"]["threads"] is None \ or settings["qubo_command"]["timeout"] is None: print(language["server"]["qubo_command_settings"]["cant_exit"]) input(language["pause"]) else: return