1

I am trying to capture wireless traffic from specified MAC addresses only, and I seem to be using the wrong syntax. When I use:

dumpcap -i wlp2s0 -b filesize:100000 -w capture.pcapng -a duration:18000 -f wlan addr1 d4:be:d9:5b:a6:45

I get:

dumpcap: Invalid argument: d4:be:d9:5b:a6:45

I appear to be getting the syntax that goes after -f incorrect. I am referencing http://www.tcpdump.org/manpages/pcap-filter.7.html which is linked from the WireShark wiki page on dumpcap.

I can't seem to find examples for wireless MAC address capturing, only wired. I'm sure there is something I am missing here.

Follow up question: if I want to sniff for a few MAC addresses, do I separate them with the term, eg: wlan addr1 xx.xx.xx.xx.xx.xx or wlan addr1 xx.xx.xx.xx.xx.zz?

Using wireshark 2.2.6 on Ubuntu 17.04

1 Answer 1

0

You are apparently using the -f option incorrectly. This is what the Dumpcap documentation says about it:

-f

Set the capture filter expression.

The entire filter expression must be specified as a single argument (which means that if it contains spaces, it must be quoted).

This option can occur multiple times. If used before the first occurrence of the -i option, it sets the default capture filter expression. If used after an -i option, it sets the capture filter expression for the interface specified by the last -i option occurring before this option. If the capture filter expression is not set specifically, the default capture filter expression is used if provided.

The page that you link also shows the filters as quoted (copied directly from the linked page):

`wlan addr2 0:2:3:4:5:6'.

Try something like:

dumpcap -i wlp2s0 -b filesize:100000 -w capture.pcapng -a duration:18000 -f `wlan addr1 d4:be:d9:5b:a6:45'

Apparently, you can use the filter option multiple times.

1
  • Ah it was the single quotes. I had tried it with double quotes and had that fail as an unrecognized option. Thank you!
    – user37353
    Jun 7, 2017 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.