blob: bfd7c3a791a6d9d709e79d310708611d7ecfb408 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/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)
|