Skip to content

Instantly share code, notes, and snippets.

@xanecs
Created February 5, 2016 18:10
Show Gist options
  • Save xanecs/c5cf33de5f4bfeae6ca5 to your computer and use it in GitHub Desktop.
Save xanecs/c5cf33de5f4bfeae6ca5 to your computer and use it in GitHub Desktop.
Read out wifi signal strength of client devices from a monitor-mode interface
#! /usr/bin/env/python
from scapy.all import *
import binascii
def PacketHandler(pkt):
if pkt.haslayer(Dot11):
if pkt.addr2 == 'cc:c3:xx:xx:xx:xx':
print(-(256-int.from_bytes(pkt.notdecoded[-4:-3], byteorder='big')))
if __name__ == '__main__':
sniff(iface='wlan0mon', prn = PacketHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment