Python Forum
Scapy Beacon Frames - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: Scapy Beacon Frames (/thread-2190.html)



Scapy Beacon Frames - peterkl - Feb-24-2017

I'm trying to build a scapy program that scans for Beacon Frames. Every router should send beacon frames to the air in an interval of X milliseconds so the possible hosts know the router(AP) is alive.

I'm getting nothing, the only kind of Dot11 frames I've been able to get so far is Prob Request, very rarely some data or control frames as well. I setup my wireless card to monitor mode before running the script and it supports it as well. I don't what I might be doing wrong... Here's the code :

from scapy.all import * 

global list_prob
def search_prob(packet1):
    if (packet1.haslayer(Dot11)) and (packet1[Dot11].type == 0) and\
    (packet1[Dot11].subtype == 8) : #subtype 8 == Beacon frame 
        if packet1[Dot11].addr2 not in list_prob:
            if packet1[Dot11].info not in list_prob:
                print('[>]AP',packet1[Dot11].addr2,'SSID',packet1[Dot11].info)
                list_prob.append(packet1[Dot11].addr2)
                list_prob.append(packet1[Dot11].info)
    
sniff(iface='wlan0mon',prn=search_prob)
I've also tried it with simple Dot11Beacon instead of subtype 8 and nothing changed... I'm programming with python3.5 on Linux
Any ideas ?


RE: Scapy Beacon Frames - peterkl - Feb-28-2017

Found the solution a few days ago : I had to switch interface's channel in the background. I was only getting the waves of one channel.

Thanks anyway.