def custom_req_hdr(): curt_custom_hdr = custom_hdr.get() # print(curt_custom_hdr) write_config("Config", "CustomRequestHeader", curt_custom_hdr) if curt_custom_hdr: w.Text1.configure(state="normal") else: w.Text1.configure(state="disabled")
def set_pwd_file(): dict_file = askopenfilename(initialdir=data_dir, initialfile="pwd.txt", parent=root, filetypes=[("text files", "*.txt")]) if path.isfile(dict_file): w.TCombobox1.delete(0, 'end') w.TCombobox1.insert(0, dict_file) w.TCombobox1.set(dict_file) write_config("Dictionary", "Path", dict_file)
def dereplicat_pwd_file(): pwd_path = w.TCombobox1.get() base_name = path.basename(pwd_path) if 'deduplicated' in base_name: title = "Cheetah Info" message = "The dictionary file has been deduplicated." showerror(title, message, parent=root) return format_str = "_%Y-%m-%d_(%H.%M.%S)_" time_str = str(time.strftime(format_str, time.localtime())) new_dict_name = 'deduplicated' + time_str + base_name new_dict_path = path.join(data_dir, new_dict_name) with io.open(new_dict_path, mode='a', encoding='utf-8') as new_file: for chunk in read_chunks(pwd_path): new_file.write('\n'.join(set(chunk.split())).lower()) title = "Cheetah Info" message = "Dereplication completed, new dictionary file is %s." % new_dict_name showinfo(title, message, parent=root) w.TCombobox1.set(new_dict_path) write_config("Dictionary", "Path", new_dict_path)
def is_first_run(): res = read_config('Run', 'first', 'boolean') write_config('Run', 'first', False) return res
def exit_dict_setting(): get_dict_path = w.TCombobox1.get() write_config("Dictionary", "Path", get_dict_path) destroy_window()
def compare_hdr_data(*args): if w.Text1.edit_modified(): hdr_data = w.Text1.get('1.0', 'end-1c') write_config("Config", "CustomRequestHeaderData", hdr_data)
def save_config(): write_config("Config", "Method", method.get()) write_config("Config", "Server", server.get()) write_config("Config", "ShellType", shelltype.get()) write_config("Config", "Parameter", parameter.get()) write_config("Config", "ThreadNumber", thread_num.get()) write_config("Config", "RequestDelay", req_delay.get()) write_config("Config", "RequestTimeout", time_out.get()) write_config("Config", "RandomUserAgent", random_ua.get()) write_config("Config", "ConnectionClose", con_close.get()) write_config("Config", "KeepAlive0", keep_alive.get())