WinPcap如何忽略自己的数据包?

发布于 2024-10-02 07:32:28 字数 68 浏览 0 评论 0原文

当我通过 WinPcap 注入任何数据包时,它将立即被捕获。 我不想捕获数据包,女巫是我自己注入的。 最简单的方法是什么?

When I inject any packet via WinPcap it will be captured in this moment.
I dont want to capture packets, witch were injected myself.
What is the easiest way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长伴 2024-10-09 07:32:29

最好的方法是使用 PCAP_OPENFLAG_NOCAPTURE_RPCAP 标志。

The best way is to use PCAP_OPENFLAG_NOCAPTURE_RPCAP flag..

为人所爱 2024-10-09 07:32:29

您也许可以使用捕获过滤器 (pcap_setfilter()) 并根据数据包的源 MAC 地址过滤掉数据包。

但这可能并不完全是您想要的,因为 MAC 地址可能会被欺骗,您可能希望看到来自计算机上其他来源的传出数据包,等等。

我唯一能想到的就是计算每个数据包的哈希值发送的数据包,并丢弃任何捕获的具有相同哈希值的数据包。

一定有更好的方法……

You could perhaps use a capture filter (pcap_setfilter()) and filter out packets by their source MAC address.

That may not be exactly what you want though, because MAC addresses can be spoofed, you might want to see outgoing packets from other sources on your machine, etc.

The only other thing I can think of would be to compute a hash value of each packet you send, and discard any captured packet with the same hash value.

There's got to be a better way…

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文