0

I know I can do this with scapy:

sniff(count=10)

to sniff 10 packets.

How would I go about sniffing for 10 seconds instead in python? Can scapy do this itself or do I need to wrap it some other method to handle that?

Juicy
  • 11,840
  • 35
  • 123
  • 212

1 Answers1

2

You can simply pass a timeout to the sniff function. For more details, refer to the official API documentation:

timeout: stop sniffing after a given time (default: None).

Yoel
  • 9,144
  • 7
  • 42
  • 57