orweis / winpcapy

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

can not capture? #17

Closed BLUEHAIYANG closed 3 years ago

BLUEHAIYANG commented 3 years ago

when I try to execute the example

>>> from winpcapy import WinPcapUtils
>>> WinPcapUtils.capture_on_and_print("*Ethernet*")
>>>

just show nothing why capture can not work?

fedorch commented 3 years ago

when I try to execute the example just show nothing why capture can not work?

Hi! Have you installed the WinPcap?

BLUEHAIYANG commented 3 years ago

I have just reinstalled WinPcap but the problem still exists

BLUEHAIYANG commented 3 years ago

what information should i provide to solve this problem?:D

orweis commented 3 years ago

Are you sure you have an Ethernet device on the machine? Try:

from winpcapy import WinPcapDevices
WinPcapDevices.list_devices()

To see which devices you can capture on

BLUEHAIYANG commented 3 years ago
>>> from winpcapy import WinPcapDevices
>>> WinPcapDevices.list_devices()
{'\\Device\\NPF_{3AF46E4A-010F-4494-A968-AC5445AF44A0}': 'Microsoft', '\\Device\\NPF_{4B2D6E1B-4EF3-4CAB-94FE-F5A5F9DE941A}': 'Microsoft', '\\Device\\NPF_{5FE9559C-2FB2-4E52-993A-150B23CC496D}': 'Microsoft', '\\Device\\NPF_{443F1F7C-0E7A-45BB-87E4-7618F1DACA97}': 'Realtek PCIe GbE Family Controller'}
>>>

here is the output

orweis commented 3 years ago

Cool - so as you can see non of your devices have 'Ethernet' in their name. Try one of the device names you got ;-) e.g. "Microsoft" or 'Realtek PCIe GbE Family Controller'

BLUEHAIYANG commented 3 years ago
>>> from winpcapy import WinPcapUtils
>>> WinPcapUtils.capture_on_and_print("*Microsoft*")

This time it just pause ,the cursor is blinking and still show nothing -- This problem is what causes me to be here

orweis commented 3 years ago

Probably no traffic on that device - you need to be sure you are listening on the device you actually have traffic on. Perhaps you should start with a tool like Wireshark to get familiarized with the devices on your machine and their traffic

BLUEHAIYANG commented 3 years ago

Thanks for your advice.I'd try Wireshark :D