From 43e90ddb1115ca296ba2b79dad056e36d728ed89 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Wed, 29 May 2013 14:23:09 +0200 Subject: dumper --- scapy/dumper.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scapy/dumper.py (limited to 'scapy/dumper.py') diff --git a/scapy/dumper.py b/scapy/dumper.py new file mode 100644 index 0000000..bfd7c3a --- /dev/null +++ b/scapy/dumper.py @@ -0,0 +1,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) -- cgit v1.2.1