Pcapdotnet:捕获 wifi 流量

Pcapdotnet: capturing wifi traffic

我正在尝试使用 Pcapdotnet 捕获网络流量。到目前为止,我一直在关注官方教程

https://github.com/PcapDotNet/Pcap.Net/wiki/Pcap.Net-Tutorial-Interpreting-the-packets

问题是,本教程只告诉您如何捕获以太网流量,"for simplicity."我假设这是以太网与 wifi 的问题?在那种情况下,您如何捕获 wifi 流量,为什么不那么简单? 这是相关的行:

IpV4Datagram ip = packet.Ethernet.IpV4;

Pcap.Net 是 WinPcap 的包装器。 引用 WinPcap FAQ:

Wireless adapters: these adapters may present problems, because they are not properly supported by the Windows Kernel. Some of them are not detected, other don't support promiscuous mode. In the best case, WinPcap is able to see an Ethernet emulation and not the real transiting packets: this means that the 802.11 frames are transformed into fake Ethernet frames before being captured, and that control frames are not received.

For real wireless capture, CACE Technologies offers the AirPcap adapter, specifically designed to sniff 802.11 traffic, including control frames, management frames and power information. AirPcap at this time is the only solution for capturing raw 802.11 traffic with WinPcap. More details can be found on the AirPcap product page.