我是学生,我当前任务的一部分是编写Python脚本来生成DDoS攻击流量。我是Python和scapy的新手,但我们已经提供了一个示例脚本。
>>> import logging
>>> logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
>>> from scapy.all import *
>>> packet = IP(src = "192.168.0.3", dst="192.168.0.1")/ICMP()/"HI!!!"
>>> send(packet)
然而,当我发送数据包时,我收到此错误。
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
send(packet)
File "C:\Users\Quentin\AppData\Local\Programs\Python\Python36-32\lib\site- packages\scapy\sendrecv.py", line 255, in send
__gen_send(conf.L3socket(*args, **kargs), x, inter=inter, loop=loop, count=count,verbose=verbose, realtime=realtime)
File "C:\Users\Quentin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scapy\sendrecv.py", line 241, in __gen_send
os.write(1,b".")
OSError: [Errno 9] Bad file descriptor