如何使RECVMSG在Linux系统中失败
有什么办法如何制作 recvmsg
收听UDP以返回值小于0的值?
我无法在系统上运行代码,只能发送UDP数据包。
编辑:
我尝试了@ben voigt的报价,将 icmp端口
数据包发送到此端口,这可能会触发 econnreset
或 econnrefused
因此,我尝试了此代码
from scapy.all import *
send(IP(dst=dst_ip)/UDP(sport=src_port,dport=dst_port))
[here is PCAP file][1] , when I run that code the `recvmsg` has been called(not return -1 of-course)
,因此不,我尝试将 icmp端口无法实现的
发送到该端口,并希望 recvmsg
将失败
from scapy.all import *
send(IP(dst=dst_ip)/ICMP(type=3,code=3)/IP(dst=dst_ip)/UDP(sport=src_port,dport=dst_port))
src =“ https://i.sstatic.net/p2oyx.png” alt =“在此处输入 “>这是PCAP文件,但是 recvmsg
甚至没有调用
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要
recvMSG
返回-1
用于测试。参见有关更多详细信息。If you want
recvmsg
return-1
for testing, implement your ownrecvmsg
in a shared library and inject it in your program withLD_PRELOAD
. See The LD_PRELOAD trick for more details.