orweis / winpcapy

A Modern Python wrapper for WinPcap
GNU General Public License v2.0
76 stars 23 forks source link

Missing Devices #14

Open jbirch8865 opened 5 years ago

jbirch8865 commented 5 years ago

Not sure if this is an issue with this python wrapper or something deeper in the dependent libs. I am trying to capture all arp traffic and am successfully able to execute WinPcapDevices.list_devices() which lists 7 devices

PS C:..\Documents\DashFun> python Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from winpcapy import WinPcapDevices from winpcapy import WinPcapUtils WinPcapDevices.listdevices() {'\Device\NPF{4C1C61CB-C267-44B4-A9D5-AB971C6EA2A1}': 'Oracle', '\Device\NPF{5AFCFB2F-4B4B-40D4-93E7-D33CAE09C27A}': 'Microsoft', '\Device\NPF{B7F2EEE3-F20A-4FD5-A058-C10CE5BF9A61}': 'Microsoft', '\Device\NPF{EB9FAC54-26D6-4600-B05D-94DB2970E0AF}': 'TAP-Windows Adapter V9', '\Device\NPF{54F044BB-A844-4917-BC8C-7BC0F0FA2F4B}': 'Microsoft', '\Device\NPF{87BBC5C7-E69D-4AB7-A4E8-D6BA999FA273}': 'Oracle', '\Device\NPF{91DA82B0-F636-47B5-B809-C926019959C0}': 'Realtek PCIe GBE Family Controller'}

However my Realtek wifi device is missing and therefor doesn't work using the WinPcapUtils.capture_on_and_print("Ethernet") command. Any advice?

jdimpson commented 5 years ago

How many network adapters do you have (as seen in the "Change adapter settings" window aka "Network Connections" window, off of "Network and Sharing Center" control panel)? Not counting disabled adapters, do you have more than 7? My guess is you have 7, and one of the devices labeled 'Microsoft' is your wifi device.

I've found that my Intel AC8260 Wireless adapter enumerates as 'Microsoft' in the second column, as do the Bluetooth Network Connection and a VirtualBox host-only interfaces. I assume this is, as you allude to, due to some driver somewhere in the stack being written by Microsoft.

A quick and dirty way to figure out which is which is, in the "Change adapter settings" window, to disable everything except the interface you are trying to identify, then running list_devices() again. It will only yield the enabled device, which will be your wifi adapter.

I haven't figured out how to list the devices by make/model number or by the device name as used in "Change adapter settings" window.

jdimpson commented 5 years ago

Another way that doesn't require you to disable any interfaces is to run Wireshark and open the "Capture options" dialog window, and from there click "Manage Interfaces". This will show a mapping between the formal device name and the name we see in the "Change adapter settings" window.