summaryrefslogtreecommitdiff
path: root/scapy/dumper.py
diff options
context:
space:
mode:
Diffstat (limited to 'scapy/dumper.py')
-rw-r--r--scapy/dumper.py23
1 files changed, 23 insertions, 0 deletions
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)