简体   繁体   English

带有小包的数据包发送

[英]Packet sending with scapy

I tried to send icmp packet with scapy without success, to understand where and what is the problem. 我试图用scapy发送icmp数据包而没有成功,以了解问题出在哪里和出了什么问题。 I wrote some code in python that sends icmp packet. 我用python编写了一些代码来发送icmp数据包。 Of course the code is running successfully without any problem. 当然,代码可以成功运行,没有任何问题。 also in scapy the problem is present, My internal ip is 10.0.0.8 in 10.0.0.0/24 network the code with error in scapy for example is : 也存在于scapy中的问题,我的内部ip是10.0.0.0/24网络中的10.0.0.8 ,例如,在scapy中有错误的代码是:

  • send(IP(dst="10.0.0.138")/ICMP())
  • send(IP(dst="8.8.8.8")/ICMP())

the error message is: 错误消息是:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Python26\lib\site-packages\scapy\sendrecv.py", line 251, in send
    __gen_send(conf.L3socket(*args, **kargs), x, inter=inter, loop=loop, count=count,verbose=verbose, realtime=realtime)
  File "C:\Python26\lib\site-packages\scapy\sendrecv.py", line 234, in __gen_send
    s.send(p)
  File "C:\Python26\lib\site-packages\scapy\arch\pcapdnet.py", line 237, in send
    ifs = dnet.eth(iff)
  File "dnet.pyx", line 112, in dnet.eth.__init__
OSError: Result too large

Note: when I try to run: 注意:当我尝试运行时:

send(IP(dst="10.0.0.8")/ICMP())

or 要么

send(IP(dst="127.0.0.1")/ICMP())

the packet is sent successfully! 数据包发送成功!

您必须以sudo scapy开始sudo scapy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM