diff --git a/da.py b/da.py deleted file mode 100644 index c6c5621..0000000 --- a/da.py +++ /dev/null @@ -1,73 +0,0 @@ -import gi -gi.require_version('Gtk', '3.0') -from gi.repository import Gtk - -class FileChooserWindow(Gtk.Window): - - def __init__(self): - Gtk.Window.__init__(self, title="FileChooser Example") - - box = Gtk.Box(spacing=6) - self.add(box) - - button1 = Gtk.Button("Choose File") - button1.connect("clicked", self.on_file_clicked) - box.add(button1) - - button2 = Gtk.Button("Choose Folder") - button2.connect("clicked", self.on_folder_clicked) - box.add(button2) - - def on_file_clicked(self, widget): - dialog = Gtk.FileChooserDialog("Please choose a file", self, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) - - self.add_filters(dialog) - - response = dialog.run() - if response == Gtk.ResponseType.OK: - print("Open clicked") - print("File selected: " + dialog.get_filename()) - elif response == Gtk.ResponseType.CANCEL: - print("Cancel clicked") - - dialog.destroy() - - def add_filters(self, dialog): - filter_text = Gtk.FileFilter() - filter_text.set_name("Text files") - filter_text.add_mime_type("text/plain") - dialog.add_filter(filter_text) - - filter_py = Gtk.FileFilter() - filter_py.set_name("Python files") - filter_py.add_mime_type("text/x-python") - dialog.add_filter(filter_py) - - filter_any = Gtk.FileFilter() - filter_any.set_name("Any files") - filter_any.add_pattern("*") - dialog.add_filter(filter_any) - - def on_folder_clicked(self, widget): - dialog = Gtk.FileChooserDialog("Please choose a folder", self, - Gtk.FileChooserAction.SELECT_FOLDER, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - "Select", Gtk.ResponseType.OK)) - dialog.set_default_size(800, 400) - - response = dialog.run() - if response == Gtk.ResponseType.OK: - print("Select clicked") - print("Folder selected: " + dialog.get_filename()) - elif response == Gtk.ResponseType.CANCEL: - print("Cancel clicked") - - dialog.destroy() - -win = FileChooserWindow() -win.connect("delete-event", Gtk.main_quit) -win.show_all() -Gtk.main() \ No newline at end of file diff --git a/gui.glade b/gui.glade index d356480..37e050e 100644 --- a/gui.glade +++ b/gui.glade @@ -2,6 +2,90 @@ + + False + dialog + + + False + vertical + 2 + + + False + end + + + + + + choose + True + True + True + + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + + + False + dialog + + + False + vertical + 2 + + + False + end + + + + + + choose + True + True + True + + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + False @@ -145,7 +229,7 @@ True True True - + 1 @@ -289,6 +373,7 @@ True False Result + 1 diff --git a/gui.glade~ b/gui.glade~ new file mode 100644 index 0000000..3bcae96 --- /dev/null +++ b/gui.glade~ @@ -0,0 +1,350 @@ + + + + + + False + dialog + + + False + vertical + 2 + + + False + end + + + + + + choose + True + True + True + + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + + + False + + + True + True + + + True + False + True + True + + + True + False + Target + + + 0 + 0 + + + + + target_in + True + True + http://10.111.113.83/dvwa/vulnerabilities/brute/ + + + + 1 + 0 + + + + + True + False + xPathLogin + + + 0 + 1 + + + + + True + False + xPathPassword + + + 0 + 2 + + + + + True + False + xPathAcceptButton + + + 0 + 3 + + + + + True + False + xPathSuccessAuth + + + 0 + 4 + + + + + True + False + xPathFailAuth + + + 0 + 5 + + + + + True + False + selBrowserString + + + 0 + 6 + + + + + True + False + usersFile + + + 0 + 7 + + + + + True + False + Password + + + 0 + 8 + + + + + Select + True + True + True + + + + 1 + 7 + + + + + Select + True + True + True + + + + 1 + 8 + + + + + True + True + //input[@name='username'] + + + 1 + 1 + + + + + True + True + //input[@name='password'] + + + 1 + 2 + + + + + True + True + //input[@name='Login'] + + + 1 + 3 + + + + + True + True + //img[@src='http://10.111.113.83/dvwa/hackable/users/admin.jpg'] + + + 1 + 4 + + + + + True + True + //pre[contains(text(), 'Username and/or password incorrect.'] + + + 1 + 5 + + + + + True + True + *chrome + + + 1 + 6 + + + + + True + False + brutThreads + + + 0 + 9 + + + + + True + True + 1 + + + 1 + 9 + + + + + Start + True + True + True + + + + 1 + 10 + + + + + True + False + + + 0 + 10 + + + + + + + True + False + Config + + + False + + + + + True + True + + + 1 + + + + + True + False + Result + + + + 1 + False + + + + + + + + + + + + diff --git a/main.py b/main.py index 991fd27..88f7c63 100644 --- a/main.py +++ b/main.py @@ -16,6 +16,7 @@ gi.require_version('Gtk', '3.0') from gi.repository import Gtk +from gi.repository import Notify class Handler: @@ -39,6 +40,10 @@ def __init__(self, ): self.timeout = 1 self.randomCredentials = False self.randomGeneratorParameter = [100, 8, 1, 1, 1, 0, 0, 0] + self.fd = open('/home/korolr/Desktop/python/gui_test/result.txt', 'r') + self.xPathFailAuth = builder.get_object("Text").get_buffer().set_text(self.fd.read()) + self.file_ch = builder.get_object("file_ch") + self.file_ch_id1 = builder.get_object("file_ch1") def onDeleteWindow(self, *args): Gtk.main_quit(*args) @@ -47,7 +52,18 @@ def btn_start(self, button): self.Main() def user_file(self, button): - pass + self.file_ch.show_all() + + def user_pswd(self, button): + self.file_ch_id1.show_all() + + def choose_btn(self, button): + self.usersFile = self.file_ch.get_filename() + self.file_ch.close() + + def choose_btn1(self, button): + self.passwordsFile = self.file_ch_id1.get_filename() + self.file_ch_id1.close() def Main(self): """ @@ -548,5 +564,4 @@ def Bruter(self, instance=0, opTimeout=3, loginField="", passwordField="", accep window = builder.get_object("window1") window.show_all() - Gtk.main() diff --git a/result.txt b/result.txt index dd7d6f8..dc5daa5 100644 --- a/result.txt +++ b/result.txt @@ -1,12 +1 @@ - -12:33:17 25.09.2012 - Thread #0, Bruter finished check for -users = ['admin', ..., ''], 5 items, -passwords = ['', ..., 'user'], 4 items. -Actual time worked: 0:00:00.386000 -Suitable credentials: {'admin': ''} - -12:34:28 25.09.2012 - Thread #1, Bruter finished check for -users = ['admin', ..., ''], 5 items, -passwords = ['guest', ..., 'qwerty'], 5 items. -Actual time worked: 0:01:07.565000 -Bruter can't find suitable credentials. +12:33:17 25.09.2012 - Thread #0, Bruter finished check f