As we have to sniff the packets from the interface, we require a Wi-Fi card capable of sniffing the Wi-Fi signals with the Monitor Mode. So we have to make sure the card is capable of sniffing. Then we have to set the interface to the Monitor Mode which is different for different operating systems. As Scapy has some limitations in the Windows systems, we have to run this recipe in a Linux or macOS environment.
Before we start coding, we have to get an idea about the Wi-Fi packets. As with the other packets, Wi-Fi packets also have a structure. According to the specification 802.11, each beacon frame from the access point contains a lot of information about the specific SSID.
Here is the frame format for an 802.11 mgmt beacon frame:
From this, we can get an idea of the content of the beacon frame. The really important items in the beacon frame are as follows:
- SSID...