Airsniff – Scapy

if you want to gather information about wifi, you can use below code, scapy 🙂

import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *

maclist = []

def airsniff(pkt):
    f pkt.haslayer(Dot11Beacon):
        ssid = pkt.info
        mac = pkt.addr2
        capability = pkt.sprintf("{Dot11Beacon:%Dot11Beacon.cap%}")
        enc = capability.split('+')
        env_c = "N"
        if "privacy" in enc:
            enc_c = "Y"
        if mac not in maclist:
            maclist.append(mac)        
            print enc_c, mac, ssid


sniff(iface='wlan0', count=0, prn=airsniff)

 

Output

 

Besim ALTINOK

Cyber Security Researcher