BPF filter source address == transmission address

我只是一个虾纸丫 提交于 2020-03-04 05:13:23

问题


What is the correct BPF filter for only recieving packets where the source MAC address is equal to the transmission MAC address?

Looking at the documentation, it seems like the fields should be available through either wlan[21:12] or wlan.addr2 but I'm unable to get those to work.


回答1:


According to the pcap-filter manpage, capture filters for tshark or Wireshark don't support comparing packet fields against each other.

You can, however, do that with the display filter (top bar in Wireshark, once capture started):

wlan.sa == wlan.ta

To check whether the DS flag is equal to 0x1 using a capture filter, you can do the following:

wlan[1] & 3 = 1

It retrieves the second byte of the wlan header (wlan[1]), masks the 2 lower bits (& 3), and compares the result to 1.



来源:https://stackoverflow.com/questions/50454026/bpf-filter-source-address-transmission-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!