Skip to content

NPCAP 0.99-r7 capture filter incorrectly ignores egress traffic when filtering on packet contents #68

@ChristopherJHart

Description

@ChristopherJHart

Version Information

OS: Windows 10 Pro, version 1803, build 17134.556
NPCAP: 0.99-r7, tested and confirmed on 0.99-r8 as well

Current Behavior

When capturing traffic with Wireshark (with NPCAP 0.99-r7 installed as a dependency) while utilizing a capture filter that filters based upon packet data, egress traffic sourced from the local machine that should pass through the filter without issue does not pass through the filter. When capturing traffic without a capture filter that filters based upon packet data, egress traffic sourced from the local machine appears without issue.

An example of a capture filter that filters based upon packet data is as follows:

udp[8:2] & 0xf = 1

In the compressed file attached to the bottom of this issue are two PCAPs captured on my computer (IP of 192.168.10.50):

  • npcap_broken_udp_capture_filter_with_data_filter.pcapng - Hereafter called "broken_udp", this capture utilized the above capture filter udp[8:2] & 0xf = 1
  • npcap_working_udp_capture_filter.pcapng - Hereafter called "working_udp", this capture utilized udp as a capture filter

Both PCAP files result from captures taken at close to the exact same time. For reference, the first packet in "broken_udp" is the 217th packet in "working_udp" (almost exactly the same arrival time and epoch timestamp, and the rest of the packet is identical.) As you can see, all of the traffic in "broken_udp" is destined to my computer at 192.168.10.50, while "working_udp" has a considerable amount of traffic sourced from 192.168.10.50 that does not show up in "broken_udp".

One example of a packet in "working_udp" that should have been captured in "broken_udp" is packet 219 in "working_udp" (source 192.168.10.50, destination 69.47.158.237). The Message Type field in the STUN header has a value of 0x0001, which should be matched by the udp[8:2] & 0xf = 1 capture filter. However, this packet does not appear in the "broken_udp" PCAP.

These PCAPs demonstrate the current behavior with UDP, but I was able to reproduce the same behavior with a TCP capture filter as well. If you use the capture filter tcp[32:2] & 0xf = 1, only traffic that ingresses the machine will be displayed. Utilizing bit masks is not necessary to reproduce the behavior, either - I attempted to use a capture filter of udp[8:2]==0x0001 and encountered the current behavior as well.

Expected Behavior

Expected behavior is for a capture filter that filters based upon data within the packet itself to capture traffic in both ingress and egress directions.

Additional Troubleshooting

I believe this is an issue with NPCAP 0.99-r7/r8 because this issue did not exist when WinPCAP v4.1.3 was installed on my computer. @vaindil originally encountered this issue when he was running NPCAP 0.99-r7, and we were puzzled over how the same capture filter yielded different results on our different computers. The biggest relevant difference between our machines was that he was using NPCAP, while I was using WinPCAP. When I uninstalled WinPCAP and NPCAP 0.99-r7, I was able to reproduce this issue.

A DiagReport is also included in the compressed file uploaded to the bottom of this issue.

Please let me know if you need any additional information about this issue!

npcap_issue.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions