ffalcinelli / pydivert

A Python binding for WinDivert driver
GNU Lesser General Public License v3.0
200 stars 36 forks source link

How to capture packets from particular IP, what should be the apt filter ? #56

Open MundhadHarsh opened 1 year ago

MundhadHarsh commented 1 year ago

I want to capture packets from particular IP using pydivert but I keep getting the same error OSError: [WinError 87] The parameter is incorrect. I have tried using different filters in the function with pydivert.WinDivert(filter) as w: :

filter = 'ipv6 == X.X.X.X '
filter = 'ip.DstAddr==X.X.X.X '

This filter works fine:

filter= 'tcp.DstPort == 443 && tcp.PayloadLength > 0'

what could be the correct filter please suggest.

SkleKng commented 1 year ago

https://www.reqrypt.org/windivert-doc.html#filter_language

you're looking for remoteAddr