#!/usr/bin/python # coding: utf-8 # $ sudo iw dev wlan0 interface add mon0 type monitor # $ sudo ip link set dev mon0 up interface = "mon0" ####################################################### from scapy.all import * import time t_prev = None def prn(p): global t_prev p.show() if p.haslayer(Dot11Beacon): if t_prev: print time.time() - t_prev[0], p.timestamp - t_prev[1] t_prev = [time.time(), p.timestamp] sniff(iface=interface,prn=prn)