We can modify the previous recipe to get the hidden SSIDs. With Scapy, we can identify probe answers and requests to extract the hidden SSIDs.
Exposing hidden SSIDs
How to do it...
Follow the steps to write a script to expose hidden SSIDs:
- Create a sniff-hidden-ssid.py file and open it in the editor.
- Import the scapy module and create a dictionary for the identified SSIDs:
from scapy.all import * hiddenSSIDs = dict()
- Now create the function to parse the hidden SSIDs from the packets:
def parseSSID(pkt): if pkt.haslayer(Dot11Beacon) or pkt.haslayer(Dot11ProbeResp): if not hiddenSSIDs.has_key(pkt[Dot11].addr3): ssid = pkt[Dot11Elt].info bssid = pkt[Dot11].addr3 channel = int...