def save_new_subtopic(self): if self.selected_subtopic.cget('text') != self.new_subtopic_label_text: return self.subtopic_dialog = Toplevel(self.root) self.subtopic_dialog.title('New Note: Subtopic Input Dialog') headlab = LabelH3(self.subtopic_dialog, text='Unique subtopic name for new note:') self.subtopic_input = Entry(self.subtopic_dialog, width=64) self.subtopic_input.focus_set() buttonbox = Frame(self.subtopic_dialog) self.subtopic_dialog.grid_columnconfigure(0, weight=1) new_note_ok = Button(buttonbox, text='Submit Note and Subtitle', command=self.submit_new_note) new_note_cancel = Button(buttonbox, text='Cancel', command=self.close_subtopic_dialog) headlab.grid(column=0, row=0, pady=(24, 0), columnspan=2) self.subtopic_input.grid(column=0, row=1, padx=24, pady=24, columnspan=2) buttonbox.grid(column=1, row=2, sticky='we', padx=24, pady=24) new_note_ok.grid(column=0, row=0, sticky='e', padx=12) new_note_cancel.grid(column=1, row=0, sticky='e', padx=12) self.subtopic_dialog.bind('<Escape>', self.close_subtopic_dialog) self.subtopic_dialog.protocol('WM_DELETE_WINDOW', self.close_subtopic_dialog)
def make_widgets(self): self.entry = Entry(self, textvariable=self.var) self.arrow = LabelHilited(self, text='\u25BC', width=2) # self.arrow = ComboboxArrow(self, text='\u25BC', width=2) self.entry.grid(column=0, row=0) self.arrow.grid(column=1, row=0) self.update_idletasks() self.width = self.winfo_reqwidth() self.drop = ToplevelHilited(self, bd=0) self.drop.bind('<Destroy>', self.clear_reference_to_dropdown) self.drop.withdraw() Combobox.hive.append(self.drop) for widg in (self.master, self.drop): widg.bind('<Escape>', self.hide_all_drops, add='+') self.drop.grid_columnconfigure(0, weight=1) self.drop.grid_rowconfigure(0, weight=1) self.canvas = CanvasHilited(self.drop) self.canvas.grid(column=0, row=0, sticky='news') self.scrollv_combo = Scrollbar(self.drop, hideable=True, command=self.canvas.yview) self.canvas.config(yscrollcommand=self.scrollv_combo.set) self.content = Frame(self.canvas) self.content.grid_columnconfigure(0, weight=1) self.content.grid_rowconfigure('all', weight=1) self.scrollv_combo.grid(column=1, row=0, sticky='ns') self.entry.bind('<KeyPress>', self.open_or_close_dropdown) self.entry.bind('<Tab>', self.open_or_close_dropdown) for widg in (self.entry, self.arrow): widg.bind('<Button-1>', self.open_or_close_dropdown, add='+') self.arrow.bind('<Button-1>', self.focus_entry_on_arrow_click, add='+') for frm in (self, self.content): frm.bind('<FocusIn>', self.arrow.highlight) frm.bind('<FocusOut>', self.arrow.unhighlight) self.drop.bind('<FocusIn>', self.focus_dropdown) self.drop.bind('<Unmap>', self.unhighlight_all_drop_items) self.current_combo_parts = [ self, self.entry, self.arrow, self.scrollv_combo ] for part in self.current_combo_parts: part.bind('<Enter>', self.unbind_combo_parts) part.bind('<Leave>', self.rebind_combo_parts) self.config_values(self.values) config_generic(self.drop)
def build_page3(self): box = Box(orientation=VERTICAL, spacing=6) box.set_border_width(10) _row1 = Frame() _log_view_textbuffer = m._page3_log_view.get_buffer() self._handlers.clear_log_view_buffer(None) _end = _log_view_textbuffer.get_end_iter() _log_view_textbuffer.create_mark('end', _end, False) _scrolled = g.ScrolledWindow() _scrolled.set_policy(g.PolicyType.NEVER, g.PolicyType.ALWAYS) _scrolled.add(m._page3_log_view) _row1.add(_scrolled) _row2 = Box() m._page3_read_target_btn.connect('clicked', self._handlers.read_target_file) m._page3_clear_btn.connect('clicked', self._handlers.clear_log_view_buffer) m._page3_read_log_btn.connect('clicked', self._handlers.read_log_file) _row2.pack_start(m._page3_read_target_btn, True, False, 0) _row2.pack_start(m._page3_clear_btn, True, False, 0) _row2.pack_start(m._page3_read_log_btn, True, False, 0) box.pack_start(_row1, True, True, 5) box.pack_end(_row2, False, True, 0) return box
def make_new_sample(self): # validate colors back = self.r_col['background 1'].get() high = self.r_col['background 2'].get() table = self.r_col['background 3'].get() fonts = self.r_col['font color'].get() try_these = [ (back, self.r_col['background 1']), (high, self.r_col['background 2']), (table, self.r_col['background 3']), (fonts, self.r_col['font color'])] for tup in try_these: if len(tup[0]) == 0: return test_color = Frame(self.root) # don't grid this for tup in try_these: try: test_color.config(bg=tup[0]) except tk.TclError: tup[1].delete(0, tk.END) messagebox.showerror( 'Color Not Recognized.', 'A color was entered that is unknown to the system.') return self.get_new_scheme() for child in self.colors_content.winfo_children(): child.destroy() self.make_samples()
def go_to_graphics(self, graphics): # if frame with this name already exists it's replaced # https://stackoverflow.com/questions/59518905/naming-a-widget-to-auto-destroy-replace-it picwin = Frame(graphics, name='exists') picwin.pack() curr_pic = self.picfile_lab.get(1.0, 'end') curr_pic = curr_pic.strip('\n') img_path = curr_pic edit_pic = Image.open(img_path) edit_img = ImageTk.PhotoImage(edit_pic) editlab = LabelStay( picwin, image=edit_img) editlab.image = edit_img self.nbook.select(graphics) # scroll to top so controls are seen when tab opens self.canvas.yview_moveto(0.0) if self.parent.winfo_class() == 'Toplevel': self.parent.lower(belowThis=self.nbook) editlab.pack() # When this grids a big pic, the whole notebook gets big # prevent large pics from blowing up size of the whole notebook # when placed here by edit button on a gallery # Will need more attention when ready to make the graphics tab. editlab.config(width=700, height=700)
def __init__(self, master, view, treebard, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.master = master # the main canvas (instance of Border class) self.view = view self.treebard = treebard # print('19 self.view is', self.view) self.make_widgets()
def __init__(self, master, command, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.ent = Entry(self, width=36) spacer = Label(self, width=3) ok_butt = Button(self, text='OK', command=command) cancel_butt = Button(self, text='CANCEL', command=self.remove_edit_row) spacer.grid(column=0, row=0) self.ent.grid(column=1, row=0, padx=3, pady=3) ok_butt.grid(column=2, row=0, padx=6, pady=6) cancel_butt.grid(column=3, row=0, padx=6, pady=6)
def __init__(self, master, resizer=True, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.master = master # root or toplevel self.sizer = Sizer(self.master) self.grid_columnconfigure(0, weight=1) # With custom window border, you can't use the otherwise # desirable option bd=2, relief='sunken' for a border on statusbar # because edge grabber for resizing is below statusbar # so border looks wrong there. Instead put a Separator # above the statusbar frame. # relief = Frame(self, bd=2, relief='sunken') relief = Frame(self, bd=0) relief.grid(column=0, row=0, sticky='news') relief.grid_columnconfigure(0, weight=1) self.status_label = LabelStatusbar(relief, cursor='arrow', anchor='w') self.tooltip_label = LabelStatusbar(relief, bd=2, relief='sunken', anchor='e') if resizer is True: self.sizer.place(relx=1.0, x=-3, rely=1.0, anchor='se') self.sizer.bind('<Button-1>', self.sizer.get_pos) self.status_label.grid(column=0, row=0, sticky='w')
def build_page1_request_header(self, m): _f = Frame.new(m._('HTTP header')) _boxes = [Box() for _ in range(3)] m._request_area_random_agent_ckbtn.set_active(True) _boxes[0].pack_start(m._request_area_random_agent_ckbtn, False, True, 5) _boxes[0].pack_start(m._request_area_mobile_ckbtn, False, True, 5) _boxes[0].pack_start(m._request_area_user_agent_ckbtn, False, True, 5) _boxes[0].pack_start(m._request_area_user_agent_entry, True, True, 5) _boxes[1].pack_start(m._request_area_host_ckbtn, False, True, 5) _boxes[1].pack_start(m._request_area_host_entry, True, True, 5) _boxes[1].pack_start(m._request_area_referer_ckbtn, False, True, 5) _boxes[1].pack_start(m._request_area_referer_entry, True, True, 5) _boxes[2].pack_start(m._request_area_header_ckbtn, False, True, 5) _boxes[2].pack_start(m._request_area_header_entry, True, True, 5) _boxes[2].pack_start(m._request_area_headers_ckbtn, False, True, 5) _boxes[2].pack_start(m._request_area_headers_entry, True, True, 5) _request_header_opts = Box(orientation=VERTICAL, spacing = 5) for _ in _boxes: _request_header_opts.add(_) _f.add(_request_header_opts) return _f
def build_page1_setting_hidden(self, m): _f = Frame.new(m._('Hidden')) _boxes = [Box() for _ in range(6)] _ = 0 _boxes[_].pack_start(m._hidden_area_crack_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_debug_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_profile_ckbtn, False, True, 5) _ += 1 _boxes[_].pack_start(m._hidden_area_disable_precon_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_disable_stats_ckbtn, False, True, 5) _ += 1 _boxes[_].pack_start(m._hidden_area_force_dbms_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_force_dns_ckbtn, False, True, 0) _boxes[_].pack_start(m._hidden_area_force_pivoting_ckbtn, False, True, 5) _ += 1 _boxes[_].pack_start(m._hidden_area_smoke_test_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_live_test_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_vuln_test_ckbtn, False, True, 5) _ += 1 _boxes[_].pack_start(m._hidden_area_murphy_rate_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_stop_fail_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_run_case_ckbtn, False, True, 5) _ += 1 _boxes[_].pack_start(m._hidden_area_dummy_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_api_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_taskid_ckbtn, False, True, 5) _boxes[_].pack_start(m._hidden_area_database_ckbtn, False, True, 5) _hidden_area_opts = Box(orientation=VERTICAL, spacing=5) for _ in _boxes: _hidden_area_opts.add(_) _f.add(_hidden_area_opts) return _f
def build_page1_setting_optimize(self, m): _f = Frame.new(m._('Optimize')) _boxes = [Box() for _ in range(5)] m._optimize_area_turn_all_ckbtn.connect('clicked', self.optimize_area_controller) _boxes[0].pack_start(m._optimize_area_turn_all_ckbtn, False, True, 5) m._optimize_area_thread_num_ckbtn.connect( 'clicked', self.cb_single, m._optimize_area_predict_ckbtn) _boxes[1].pack_start(m._optimize_area_thread_num_ckbtn, False, True, 5) _boxes[1].pack_start(m._optimize_area_thread_num_spinbtn, True, True, 5) m._optimize_area_predict_ckbtn.connect( 'clicked', self.cb_single, m._optimize_area_thread_num_ckbtn) _boxes[2].pack_start(m._optimize_area_predict_ckbtn, False, True, 5) m._optimize_area_keep_alive_ckbtn.connect( 'clicked', self.cb_single, m._request_area_proxy_ckbtn) _boxes[3].pack_start(m._optimize_area_keep_alive_ckbtn, False, True, 5) m._optimize_area_null_connect_ckbtn.connect( 'clicked', self.cb_single, m._detection_area_text_only_ckbtn) _boxes[4].pack_start(m._optimize_area_null_connect_ckbtn, False, True, 5) _optimize_area_opts = Box(orientation=VERTICAL, spacing=6) for _ in _boxes: _optimize_area_opts.add(_) _f.add(_optimize_area_opts) return _f
def build_page1_setting_tech(self, m): _f = Frame.new(m._('Technique')) _boxes = [Box() for _ in range(9)] _boxes[0].pack_start(m._tech_area_tech_ckbtn, False, True, 5) _boxes[0].pack_end(m._tech_area_tech_entry, False, True, 5) _boxes[1].pack_start(m._tech_area_time_sec_ckbtn, False, True, 5) _boxes[1].pack_end(m._tech_area_time_sec_entry, False, True, 5) _boxes[2].pack_start(m._tech_area_union_col_ckbtn, False, True, 5) _boxes[2].pack_end(m._tech_area_union_col_entry, False, True, 5) _boxes[3].pack_start(m._tech_area_union_char_ckbtn, False, True, 5) _boxes[3].pack_end(m._tech_area_union_char_entry, False, True, 5) _boxes[4].pack_start(m._tech_area_union_from_ckbtn, False, True, 5) _boxes[4].pack_end(m._tech_area_union_from_entry, False, True, 5) _boxes[5].pack_start(m._tech_area_dns_ckbtn, True, True, 5) _boxes[5].pack_end(m._tech_area_dns_entry, True, True, 5) _boxes[6].pack_start(m._tech_area_second_url_ckbtn, True, True, 5) _boxes[6].pack_end(m._tech_area_second_url_entry, True, True, 5) _boxes[7].pack_start(m._tech_area_second_req_ckbtn, False, True, 5) m._tech_area_second_req_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._tech_area_second_req_entry] ) _boxes[8].pack_end(m._tech_area_second_req_chooser, False, True, 5) _boxes[8].pack_end(m._tech_area_second_req_entry, True, True, 5) _tech_area_opts = Box(orientation=VERTICAL, spacing=3) for _ in _boxes: _tech_area_opts.add(_) _f.add(_tech_area_opts) return _f
def _build_page1_file_os_registry(self, m): f = Frame.new('访问WIN下注册表') _boxes = [Box() for _ in range(3)] m._file_os_registry_reg_combobox.append('--reg-read', '读取') m._file_os_registry_reg_combobox.append('--reg-add', '新增') m._file_os_registry_reg_combobox.append('--reg-del', '删除') m._file_os_registry_reg_combobox.set_active(0) _boxes[0].pack_start(m._file_os_registry_reg_ckbtn, False, True, 5) _boxes[0].pack_start(m._file_os_registry_reg_combobox, False, True, 5) _boxes[1].pack_start(m._file_os_registry_reg_key_label, False, True, 5) _boxes[1].pack_start(m._file_os_registry_reg_key_entry, True, True, 5) _boxes[1].pack_start(m._file_os_registry_reg_value_label, False, True, 5) _boxes[1].pack_start(m._file_os_registry_reg_value_entry, True, True, 5) _boxes[2].pack_start(m._file_os_registry_reg_data_label, False, True, 5) _boxes[2].pack_start(m._file_os_registry_reg_data_entry, True, True, 5) _boxes[2].pack_start(m._file_os_registry_reg_type_label, False, True, 5) _boxes[2].pack_start(m._file_os_registry_reg_type_entry, True, True, 5) _file_os_registry_opts = Box(orientation=VERTICAL) for _ in _boxes: _file_os_registry_opts.add(_) f.add(_file_os_registry_opts) return f
def _build_page1_file_os_access(self, m): f = Frame.new('访问后端OS') _boxes = [Box() for _ in range(3)] _boxes[0].pack_start(m._file_os_access_os_cmd_ckbtn, False, True, 5) _boxes[0].pack_start(m._file_os_access_os_cmd_entry, True, True, 5) _for_msf_label = label(label='Meterpreter相关(TCP连接):', margin_start=50) _boxes[1].pack_start(m._file_os_access_os_shell_ckbtn, False, True, 5) _boxes[1].pack_start(_for_msf_label, False, True, 5) _boxes[1].pack_start(m._file_os_access_os_pwn_ckbtn, False, True, 5) _boxes[1].pack_start(m._file_os_access_os_smbrelay_ckbtn, False, True, 5) _boxes[1].pack_start(m._file_os_access_os_bof_ckbtn, False, True, 5) _boxes[1].pack_start(m._file_os_access_priv_esc_ckbtn, False, True, 5) m._file_os_access_msf_path_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._file_os_access_msf_path_entry, '选择 本地Metasploit安装目录']) _boxes[2].pack_start(m._file_os_access_msf_path_ckbtn, False, True, 5) _boxes[2].pack_start(m._file_os_access_msf_path_entry, True, True, 0) _boxes[2].pack_start(m._file_os_access_msf_path_chooser, False, True, 5) _boxes[2].pack_start(m._file_os_access_tmp_path_ckbtn, False, True, 5) _boxes[2].pack_start(m._file_os_access_tmp_path_entry, True, True, 5) _file_os_access_opts = Box(orientation=VERTICAL, spacing=6) for _ in _boxes: _file_os_access_opts.add(_) f.add(_file_os_access_opts) return f
def _build_page1_enumeration_meta(self, m): f = Frame.new('数据库名, 表名, 列名...') _boxes = [Box() for _ in range(3)] _boxes[0].pack_start(m._meta_area_D_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_D_entry, True, True, 5) _boxes[0].pack_start(m._meta_area_T_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_T_entry, True, True, 5) _boxes[0].pack_start(m._meta_area_C_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_C_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_U_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_U_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_X_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_X_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_pivot_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_pivot_entry, True, True, 5) _boxes[2].pack_start(m._meta_area_where_ckbtn, False, True, 5) _boxes[2].pack_start(m._meta_area_where_entry, True, True, 5) _meta_area_opts = Box(orientation=VERTICAL) for _ in _boxes: _meta_area_opts.pack_start(_, False, True, 5) f.add(_meta_area_opts) return f
def build_page1_enumeration_meta(self, m): _f = Frame.new(m._('DB, Table, Column name...')) _boxes = [Box() for _ in range(3)] _boxes[0].pack_start(m._meta_area_D_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_D_entry, True, True, 5) _boxes[0].pack_start(m._meta_area_T_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_T_entry, True, True, 5) _boxes[0].pack_start(m._meta_area_C_ckbtn, False, True, 5) _boxes[0].pack_start(m._meta_area_C_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_U_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_U_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_X_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_X_entry, True, True, 5) _boxes[1].pack_start(m._meta_area_pivot_ckbtn, False, True, 5) _boxes[1].pack_start(m._meta_area_pivot_entry, True, True, 5) _boxes[2].pack_start(m._meta_area_where_ckbtn, False, True, 5) _boxes[2].pack_start(m._meta_area_where_entry, True, True, 5) _meta_area_opts = Box(orientation=VERTICAL) for _ in _boxes: _meta_area_opts.pack_start(_, False, True, 5) _f.add(_meta_area_opts) return _f
def __init__(self, parent, tabbook, root, *args, **kwargs): Frame.__init__(self, parent, *args, **kwargs) self.parent = parent self.tabbook = tabbook self.root = root self.old_col = 0 self.parent.columnconfigure(0, weight=1) self.parent.rowconfigure(0, weight=1) self.root.bind('<Return>', self.apply_scheme) self.r_col = {} self.make_widgets()
def build_page1_file_os_registry(self, m): _f = Frame.new(m._('Access to register in remote WIN')) _boxes = [Box() for _ in range(3)] m._registry_area_reg_combobox.append('--reg-read', m._('read')) m._registry_area_reg_combobox.append('--reg-add', m._('add')) m._registry_area_reg_combobox.append('--reg-del', m._('delete')) m._registry_area_reg_combobox.set_active(0) _boxes[0].pack_start(m._registry_area_reg_ckbtn, False, True, 5) _boxes[0].pack_start(m._registry_area_reg_combobox, False, True, 5) _boxes[1].pack_start(m._registry_area_reg_key_label, False, True, 5) _boxes[1].pack_start(m._registry_area_reg_key_entry, True, True, 5) _boxes[1].pack_start(m._registry_area_reg_value_label, False, True, 5) _boxes[1].pack_start(m._registry_area_reg_value_entry, True, True, 5) _boxes[2].pack_start(m._registry_area_reg_data_label, False, True, 5) _boxes[2].pack_start(m._registry_area_reg_data_entry, True, True, 5) _boxes[2].pack_start(m._registry_area_reg_type_label, False, True, 5) _boxes[2].pack_start(m._registry_area_reg_type_entry, True, True, 5) _registry_area_opts = Box(orientation=VERTICAL) for _ in _boxes: _registry_area_opts.add(_) _f.add(_registry_area_opts) return _f
def build_page1_file_os_access(self, m): _f = Frame.new(m._('Access to the OS behind the DBMS')) _boxes = [Box() for _ in range(3)] _boxes[0].pack_start(m._os_access_area_os_cmd_ckbtn, False, True, 5) _boxes[0].pack_start(m._os_access_area_os_cmd_entry, True, True, 5) _for_msf_label = label(label = m._('with Meterpreter(TCP connect):'), margin_start = 50) _boxes[1].pack_start(m._os_access_area_os_shell_ckbtn, False, True, 5) _boxes[1].pack_start(_for_msf_label, False, True, 5) _boxes[1].pack_start(m._os_access_area_os_pwn_ckbtn, False, True, 5) _boxes[1].pack_start(m._os_access_area_os_smbrelay_ckbtn, False, True, 5) _boxes[1].pack_start(m._os_access_area_os_bof_ckbtn, False, True, 5) _boxes[1].pack_start(m._os_access_area_priv_esc_ckbtn, False, True, 5) m._os_access_area_msf_path_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._os_access_area_msf_path_entry, 'choose local Metasploit install path'] ) _boxes[2].pack_start(m._os_access_area_msf_path_ckbtn, False, True, 5) _boxes[2].pack_start(m._os_access_area_msf_path_entry, True, True, 0) _boxes[2].pack_start(m._os_access_area_msf_path_chooser, False, True, 5) _boxes[2].pack_start(m._os_access_area_tmp_path_ckbtn, False, True, 5) _boxes[2].pack_start(m._os_access_area_tmp_path_entry, True, True, 5) _os_access_area_opts = Box(orientation=VERTICAL, spacing=6) for _ in _boxes: _os_access_area_opts.add(_) _f.add(_os_access_area_opts) return _f
def build_page1_file_write(self, m): _f = Frame.new(m._('Upload local file')) _boxes = [Box() for _ in range(3)] m._file_write_area_shared_lib_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._file_write_area_shared_lib_entry] ) _boxes[0].pack_start(m._file_write_area_udf_ckbtn, False, True, 5) _boxes[0].pack_start(m._file_write_area_shared_lib_ckbtn, False, True, 5) _boxes[0].pack_start(m._file_write_area_shared_lib_entry, True, True, 0) _boxes[0].pack_start(m._file_write_area_shared_lib_chooser, False, True, 5) m._file_write_area_file_write_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._file_write_area_file_write_entry] ) _boxes[1].pack_start(m._file_write_area_file_write_ckbtn, False, True, 5) _boxes[1].pack_start(m._file_write_area_file_write_entry, True, True, 0) _boxes[1].pack_start(m._file_write_area_file_write_chooser, False, True, 5) _boxes[2].pack_start(m._file_write_area_file_dest_ckbtn, False, True, 5) _boxes[2].pack_start(m._file_write_area_file_dest_entry, True, True, 5) _file_write_area_opts = Box(orientation=VERTICAL, spacing=6) for _ in _boxes: _file_write_area_opts.pack_start(_, False, True, 5) _f.add(_file_write_area_opts) return _f
def __init__(self, parent, autofill, root, *args, **kwargs): Frame.__init__(self, parent, *args, **kwargs) self.parent = parent self.root = root self.autofill = autofill self.config(padx=24, pady=24) self.gender = 'unknown' self.new_person_id = None self.role_person_edited = False self.findings_roles_id = None self.rc_menu = RightClickMenu(self.root) self.make_widgets()
def __init__(self, master, main, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.master = master self.root = main.root self.canvas = main.canvas self.content = main self.canvas_docs = main.canvas_docs self.content_docs = main.content_docs self.all_fonts = font.families() conn = sqlite3.connect(current_file) cur = conn.cursor() cur.execute(select_font_scheme) font_scheme = cur.fetchall() cur.close() conn.close() self.font_scheme = list(font_scheme[0]) self.make_widgets()
def build_page2(self): ''' 用subprocess不可实现与sqlmap的交互! 不管是多线程, 同步还是异步, 都不行, 只能使用pty ''' box = Box(orientation=VERTICAL, spacing=6) box.set_border_width(10) _row1 = Box(spacing=6) m._page2_respwan_btn.connect('clicked', self._handlers.respawn_terminal) m._page2_right_btn.connect("button-press-event", self.on_right_click) # can not disable # m._page2_right_btn.set_sensitive(False) self._build_page2_context() _row1.pack_start(m._page2_respwan_btn, False, True, 0) _row1.pack_start(m._page2_right_btn, False, True, 0) _row2 = Frame() # equals: _pty = m._page2_terminal.pty_new_sync(Vte.PtyFlags.DEFAULT) _pty = Vte.Pty.new_sync(Vte.PtyFlags.DEFAULT) m._page2_terminal.set_pty(_pty) m._page2_terminal.connect('key_press_event', self.on_clipboard_by_key) m._page2_terminal.connect("button-press-event", self.on_right_click, m._page2_right_btn) # https://stackoverflow.com/questions/55105447/virtual-python-shell-with-vte-pty-spawn-async # https://gtk-d.dpldocs.info/vte.Pty.Pty.spawnAsync.html # API手册上的该方法签名有问题, 与实际的对不上 # 最后一个参数为回调函数, 是必填项 _pty.spawn_async(str(Path.home()), [self._handlers.shell], None, GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None, -1, None, lambda pty, task: None) _scrolled = g.ScrolledWindow() _scrolled.set_policy(g.PolicyType.NEVER, g.PolicyType.ALWAYS) _scrolled.add(m._page2_terminal) _row2.add(_scrolled) box.pack_start(_row1, False, True, 5) box.pack_end(_row2, True, True, 0) return box
def build_page1_enumeration_enum(self, m): _f = Frame.new(m._('Enumeration')) _grid = g.Grid(column_spacing = 20, margin_left = 5, margin_right = 5) for _x in range(len(m._enum_area_opts_ckbtns)): for _y in range(len(m._enum_area_opts_ckbtns[_x])): _grid.attach(m._enum_area_opts_ckbtns[_x][_y], _x, _y, 1, 1) _f.add(_grid) return _f
def _build_page1_request_data(self, m): f = Frame.new('HTTP data') _boxes = [Box() for _ in range(8)] _boxes[0].pack_start(m._request_area_method_ckbtn, False, True, 5) _boxes[0].pack_start(m._request_area_method_entry, False, True, 5) _boxes[0].pack_start(m._request_area_param_del_ckbtn, False, True, 5) _boxes[0].pack_start(m._request_area_param_del_entry, False, True, 5) _boxes[0].pack_start(m._request_area_chunked_ckbtn, False, True, 5) _boxes[1].pack_start(m._request_area_post_ckbtn, False, True, 5) _boxes[1].pack_start(m._request_area_post_entry, True, True, 5) _boxes[2].pack_start(g.Separator.new(HORIZONTAL), True, True, 5) _boxes[3].pack_start(m._request_area_cookie_ckbtn, False, True, 5) _boxes[3].pack_start(m._request_area_cookie_entry, True, True, 5) _boxes[3].pack_start(m._request_area_cookie_del_ckbtn, False, True, 5) _boxes[3].pack_start(m._request_area_cookie_del_entry, False, True, 5) m._request_area_load_cookies_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._request_area_load_cookies_entry]) _boxes[4].pack_start(m._request_area_load_cookies_ckbtn, False, True, 5) _boxes[4].pack_start(m._request_area_load_cookies_entry, True, True, 0) _boxes[4].pack_start(m._request_area_load_cookies_chooser, False, True, 5) _boxes[4].pack_start(m._request_area_drop_set_cookie_ckbtn, False, True, 5) _boxes[5].pack_start(g.Separator.new(HORIZONTAL), True, True, 5) m._request_area_auth_file_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._request_area_auth_file_entry]) _boxes[6].pack_start(m._request_area_auth_type_ckbtn, False, True, 5) _boxes[6].pack_start(m._request_area_auth_type_entry, True, True, 5) _boxes[6].pack_start(m._request_area_auth_cred_ckbtn, False, True, 5) _boxes[6].pack_start(m._request_area_auth_cred_entry, True, True, 5) _boxes[6].pack_start(m._request_area_auth_file_ckbtn, False, True, 5) _boxes[6].pack_start(m._request_area_auth_file_entry, True, True, 0) _boxes[6].pack_start(m._request_area_auth_file_chooser, False, True, 5) _boxes[7].pack_start(m._request_area_csrf_method_ckbtn, False, True, 5) _boxes[7].pack_start(m._request_area_csrf_method_entry, False, True, 5) _boxes[7].pack_start(m._request_area_csrf_token_ckbtn, False, True, 5) _boxes[7].pack_start(m._request_area_csrf_token_entry, True, True, 5) _boxes[7].pack_start(m._request_area_csrf_url_ckbtn, False, True, 5) _boxes[7].pack_start(m._request_area_csrf_url_entry, True, True, 5) _request_data_opts = Box(orientation=VERTICAL, spacing=5) for _ in _boxes: _request_data_opts.add(_) f.add(_request_data_opts) return f
def _build_page1_setting_detection(self, m): f = Frame.new('探测选项') _boxes = [Box() for _ in range(9)] m._detection_area_level_ckbtn.connect('clicked', self.cb_single, m._inject_area_param_ckbtn) _boxes[0].pack_start(m._detection_area_level_ckbtn, False, True, 5) _boxes[0].pack_start(m._detection_area_level_scale, True, True, 5) _boxes[1].pack_start(m._detection_area_risk_ckbtn, False, True, 5) _boxes[1].pack_start(m._detection_area_risk_scale, True, True, 10) _boxes[2].pack_start(m._detection_area_str_ckbtn, False, True, 5) _boxes[2].pack_end(m._detection_area_str_entry, True, True, 5) _boxes[3].pack_start(m._detection_area_not_str_ckbtn, False, True, 5) _boxes[3].pack_end(m._detection_area_not_str_entry, True, True, 5) _boxes[4].pack_start(m._detection_area_re_ckbtn, False, True, 5) _boxes[4].pack_end(m._detection_area_re_entry, True, True, 5) _boxes[5].pack_start(m._detection_area_code_ckbtn, False, True, 5) _boxes[5].pack_start(m._detection_area_code_entry, False, True, 5) m._detection_area_text_only_ckbtn.connect( 'clicked', self.cb_single, m._optimize_area_null_connect_ckbtn) m._detection_area_text_only_ckbtn.connect( 'clicked', self.cb_single, m._detection_area_titles_ckbtn) m._detection_area_titles_ckbtn.connect( 'clicked', self.cb_single, m._detection_area_text_only_ckbtn) _boxes[6].pack_start(m._detection_area_text_only_ckbtn, False, True, 5) _boxes[6].pack_start(m._detection_area_titles_ckbtn, True, False, 5) _boxes[6].pack_start(m._detection_area_smart_ckbtn, False, True, 5) _boxes[7].pack_start(g.Separator.new(HORIZONTAL), True, True, 5) _boxes[8].set_spacing(6) _level_note = label(label='Level 1(默认): 所有GET, POST参数\n' 'Level 2 追加: Cookie\n' 'Level 3 追加: User-Agent/Referer\n' 'Level 4 追加: 啥?\n' 'Level 5 追加: Host报头', halign=g.Align.START) _risk_note = label(label='Risk 1(默认): 基本无风险\n' 'Risk 2 追加: 大量时间型盲注\n' 'Risk 3 追加: OR型布尔盲注', halign=g.Align.START) # _risk_note.override_background_color(g.StateFlags.NORMAL, d.RGBA(255, 0, 0, 1)) _boxes[8].pack_start(_level_note, True, True, 5) _boxes[8].pack_start(_risk_note, True, True, 5) _detection_area_opts = Box(orientation=VERTICAL, spacing=3) for _ in _boxes: _detection_area_opts.add(_) f.add(_detection_area_opts) return f
def reorder_notes(self): ''' ''' if self.toc.size() < 2: return self.order_dlg = Toplevel(self) self.order_dlg.grab_set() self.order_dlg.protocol('WM_DELETE_WINDOW', self.ignore_changes) self.order_dlg.bind('<Return>', self.save_close_reorder_dlg) self.order_dlg.bind('<Escape>', self.ignore_changes) self.order_dlg.grid_columnconfigure(0, weight=1) self.order_dlg.title('Reorder Subtopics') instrux = ('Tab or Ctrl+Tab selects movable subtopic.\n' 'Arrow keys change subtopic order up or down.') top = LabelH3(self.order_dlg, text=instrux, anchor='center') self.labels = Frame(self.order_dlg) e = 0 for subtopic in self.subtopics: lab = LabelMovable(self.labels, text=subtopic, anchor='w') if e == 0: first = lab e += 1 lab.grid(column=0, row=e, padx=3, sticky='ew') first.focus_set() close2 = Button(self.order_dlg, text='OK', command=self.save_close_reorder_dlg) top.grid(column=0, row=0, pady=(24, 0), padx=24, columnspan=2) self.labels.grid(column=0, row=1, columnspan=2, padx=24, pady=24) self.labels.grid_columnconfigure(0, weight=1) close2.grid(column=1, row=2, sticky='se', padx=12, pady=(0, 12)) center_window(self.order_dlg)
def build_page1_other_misc(self, m): _f = Frame.new(m._('Misc')) _boxes = [Box() for _ in range(5)] m._misc_area_purge_ckbtn.get_children()[0].set_use_markup(True) _boxes[0].pack_start(m._misc_area_skip_heuristics_ckbtn, False, True, 5) _boxes[0].pack_start(m._misc_area_skip_waf_ckbtn, False, True, 5) _boxes[0].pack_start(m._misc_area_unstable_ckbtn, False, True, 5) _boxes[0].pack_start(m._misc_area_list_tampers_ckbtn, False, True, 5) _boxes[0].pack_start(m._misc_area_sqlmap_shell_ckbtn, False, True, 5) _boxes[0].pack_start(m._misc_area_disable_color_ckbtn, False, True, 5) _boxes[0].pack_start(m._general_area_eta_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_gpage_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_gpage_spinbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_beep_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_offline_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_purge_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_dependencies_ckbtn, False, True, 5) _boxes[1].pack_start(m._misc_area_update_ckbtn, False, True, 5) m._misc_area_tmp_dir_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._misc_area_tmp_dir_entry, 'choose temp dir'] ) _boxes[2].pack_start(m._misc_area_alert_ckbtn, False, True, 5) _boxes[2].pack_start(m._misc_area_alert_entry, True, True, 5) _boxes[2].pack_start(m._misc_area_tmp_dir_ckbtn, False, True, 5) _boxes[2].pack_start(m._misc_area_tmp_dir_entry, True, True, 0) _boxes[2].pack_start(m._misc_area_tmp_dir_chooser, False, True, 5) _boxes[3].pack_start(m._misc_area_answers_ckbtn, False, True, 5) _boxes[3].pack_start(m._misc_area_answers_entry, True, True, 5) _boxes[3].pack_start(m._misc_area_z_ckbtn, False, True, 5) _boxes[3].pack_start(m._misc_area_z_entry, True, True, 5) m._misc_area_results_file_chooser.connect( 'clicked', self._handlers.set_file_entry_text, [m._misc_area_results_file_entry] ) _boxes[4].pack_start(m._misc_area_results_file_ckbtn, False, True, 5) _boxes[4].pack_start(m._misc_area_results_file_entry, True, True, 0) _boxes[4].pack_start(m._misc_area_results_file_chooser, False, True, 5) _page1_other_misc_opts = Box(orientation=VERTICAL, spacing=6) for _ in _boxes: _page1_other_misc_opts.add(_) _f.add(_page1_other_misc_opts) return _f
def __init__( self, master, notebook, graphics_tab, root, canvas, *args, **kwargs): Frame.__init__(self, master, *args, **kwargs) self.parent = master self.nbook = notebook self.t7 = graphics_tab self.root = root self.canvas = canvas self.counter = 0 self.thumb_labels = [] self.width_strings = [] self.height_strings = [] formats = make_formats_dict() self.current_person = get_current_person()[0] set_window_max_size(self.parent) self.filter_pix_data() self.make_widgets()
def build_page1_enumeration_brute_force(self, m): _f = Frame.new(m._('Brute force')) _brute_force_area_opts = Box(orientation=VERTICAL) _row1 = Box() _row1.pack_start(label.new(m._('check existence of:')), False, True, 10) _row1.pack_start(m._brute_force_area_common_tables_ckbtn, False, True, 0) _row1.pack_start(m._brute_force_area_common_columns_ckbtn, False, True, 5) _row1.pack_start(m._brute_force_area_common_files_ckbtn, False, True, 0) _brute_force_area_opts.pack_start(_row1, False, True, 5) _f.add(_brute_force_area_opts) return _f