[英]Open tcp/udp ports with no socket
I have started working with winpcap, and i got a funny situation with tcp/udp ports.我已经开始使用 winpcap,并且在使用 tcp/udp 端口时遇到了一个有趣的情况。 I wrote a packet forwarder, that sniff on interface and forward packets from specified ports.我写了一个数据包转发器,它嗅探接口并从指定端口转发数据包。 I do not open the ports because i sniff directly from interface.我不打开端口,因为我直接从接口嗅探。 The problem is that the tcp/ip stack answers RST,ACK on closed tcp port, and an ICMP Destination unreachable on closed UDP port.问题是 tcp/ip 堆栈在关闭的 tcp 端口上回答 RST、ACK,在关闭的 UDP 端口上无法访问 ICMP 目标。
I need to solve that issue in a way that closed port won't answer anything that will interrupt the conversation.我需要以关闭端口不会回答任何会中断对话的方式来解决这个问题。
Is there a way i can drop packets from reaching to tcp/ip stack?有没有办法可以将数据包从到达 tcp/ip 堆栈中丢弃? Can i disable the automatic answers of RST,ACK and destination unreachable?我可以禁用 RST、ACK 和目的地不可达的自动应答吗? Can i listen on tcp that wont replay a SYN ACK on a SYN packet?我可以监听不会在 SYN 数据包上重放 SYN ACK 的 tcp 吗?
Hope i got myself clear, thanks.希望我说清楚了,谢谢。
Two solutions that I can think of:我能想到的两种解决方案:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.