if len(proto_list) > 0: t2 = time.time() logger.info( "----------------- BruteForce Start -------------------") logger.info("Protocols: {}\tDefaultdict: {}".format( proto_list, defaultdict)) from bruteforce.bruteForce import bruteforce_interface bruteforce_interface( portScan_result_list=portScan_result_list, timeout=timeout, proto_list=proto_list, pool=pool, default_dict=defaultdict, users=users, passwords=passwords, hashes=hashes, ssh_keys=sshkeys, ) t3 = time.time() logger.info("BruteForce finish,time use : {} s".format(t3 - t2)) logger.info( "----------------- BruteForce Finish --------------------") if params.get("vulscan"): vulscan = params.get("vulscan").get("run") if vulscan is True: proto_list = []
if len(proto_list) > 0: from bruteforce.bruteForce import bruteforce_interface for prote in proto_list: filename = "{}.txt".format(prote) try: with open(filename, "rb") as f: file_lines = f.readlines() for line in file_lines: manly_input_result = get_one_result( line.strip(), prote) portScan_result_list.extend(manly_input_result) except Exception as E: pass t2 = time.time() logger.info("----------------- BruteForce Start -------------------") logger.info("Protocols: {}\nNo_default_dict: {}".format( proto_list, no_default_dict)) bruteforce_interface(portScan_result_list, timeout, no_default_dict, proto_list, pool) t3 = time.time() logger.info("BruteForce finish,time use : {}s".format(t3 - t2)) logger.info("----------------- BruteForce Finish --------------------") logger.info("----------------- Progrem Finish -----------------------\n\n") try: write_finish_flag(start_timestamp) except Exception as e: pass