我已经安装了 npcap 驱动程序,因为我想监控 windows 环回适配器。然而,环回适配器不在 SharpPcap CaptureDeviceList 中。
我在 Wireshark 中看到了环回适配器,并且 Wireshark 能够监控环回适配器。
我应该怎么做才能使用 SharpPcap 监控环回适配器?
我已经帮助您在他们的 GitHub 存储库中创建了一个问题:https ://github.com/chmorgan/sharppcap/issues/15
请等待他们的答复。
我安装了最新的 Npcap 0.80 并Install Npcap in WinPcap API-compatible Mode
选中了选项Example01.IfList
,并在 SharpPcap 存储库中运行了示例,输出为:
SharpPcap 4.2.0.0, Example1.IfList.cs
The following devices are available on this machine:
----------------------------------------------------
interface: Name: rpcap://\Device\NPF_{9ADACD44-ECFF-45E2-BD5E-3491DEBA711F}
Description: Network adapter 'NdisWan Adapter' on local host
Flags: 0
interface: Name: rpcap://\Device\NPF_{8A300A14-CA5A-4A3C-B52B-7516661B4CDA}
Description: Network adapter 'NdisWan Adapter' on local host
Flags: 0
interface: Name: rpcap://\Device\NPF_{44DB6B7A-661D-4FA3-925E-6287EA48D3F6}
Description: Network adapter 'NdisWan Adapter' on local host
Flags: 0
interface: Name: rpcap://\Device\NPF_{F0353155-69D0-4611-AB2A-EE864BE0ADD9}
FriendlyName: Local Area Connection* 19
GatewayAddress: 0.0.0.0
Description: Network adapter 'Microsoft' on local host
Addresses:
Addr: fe80::cd59:f5d:81cb:989d
Netmask:
Broadaddr:
Addresses:
Addr: fe80::cd59:f5d:81cb:989d
Netmask:
Broadaddr:
Addresses:
Addr: HW addr: E094678FFF3F
Flags: 0
interface: Name: rpcap://\Device\NPF_{385F30D0-9166-45D3-BBC6-F1D9C5300AF9}
FriendlyName: Wi-Fi
GatewayAddress: 192.168.0.1
Description: Network adapter 'Microsoft' on local host
Addresses:
Addr: fe80::eddc:63ca:cf19:aecd
Netmask:
Broadaddr:
Addresses:
Addr: 192.168.0.109
Netmask: 255.255.255.0
Broadaddr: 0.0.0.0
Addresses:
Addr: HW addr: E094678FFF3E
Flags: 0
interface: Name: rpcap://\Device\NPF_{1E6769B9-ED4A-454D-A921-EECDA220ADA1}
FriendlyName: Npcap Loopback Adapter
GatewayAddress: 0.0.0.0
Description: Network adapter 'MS NDIS 6.0 LoopBack Driver' on local host
Addresses:
Addr: fe80::b1cb:57f6:4ebc:6359
Netmask:
Broadaddr:
Addresses:
Addr: 0.0.0.0
Netmask: 255.0.0.0
Broadaddr: 255.255.255.255
Addresses:
Addr: HW addr: 02004C4F4F50
Flags: 1
Hit 'Enter' to exit...
所以很明显最后一个适配器是Npcap Loopback Adapter
. 我不知道为什么用户无法使用 SharpPcap 监控 Npcap Loopback Adapter。我将在 Stackoverflow 中回复他关于我的反馈。
我可以想到两个可能的原因:
Support loopback traffic ("Npcap Loopback Adapter" will be created)
用户在安装 Npcap 时没有选择该选项。Install Npcap in WinPcap API-compatible Mode
未选中该选项。这样,SharpPcap 只能识别 WinPcap 并使用原来的 WinPcap DLL,根本不支持Npcap Loopback Adapter
。我的建议是:
Support loopback traffic ("Npcap Loopback Adapter" will be created)
和Install Npcap in WinPcap API-compatible Mode
选项。现在用户应该可以Npcap Loopback Adapter
通过 SharpPcap 界面看到。