Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sniff on all interfaces won't filter. #1356

Closed
zwilcox opened this issue Apr 19, 2018 · 4 comments · Fixed by #1420
Closed

Sniff on all interfaces won't filter. #1356

zwilcox opened this issue Apr 19, 2018 · 4 comments · Fixed by #1420

Comments

@zwilcox
Copy link

zwilcox commented Apr 19, 2018

I'm attempting to sniff on all interfaces with some filtering.
sniff(prn = lambda x: x.show(), filter='src host 10.0.1.1')
If I remove the filter with:
sniff(prn = lambda x: x.show()) Then I start sniffing on interfaces.
I know the filter is working because when I specify the interface, everything works:
sniffing works on the interface and is filtering on that interface.

sniff(iface='some interface', filter='src host 10.0.1.1', prn= lambda x: x.show())

@guedou
Copy link
Member

guedou commented Apr 20, 2018 via email

@gpotter2
Copy link
Member

However, it is able to sniff multiple interfaces at the same time. Have a look at help(sniff)

      >>> sniff(filter="arp")
      >>> sniff(lfilter=lambda pkt: ARP in pkt)
      >>> sniff(iface="eth0", prn=Packet.summary)
      >>> sniff(iface=["eth0", "mon0"],
      ...       prn=lambda pkt: "%s: %s" % (pkt.sniffed_on,
      ...                                   pkt.summary()))
      >>> sniff(iface={"eth0": "Ethernet", "mon0": "Wifi"},
      ...       prn=lambda pkt: "%s: %s" % (pkt.sniffed_on,
      ...                                   pkt.summary()))

@zwilcox
Copy link
Author

zwilcox commented Apr 20, 2018

The documentation states:

Sniffing
We can easily capture some packets or even clone tcpdump or tshark. Either one interface or a list of interfaces to sniff on can be provided. If no interface is given, sniffing will happen on every interface

http://scapy.readthedocs.io/en/latest/usage.html?highlight=sniff

So sniffing should happen on every interface with something like:

sniff(filter="arp")

@guedou
Copy link
Member

guedou commented Apr 20, 2018

The documentation must be fixed. By default, Scapy sniffs on conf.iface. Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants