Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scapy BPF filter not working

Tags:

python

scapy

I am using Scapy and would like to filter based on the destination mac address.

However, I am getting packets displayed where the destination MAC address is not the address specified in the filter.

Here is a code snippit:

from scapy.all import *

sniff(iface="eth1", filter="ether dst host 91:e0:f0:01:00:00", 
      count=3, prn=lambda x: x.show())

I am running Scapy 2.2.0

Any ideas on the issue here?

like image 232
user1607606 Avatar asked Aug 17 '12 18:08

user1607606


2 Answers

Scapy requires numerous dependencies for many different systems. It is quiet possible that you don't have the required dependency for BPF filters to work.

http://www.secdev.org/projects/scapy/portability.html

like image 76
RyPeck Avatar answered Sep 30 '22 15:09

RyPeck


Installing tcpdump solved the problem for me - now the filter on sniff works

like image 41
elotic Avatar answered Sep 30 '22 15:09

elotic