Dorks Generator
Today we will analyze a program for generating dorks that can be used to hack databases using SQL Injection through other software. In this article I talked about creating dorks in another program, and how you can use them.
The appearance of the program in Windows

Frontend program in kali

The graphical shell is made in Tkinter, which is part of Python and does not require separate installation. The program takes up 276 lines. It was not so easy to write, but very interesting.
Let's start analyzing:
First, we import all the necessary modules and add icons in BASE64 format. I also converted the icons in my program
We create the main Tk window and set its dimensions, as well as prohibit changing them. We write down information about the version, name
We write a function that will be executed when the Open URLs button is pressed. This is actually opening a file, counting the number of addresses and inserting this data into the windows.
Next, we create a normalizer function that runs when the Normal button is pressed. This is the most complex section of the code, as many actions are collected here at once.
The first thing that is done here is to reset the name, type, and delete counting windows, since they may no longer be empty. To make regular expressions work, we create patterns.
Patterns will help to split the address and extract the parts we need from it. url_name.get passes the loaded addresses, which we split into 3 parts and write these parts into 3 empty lists. But since the addresses are full of duplicates, we will delete them using set. After cleaning up the duplicates, we insert the data into the corresponding columns using insert.
In the final part of the function, the counting from the windows is deleted again and new data is inserted. This is needed as a "foolproofing" when the user presses the normalization button more than once. In addition, the repeated pressing can be done intentionally, if the user decided to add some parameters manually at the last moment. Then the repeated processing will be performed correctly and the calculation will be correct.
The heart of the program
is the function for generating dorks. It is called when you click the Generate button. First, the columns are cleared and the data is inserted again. All the magic is in the triple for loop. We run all three columns through the loops, simultaneously gluing their values in the order of the columns. At the end, we clear the window for dorks and insert them there.
The shortest function, called when you click the Help button. It opens the help file.
And this is the most understandable function - clearing all 10 windows. It is called by pressing the Clean button.
Function of random mixing of dorks. It is executed by pressing the Random button. Since random.shuffle will spoil our entire list and turn it into one line, we will have to restore the entry in the column by running the data through a loop.
A very simple function for saving the result to a file. Called when you click the Save button.
We are done with functions. Now let's move on to other things. The icons that we recorded at the very beginning need to be launched somehow. For this, we will use PhotoImage where data takes the variable name of a specific icon as a parameter.
Next, we will write the Label widgets, that is, the mark, this will allow us to make inscriptions above the Name, Type, Parameter, Dorks columns. We will place the created marks in the direction we need according to the grid and cardinal directions, and also set the necessary indents.
Let's create buttons where we will assign a call to the required function to the button using command.
Now let's make Entry - a single-line text field. The calculations are output to the required field.
And finally
in the final part of the code we will create widgets Text - a multi-line text field. The received values URL, Name, Type, Parameter, Dorks are inserted into these widgets. The last line root.mainloop() is mandatory, without it the shell will not start.
Since Tkinter uses characters rather than pixels, the sizes depend very much on the size of the text used in the program. In this program, Courier was used because the default font was too big and did not fit very well. Because Windows and Linux use different approaches to display, 2 versions had to be made for the correct appearance of the program in both operating systems. They are slightly different, only the sizes in 3 places and the different way of calling help have been corrected.
Today we will analyze a program for generating dorks that can be used to hack databases using SQL Injection through other software. In this article I talked about creating dorks in another program, and how you can use them.
The appearance of the program in Windows

Frontend program in kali

The graphical shell is made in Tkinter, which is part of Python and does not require separate installation. The program takes up 276 lines. It was not so easy to write, but very interesting.
Let's start analyzing:
First, we import all the necessary modules and add icons in BASE64 format. I also converted the icons in my program
Python:
import random
import subprocess
from tkinter import *
from tkinter import filedialog as fd
icon = '''
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAYtSURBVHjanJdLrF11FcZ/a/3/e+97bgGl8hhYaaLE1IhG1MQEMGJVfEFggIPGYJw5UOLAgQkafCQYE4kjp0YngkCCBmI0wWeY6AAwkqJpbNVUkCZepaW95+79f3wOzpO7b5Ne9+SenHvWt9fjW+tby+65/n6A6uzrkYHkXz8R7r4/4ZmlveZ/7SKW1UAVp1a3fPQF256UkKMuarDHk6a9zPtJbtNV2STrO4b2Uq2rU/qMZ1eTCJdZCkbfuGxXCFwkFNnaxxK2TX1r0HcL40sLRcLpO1JjOVBCaqpfIoBkBpCjLEe2Tcjmfgmg7HI97AWC8Oqg3JigBErITo1Un71BhuQgI1lk8WX1shvQqmULVGdoc75w+szWua3/vHKhmHxy8NrD1x+6siOpserTCUOb425vTEP0Uputl589fuLEi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=
'''
help = '''
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAghJREFUeNqUk02rEmEUx8+MjZp6Jw03InlXiVYELpyQAne6yY2ug8BaRItc9B3atM0Whdt2lz5AS0VUMKgs8aogIbrRhYr5Mvr0P8MYF5l7oQM/npfzMuec54xE1hIDz8Ed8/wTfABfjw0lC+dHLpfrbTwevx0IBFS+GI1Gs0ajcb5cLl/jWL5obLMI8OYhxO/3e7GX9/u9fB3i8/nUwWBwA3dnF43lI+c4iHi93pPNZkPMdrs1QIAT1pk2l8p3TdMW6XRaTKfTf5TLZZFKpQTr2OaqEh4Eg8G7brdbabfbBEfa7XYUi8Wo1WrRcDjUwRfYfb6shKf1er0qSZLe7/ep1+vRbDaj8XhMk8lEZx3bXNUDlmKn05nwJhKJUDKZpFKpRLVaje+Kx8ZWAc663e5CURTK5/PEpSBtzmZx/AIs1yzOLw+9KRQKhHIIr3jo1yvwDuhWL6CBT+A8l8uJTCYjMECiUqkY+2w2K1hn2mjHr/AE01cMhUL3E4lEQNd1kmWZotEoN4+azaYxE+Fw+CYGK7Rerx9jNqbw+3YY5R9wjMJJttvtRsq8zudzQ+nxeIwAq9XKGCo87b5arf6C6h7X7AKnTqeT/cnhcBgBeFVVlYQQxBnZbDajH2yDO27+KftK5p/3AjwDf8DCZAk2ZoYO80Me4Abc1Y/gPQdQwC1z/R/Zgt9/BRgANHrYMn3ClUIAAAAASUVORK5CYII=
'''
We create the main Tk window and set its dimensions, as well as prohibit changing them. We write down information about the version, name
Python:
root = Tk()
__version__ = 'Version: 1.0'
root.resizable(False, False)
root.title("** GenDorks by explorer ** " + __version__)
root.geometry("664x350")
We write a function that will be executed when the Open URLs button is pressed. This is actually opening a file, counting the number of addresses and inserting this data into the windows.
Python:
def insert_url():
file_name = fd.askopenfilename()
try:
f = open(file_name)
s = f.read()
url_name.insert(1.0, s)
count_url.delete('0', END)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
f.close()
except FileNotFoundError:
pass
Next, we create a normalizer function that runs when the Normal button is pressed. This is the most complex section of the code, as many actions are collected here at once.
The first thing that is done here is to reset the name, type, and delete counting windows, since they may no longer be empty. To make regular expressions work, we create patterns.
Patterns will help to split the address and extract the parts we need from it. url_name.get passes the loaded addresses, which we split into 3 parts and write these parts into 3 empty lists. But since the addresses are full of duplicates, we will delete them using set. After cleaning up the duplicates, we insert the data into the corresponding columns using insert.
In the final part of the function, the counting from the windows is deleted again and new data is inserted. This is needed as a "foolproofing" when the user presses the normalization button more than once. In addition, the repeated pressing can be done intentionally, if the user decided to add some parameters manually at the last moment. Then the repeated processing will be performed correctly and the calculation will be correct.
Python:
def normal():
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
pattern = r"\b\w+="
pattern2 = r"\.\w+\?"
pattern3 = r"\/\w+\."
x = url_name.get(1.0, END)
host = x[0:-2].replace('\n', ',').split(',')
one = []
two = []
trio = []
for item in host:
string = item.replace('://', '')
result3 = re.findall(pattern3, string)
result2 = re.findall(pattern2, string)
result = re.findall(pattern, string)
one += result3
two += result2
trio += result
a = set(one)
b = set(two)
c = set(trio)
for n in a:
name.insert(END, n[1:-1] + '\n')
for p in b:
type.insert(END, p + '\n')
for r in c:
para.insert(END, r + '\n')
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_url.delete('0', END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
The heart of the program
Python:
def gen():
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
dorks_name.delete(1.0, END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
one = name.get(1.0, END)
a = one[0:-2].replace('\n', ',').split(',')
two = type.get(1.0, END)
b = two[0:-2].replace('\n', ',').split(',')
trio = para.get(1.0, END)
c = trio[0:-2].replace('\n', ',').split(',')
for x in a:
for y in b:
for z in c:
dork = (x + y + z)
dorks_name.insert(END, dork + '\n')
count_dork.delete('0', END)
s = dorks_name.get(1.0, END)
line = len(s.split())
count_dork.insert(END, line)
The shortest function, called when you click the Help button. It opens the help file.
Python:
def helpmy():
subprocess.call(['notepad.exe', 'help.txt'])
And this is the most understandable function - clearing all 10 windows. It is called by pressing the Clean button.
Python:
def clean():
count_url.delete('0', END)
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
url_name.delete(1.0, END)
dorks_name.delete(1.0, END)
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
Python:
def ran():
s = dorks_name.get(1.0, END)
mix = s[0:-2].replace('\n', ',').split(',')
random.shuffle(mix)
dorks_name.delete(1.0, END)
for z in mix:
a = z + '\n'
dorks_name.insert(END, a)
A very simple function for saving the result to a file. Called when you click the Save button.
Code:
def save():
file_name = fd.asksaveasfilename(filetypes=(("TXT files", "*.txt"),
("HTML files", "*.html;*.htm"),
("All files", "*.*")), defaultextension='')
try:
f = open(file_name, 'w')
s = dorks_name.get(1.0, END)
f.write(s)
f.close()
except FileNotFoundError:
pass
We are done with functions. Now let's move on to other things. The icons that we recorded at the very beginning need to be launched somehow. For this, we will use PhotoImage where data takes the variable name of a specific icon as a parameter.
Python:
savebtn = PhotoImage(data=icons)
mixbtn = PhotoImage(data=mix)
broombtn = PhotoImage(data=broom)
helpbtn = PhotoImage(data=help)
img = PhotoImage(data=icon)
Next, we will write the Label widgets, that is, the mark, this will allow us to make inscriptions above the Name, Type, Parameter, Dorks columns. We will place the created marks in the direction we need according to the grid and cardinal directions, and also set the necessary indents.
Python:
name_label = Label(text="Name :")
name_label.grid(row=5, column=1, pady=5, sticky="sw")
type_label = Label(text="Type :")
type_label.grid(row=5, column=3, pady=5, sticky="sw")
para_label = Label(text="Parameter :")
para_label.grid(row=5, column=5, pady=5, sticky="sw")
dork_label = Label(text="Dorks :")
dork_label.grid(row=5, column=7, pady=5, sticky="sw")
Let's create buttons where we will assign a call to the required function to the button using command.
Python:
open_button = Button(text="Open URLs", width=10, command=insert_url)
open_button.grid(row=1, column=0, padx=10, pady=5, sticky="n")
norm_button = Button(text="Normal", width=10, command=normal)
norm_button.grid(row=2, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text="Generate", width=10, command=gen)
gens_button.grid(row=3, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text=" Clean ", width=10, image=broombtn, compound="left", command=clean)
gens_button.grid(row=6, column=0, padx=10, pady=12, sticky="swe")
help_button = Button(text=" Help ", width=10, image=helpbtn, compound="left", command=helpmy)
help_button.grid(row=6, column=0, padx=10, pady=47, sticky="swe")
open_button = Button(text=" Random ", width=10, image=mixbtn, compound="left", command=ran)
open_button.grid(row=6, column=7, pady=47, padx=32, sticky="swe")
save_button = Button(text=" Save ", width=10, image=savebtn, compound="left", command=save)
save_button.grid(row=6, column=7, pady=12, padx=32, sticky="swe")
Now let's make Entry - a single-line text field. The calculations are output to the required field.
Python:
count_url = Entry(width=12, justify=CENTER)
count_url.grid(row=0, column=0, padx=10, pady=5, sticky="n")
count_name = Entry(width=4, justify=CENTER)
count_name.grid(row=5, column=1, pady=5, sticky="se")
count_type = Entry(width=4, justify=CENTER)
count_type.grid(row=5, column=3, pady=5, sticky="se")
count_para = Entry(width=4, justify=CENTER)
count_para.grid(row=5, column=5, pady=5, sticky="se")
count_dork = Entry(width=8, justify=CENTER)
count_dork.grid(row=5, column=7, pady=5, sticky="s")
And finally
Python:
dorks_name.configure(xscrollcommand=scroli.set)
name = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
name.grid(row=6, column=1, sticky='nswe')
scrols = Scrollbar(root, command=name.yview)
scrols.grid(row=6, column=2, sticky='nsw')
name.configure(yscrollcommand=scrols.set)
scrolt = Scrollbar(root, orient=HORIZONTAL, command=name.xview)
scrolt.grid(row=7, column=1, sticky='sew')
name.configure(xscrollcommand=scrolt.set)
type = Text(root, wrap=NONE, font="Courier 9", width=10, height=8)
type.grid(row=6, column=3, sticky='nswe')
scro = Scrollbar(root, command=type.yview)
scro.grid(row=6, column=4, sticky='nsw')
type.configure(yscrollcommand=scro.set)
scroltt = Scrollbar(root, orient=HORIZONTAL, command=type.xview)
scroltt.grid(row=7, column=3, sticky='sew')
type.configure(xscrollcommand=scroltt.set)
para = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
para.grid(row=6, column=5, sticky='nswe')
scr = Scrollbar(root, command=para.yview)
scr.grid(row=6, column=6, sticky='nse')
para.configure(yscrollcommand=scr.set)
scroltz = Scrollbar(root, orient=HORIZONTAL, command=para.xview)
scroltz.grid(row=7, column=5, sticky='sew')
para.configure(xscrollcommand=scroltz.set)
root.tk.call('wm', 'iconphoto', root._w, img)
root.mainloop()
Since Tkinter uses characters rather than pixels, the sizes depend very much on the size of the text used in the program. In this program, Courier was used because the default font was too big and did not fit very well. Because Windows and Linux use different approaches to display, 2 versions had to be made for the correct appearance of the program in both operating systems. They are slightly different, only the sizes in 3 places and the different way of calling help have been corrected.
Python:
import random
import subprocess
from tkinter import *
from tkinter import filedialog as fd
icon = '''
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAYtSURBVHjanJdLrF11FcZ/a/3/e+97bgGl8hhYaaLE1IhG1MQEMGJVfEFggIPGYJw5UOLAgQkafCQYE4kjp0YngkCCBmI0wWeY6AAwkqJpbNVUkCZepaW95+79f3wOzpO7b5Ne9+SenHvWt9fjW+tby+65/n6A6uzrkYHkXz8R7r4/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VORK5CYII=
'''
root = Tk()
__version__ = 'Version: 1.0'
root.resizable(False, False)
root.title("** GenDorks by explorer ** " + __version__)
root.geometry("664x350")
def insert_url():
file_name = fd.askopenfilename()
try:
f = open(file_name)
s = f.read()
url_name.insert(1.0, s)
count_url.delete('0', END)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
f.close()
except FileNotFoundError:
pass
def normal():
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
pattern = r"\b\w+="
pattern2 = r"\.\w+\?"
pattern3 = r"\/\w+\."
x = url_name.get(1.0, END)
host = x[0:-2].replace('\n', ',').split(',')
one = []
two = []
trio = []
for item in host:
string = item.replace('://', '')
result3 = re.findall(pattern3, string)
result2 = re.findall(pattern2, string)
result = re.findall(pattern, string)
one += result3
two += result2
trio += result
a = set(one)
b = set(two)
c = set(trio)
for n in a:
name.insert(END, n[1:-1] + '\n')
for p in b:
type.insert(END, p + '\n')
for r in c:
para.insert(END, r + '\n')
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_url.delete('0', END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
def gen():
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
dorks_name.delete(1.0, END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
one = name.get(1.0, END)
a = one[0:-2].replace('\n', ',').split(',')
two = type.get(1.0, END)
b = two[0:-2].replace('\n', ',').split(',')
trio = para.get(1.0, END)
c = trio[0:-2].replace('\n', ',').split(',')
for x in a:
for y in b:
for z in c:
dork = (x + y + z)
dorks_name.insert(END, dork + '\n')
count_dork.delete('0', END)
s = dorks_name.get(1.0, END)
line = len(s.split())
count_dork.insert(END, line)
def helpmy():
subprocess.call(['notepad.exe', 'help.txt'])
def clean():
count_url.delete('0', END)
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
url_name.delete(1.0, END)
dorks_name.delete(1.0, END)
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
def ran():
s = dorks_name.get(1.0, END)
mix = s[0:-2].replace('\n', ',').split(',')
random.shuffle(mix)
dorks_name.delete(1.0, END)
for z in mix:
a = z + '\n'
dorks_name.insert(END, a)
def save():
file_name = fd.asksaveasfilename(filetypes=(("TXT files", "*.txt"),
("HTML files", "*.html;*.htm"),
("All files", "*.*")), defaultextension='')
try:
f = open(file_name, 'w')
s = dorks_name.get(1.0, END)
f.write(s)
f.close()
except FileNotFoundError:
pass
savebtn = PhotoImage(data=icons)
mixbtn = PhotoImage(data=mix)
broombtn = PhotoImage(data=broom)
helpbtn = PhotoImage(data=help)
img = PhotoImage(data=icon)
name_label = Label(text="Name :")
name_label.grid(row=5, column=1, pady=5, sticky="sw")
type_label = Label(text="Type :")
type_label.grid(row=5, column=3, pady=5, sticky="sw")
para_label = Label(text="Parameter :")
para_label.grid(row=5, column=5, pady=5, sticky="sw")
dork_label = Label(text="Dorks :")
dork_label.grid(row=5, column=7, pady=5, sticky="sw")
open_button = Button(text="Open URLs", width=10, command=insert_url)
open_button.grid(row=1, column=0, padx=10, pady=5, sticky="n")
norm_button = Button(text="Normal", width=10, command=normal)
norm_button.grid(row=2, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text="Generate", width=10, command=gen)
gens_button.grid(row=3, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text=" Clean ", width=10, image=broombtn, compound="left", command=clean)
gens_button.grid(row=6, column=0, padx=10, pady=12, sticky="swe")
help_button = Button(text=" Help ", width=10, image=helpbtn, compound="left", command=helpmy)
help_button.grid(row=6, column=0, padx=10, pady=47, sticky="swe")
open_button = Button(text=" Random ", width=10, image=mixbtn, compound="left", command=ran)
open_button.grid(row=6, column=7, pady=47, padx=32, sticky="swe")
save_button = Button(text=" Save ", width=10, image=savebtn, compound="left", command=save)
save_button.grid(row=6, column=7, pady=12, padx=32, sticky="swe")
count_url = Entry(width=12, justify=CENTER)
count_url.grid(row=0, column=0, padx=10, pady=5, sticky="n")
count_name = Entry(width=4, justify=CENTER)
count_name.grid(row=5, column=1, pady=5, sticky="se")
count_type = Entry(width=4, justify=CENTER)
count_type.grid(row=5, column=3, pady=5, sticky="se")
count_para = Entry(width=4, justify=CENTER)
count_para.grid(row=5, column=5, pady=5, sticky="se")
count_dork = Entry(width=8, justify=CENTER)
count_dork.grid(row=5, column=7, pady=5, sticky="s")
url_name = Text(root, wrap=NONE, font="Courier 9", width=52, height=1)
url_name.grid(row=0, column=1, columnspan=5, rowspan=4, sticky='nswe')
scrollb = Scrollbar(root, orient=VERTICAL, command=url_name.yview)
scrollb.grid(row=0, column=6, rowspan=4, sticky='nse')
url_name.configure(yscrollcommand=scrollb.set)
sc = Scrollbar(root, orient=HORIZONTAL, command=url_name.xview)
sc.grid(row=4, columnspan=5, column=1, sticky='sew')
url_name.configure(xscrollcommand=sc.set)
dorks_name = Text(root, wrap=NONE, font="Courier 9", width=22, height=1)
dorks_name.grid(row=0, column=7, rowspan=4, sticky='nswe')
scroll = Scrollbar(root, orient=VERTICAL, command=dorks_name.yview)
scroll.grid(row=0, column=8, rowspan=4, sticky='nse')
dorks_name.configure(yscrollcommand=scroll.set)
scroli = Scrollbar(root, orient=HORIZONTAL, command=dorks_name.xview)
scroli.grid(row=4, column=7, sticky='sew')
dorks_name.configure(xscrollcommand=scroli.set)
name = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
name.grid(row=6, column=1, sticky='nswe')
scrols = Scrollbar(root, command=name.yview)
scrols.grid(row=6, column=2, sticky='nsw')
name.configure(yscrollcommand=scrols.set)
scrolt = Scrollbar(root, orient=HORIZONTAL, command=name.xview)
scrolt.grid(row=7, column=1, sticky='sew')
name.configure(xscrollcommand=scrolt.set)
type = Text(root, wrap=NONE, font="Courier 9", width=10, height=8)
type.grid(row=6, column=3, sticky='nswe')
scro = Scrollbar(root, command=type.yview)
scro.grid(row=6, column=4, sticky='nsw')
type.configure(yscrollcommand=scro.set)
scroltt = Scrollbar(root, orient=HORIZONTAL, command=type.xview)
scroltt.grid(row=7, column=3, sticky='sew')
type.configure(xscrollcommand=scroltt.set)
para = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
para.grid(row=6, column=5, sticky='nswe')
scr = Scrollbar(root, command=para.yview)
scr.grid(row=6, column=6, sticky='nse')
para.configure(yscrollcommand=scr.set)
scroltz = Scrollbar(root, orient=HORIZONTAL, command=para.xview)
scroltz.grid(row=7, column=5, sticky='sew')
para.configure(xscrollcommand=scroltz.set)
root.tk.call('wm', 'iconphoto', root._w, img)
root.mainloop()
Python:
import random
import subprocess as sp
from tkinter import *
from tkinter import filedialog as fd
icon = '''
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAYtSURBVHjanJdLrF11FcZ/a/3/e+97bgGl8hhYaaLE1IhG1MQEMGJVfEFggIPGYJw5UOLAgQkafCQYE4kjp0YngkCCBmI0wWeY6AAwkqJpbNVUkCZepaW95+79f3wOzpO7b5Ne9+SenHvWt9fjW+tby+65/n6A6uzrkYHkXz8R7r4/4ZmlveZ/7SKW1UAVp1a3fPQF256UkKMuarDHk6a9zPtJbtNV2STrO4b2Uq2rU/qMZ1eTCJdZCkbfuGxXCFwkFNnaxxK2TX1r0HcL40sLRcLpO1JjOVBCaqpfIoBkBpCjLEe2Tcjmfgmg7HI97AWC8Oqg3JigBErITo1Un71BhuQgI1lk8WX1shvQqmULVGdoc75w+szWua3/vHKhmHxy8NrD1x+6siOp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8aHZdeMI4AAAAASUVORK5CYII=
'''
help = '''
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAghJREFUeNqUk02rEmEUx8+MjZp6Jw03InlXiVYELpyQAne6yY2ug8BaRItc9B3atM0Whdt2lz5AS0VUMKgs8aogIbrRhYr5Mvr0P8MYF5l7oQM/npfzMuec54xE1hIDz8Ed8/wTfABfjw0lC+dHLpfrbTwevx0IBFS+GI1Gs0ajcb5cLl/jWL5obLMI8OYhxO/3e7GX9/u9fB3i8/nUwWBwA3dnF43lI+c4iHi93pPNZkPMdrs1QIAT1pk2l8p3TdMW6XRaTKfTf5TLZZFKpQTr2OaqEh4Eg8G7brdbabfbBEfa7XYUi8Wo1WrRcDjUwRfYfb6shKf1er0qSZLe7/ep1+vRbDaj8XhMk8lEZx3bXNUDlmKn05nwJhKJUDKZpFKpRLVaje+Kx8ZWAc663e5CURTK5/PEpSBtzmZx/AIs1yzOLw+9KRQKhHIIr3jo1yvwDuhWL6CBT+A8l8uJTCYjMECiUqkY+2w2K1hn2mjHr/AE01cMhUL3E4lEQNd1kmWZotEoN4+azaYxE+Fw+CYGK7Rerx9jNqbw+3YY5R9wjMJJttvtRsq8zudzQ+nxeIwAq9XKGCo87b5arf6C6h7X7AKnTqeT/cnhcBgBeFVVlYQQxBnZbDajH2yDO27+KftK5p/3AjwDf8DCZAk2ZoYO80Me4Abc1Y/gPQdQwC1z/R/Zgt9/BRgANHrYMn3ClUIAAAAASUVORK5CYII=
'''
root = Tk()
__version__ = 'Version: 1.0'
root.resizable(False, False)
root.title("** GenDorks by explorer ** " + __version__)
root.geometry("686x354")
def insert_url():
file_name = fd.askopenfilename()
try:
f = open(file_name)
s = f.read()
url_name.insert(1.0, s)
count_url.delete('0', END)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
f.close()
except FileNotFoundError:
pass
def normal():
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
pattern = r"\b\w+="
pattern2 = r"\.\w+\?"
pattern3 = r"\/\w+\."
x = url_name.get(1.0, END)
host = x[0:-2].replace('\n', ',').split(',')
one = []
two = []
trio = []
for item in host:
string = item.replace('://', '')
result3 = re.findall(pattern3, string)
result2 = re.findall(pattern2, string)
result = re.findall(pattern, string)
one += result3
two += result2
trio += result
a = set(one)
b = set(two)
c = set(trio)
for n in a:
name.insert(END, n[1:-1] + '\n')
for p in b:
type.insert(END, p + '\n')
for r in c:
para.insert(END, r + '\n')
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_url.delete('0', END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
y = url_name.get(1.0, END)
line = (len(y.split()))
count_url.insert(END, line)
def gen():
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
dorks_name.delete(1.0, END)
s = name.get(1.0, END)
line = len(s.split())
count_name.insert(END, line)
s = type.get(1.0, END)
line = len(s.split())
count_type.insert(END, line)
s = para.get(1.0, END)
line = len(s.split())
count_para.insert(END, line)
one = name.get(1.0, END)
a = one[0:-2].replace('\n', ',').split(',')
two = type.get(1.0, END)
b = two[0:-2].replace('\n', ',').split(',')
trio = para.get(1.0, END)
c = trio[0:-2].replace('\n', ',').split(',')
for x in a:
for y in b:
for z in c:
dork = (x + y + z)
dorks_name.insert(END, dork + '\n')
count_dork.delete('0', END)
s = dorks_name.get(1.0, END)
line = len(s.split())
count_dork.insert(END, line)
def helpmy():
programName = "leafpad"
fileName = "help.txt"
sp.Popen([programName, fileName])
def clean():
count_url.delete('0', END)
count_name.delete('0', END)
count_type.delete('0', END)
count_para.delete('0', END)
count_dork.delete('0', END)
url_name.delete(1.0, END)
dorks_name.delete(1.0, END)
name.delete(1.0, END)
type.delete(1.0, END)
para.delete(1.0, END)
def ran():
s = dorks_name.get(1.0, END)
mix = s[0:-2].replace('\n', ',').split(',')
random.shuffle(mix)
dorks_name.delete(1.0, END)
for z in mix:
a = z + '\n'
dorks_name.insert(END, a)
def save():
file_name = fd.asksaveasfilename(filetypes=(("TXT files", "*.txt"),
("HTML files", "*.html;*.htm"),
("All files", "*.*")), defaultextension='')
try:
f = open(file_name, 'w')
s = dorks_name.get(1.0, END)
f.write(s)
f.close()
except FileNotFoundError:
pass
savebtn = PhotoImage(data=icons)
mixbtn = PhotoImage(data=mix)
broombtn = PhotoImage(data=broom)
helpbtn = PhotoImage(data=help)
img = PhotoImage(data=icon)
name_label = Label(text="Name :")
name_label.grid(row=5, column=1, pady=5, sticky="sw")
type_label = Label(text="Type :")
type_label.grid(row=5, column=3, pady=5, sticky="sw")
para_label = Label(text="Parameter :")
para_label.grid(row=5, column=5, pady=5, sticky="sw")
dork_label = Label(text="Dorks :")
dork_label.grid(row=5, column=7, pady=5, sticky="sw")
open_button = Button(text="Open URLs", width=10, command=insert_url)
open_button.grid(row=1, column=0, padx=10, pady=5, sticky="n")
norm_button = Button(text="Normal", width=10, command=normal)
norm_button.grid(row=2, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text="Generate", width=10, command=gen)
gens_button.grid(row=3, column=0, padx=10, pady=5, sticky="n")
gens_button = Button(text=" Clean ", width=10, image=broombtn, compound="left", command=clean)
gens_button.grid(row=6, column=0, padx=10, pady=12, sticky="swe")
help_button = Button(text=" Help ", width=10, image=helpbtn, compound="left", command=helpmy)
help_button.grid(row=6, column=0, padx=10, pady=47, sticky="swe")
open_button = Button(text=" Random ", width=10, image=mixbtn, compound="left", command=ran)
open_button.grid(row=6, column=7, pady=47, padx=22, sticky="swe")
save_button = Button(text=" Save ", width=10, image=savebtn, compound="left", command=save)
save_button.grid(row=6, column=7, pady=12, padx=22, sticky="swe")
count_url = Entry(width=12, justify=CENTER)
count_url.grid(row=0, column=0, padx=10, pady=5, sticky="n")
count_name = Entry(width=4, justify=CENTER)
count_name.grid(row=5, column=1, pady=5, sticky="se")
count_type = Entry(width=4, justify=CENTER)
count_type.grid(row=5, column=3, pady=5, sticky="se")
count_para = Entry(width=4, justify=CENTER)
count_para.grid(row=5, column=5, pady=5, sticky="se")
count_dork = Entry(width=8, justify=CENTER)
count_dork.grid(row=5, column=7, pady=5, sticky="s")
url_name = Text(root, wrap=NONE, font="Courier 9", width=52, height=1)
url_name.grid(row=0, column=1, columnspan=5, rowspan=4, sticky='nswe')
scrollb = Scrollbar(root, orient=VERTICAL, command=url_name.yview)
scrollb.grid(row=0, column=6, rowspan=4, sticky='nse')
url_name.configure(yscrollcommand=scrollb.set)
sc = Scrollbar(root, orient=HORIZONTAL, command=url_name.xview)
sc.grid(row=4, columnspan=5, column=1, sticky='sew')
url_name.configure(xscrollcommand=sc.set)
dorks_name = Text(root, wrap=NONE, font="Courier 9", width=22, height=1)
dorks_name.grid(row=0, column=7, rowspan=4, sticky='nswe')
scroll = Scrollbar(root, orient=VERTICAL, command=dorks_name.yview)
scroll.grid(row=0, column=8, rowspan=4, sticky='nse')
dorks_name.configure(yscrollcommand=scroll.set)
scroli = Scrollbar(root, orient=HORIZONTAL, command=dorks_name.xview)
scroli.grid(row=4, column=7, sticky='sew')
dorks_name.configure(xscrollcommand=scroli.set)
name = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
name.grid(row=6, column=1, sticky='nswe')
scrols = Scrollbar(root, command=name.yview)
scrols.grid(row=6, column=2, sticky='nsw')
name.configure(yscrollcommand=scrols.set)
scrolt = Scrollbar(root, orient=HORIZONTAL, command=name.xview)
scrolt.grid(row=7, column=1, sticky='sew')
name.configure(xscrollcommand=scrolt.set)
type = Text(root, wrap=NONE, font="Courier 9", width=10, height=8)
type.grid(row=6, column=3, sticky='nswe')
scro = Scrollbar(root, command=type.yview)
scro.grid(row=6, column=4, sticky='nsw')
type.configure(yscrollcommand=scro.set)
scroltt = Scrollbar(root, orient=HORIZONTAL, command=type.xview)
scroltt.grid(row=7, column=3, sticky='sew')
type.configure(xscrollcommand=scroltt.set)
para = Text(root, wrap=NONE, font="Courier 9", width=14, height=8)
para.grid(row=6, column=5, sticky='nswe')
scr = Scrollbar(root, command=para.yview)
scr.grid(row=6, column=6, sticky='nse')
para.configure(yscrollcommand=scr.set)
scroltz = Scrollbar(root, orient=HORIZONTAL, command=para.xview)
scroltz.grid(row=7, column=5, sticky='sew')
para.configure(xscrollcommand=scroltz.set)
root.tk.call('wm', 'iconphoto', root._w, img)
root.mainloop()