2
votes

I have set up scapy on linux (raspian on RPI) for sniffing WiFi packets using WiFi adapter (b/g) in monitor mode. I am not sure if scapy by default hops on all the channels of the b/g protocol, or sticks to just one of them.

I'd like to have the capability to sniff different channels by hopping on to them, and to have capability to configure the dwell time on each channel, all using snapy. Can some one help me how to do that? Thanks a lot.

1

1 Answers

2
votes

No, Scapy won't do channel hopping for you.

I don't think Scapy has a way to control your interface's channel, but you might have a job (outside your script or fork()-ed from it) that would do something like

import os
import time
chans = [1,6,11]
wait = 1
i = 0
while True:
    os.system('iw dev monitor0 set channel %d' % chans[i])
    i = (i + 1) % len(chans)
    time.sleep(wait)

Or something with subprocess.call() instead of os.system if you prefer.