Skip to content

Instantly share code, notes, and snippets.

@calebmadrigal
Created August 10, 2018 21:11
Show Gist options
  • Save calebmadrigal/fdb8855a6d05c87bbb0254a1424ee582 to your computer and use it in GitHub Desktop.
Save calebmadrigal/fdb8855a6d05c87bbb0254a1424ee582 to your computer and use it in GitHub Desktop.
parse_trackerjacker_wifi_map.py
import sys
import yaml
def parse_wifi_map(map_path):
with open(map_path, 'r') as f:
data = f.read()
wifi_map = yaml.load(data)
devices = set()
for ssid in wifi_map:
print('ssid = {}'.format(ssid))
ssid_node = wifi_map[ssid]
for bssid in ssid_node:
print('\tbssid = {}'.format(bssid))
bssid_node = ssid_node[bssid]
if 'devices' in bssid_node:
for device in bssid_node['devices']:
devices |= {device}
print('\t\tdevice = {}'.format(device))
print('\n\nSSID count: {}, Device count: {}'.format(len(wifi_map), len(devices)))
if __name__ == '__main__':
wifi_map_path = 'wifi_map.yaml'
if len(sys.argv) > 1:
wifi_map_path = sys.argv[1]
parse_wifi_map(wifi_map_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment