From 4d28f8098017eeed156fd201dcf00c4a3bb5f2ee Mon Sep 17 00:00:00 2001 From: Jonathan Flueren Date: Sat, 12 Aug 2023 15:36:29 +0200 Subject: [PATCH] Initial commit --- identities.yaml | 5 ++ scan.sh | 30 ++++++++++++ upload.py | 45 +++++++++++++++++ wifi_map.yaml | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 206 insertions(+) create mode 100644 identities.yaml create mode 100644 scan.sh create mode 100644 upload.py create mode 100644 wifi_map.yaml diff --git a/identities.yaml b/identities.yaml new file mode 100644 index 0000000..0ed435e --- /dev/null +++ b/identities.yaml @@ -0,0 +1,5 @@ +identities: + - mac: 00:00:00:00:00:00 + name: Jon + - mac: ff:ff:ff:ff:ff:ff + name: BROADCAST \ No newline at end of file diff --git a/scan.sh b/scan.sh new file mode 100644 index 0000000..cd8932e --- /dev/null +++ b/scan.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +adapter=wlo1 +adapter_mon="${wlo1}mon" + +# Check for root privileges +if [ "$(id -u)" != "0" ] +then + >&2 echo "Quitting, this script has to be run as root!" + exit 1 +fi + +# Activate Monitor mode +trackerjacker --monitor-mode-on -i $adapter + +# Run scan +trackerjacker -i $adapter_mon --map + +# Deactivate Monitor mode +trackerjacker --monitor-mode-off -i $adapter_mon + + +# Wait for WiFi to reconnect +sleep 20 + +# Filter & upload results +python upload.py + +# Remove old scan results +rm wifi_map.yaml \ No newline at end of file diff --git a/upload.py b/upload.py new file mode 100644 index 0000000..ba6b804 --- /dev/null +++ b/upload.py @@ -0,0 +1,45 @@ +# credits: https://gist.github.com/calebmadrigal/fdb8855a6d05c87bbb0254a1424ee582 + +import sys +import yaml + +IDENTITIES_PATH = "identities.yaml" + +def parse_wifi_map(map_path): + with open(map_path, 'r') as f: + wifi_map = yaml.safe_load(f) + + with open(IDENTITIES_PATH, 'r') as f: + identities = yaml.safe_load(f)['identities'] + + for identity in identities: + print('mac = {}, name = {}'.format(identity['mac'],identity['name'])) + + devices = set() + + filtered_devices = [] + + 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)) + for identity in identities: + if identity['mac'] == device: + filtered_devices.append(identity) + + print('\n\nSSID count: {}, Device count: {}'.format(len(wifi_map), len(devices))) + print('\nFiltered devices:') + print(filtered_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) + diff --git a/wifi_map.yaml b/wifi_map.yaml new file mode 100644 index 0000000..dbe12fe --- /dev/null +++ b/wifi_map.yaml @@ -0,0 +1,126 @@ +TEST_SSID: + 00:10:18:6b:7a:ea: + bssid: 00:10:18:6b:7a:ea + bytes: 5430 + channels: + - 11 + devices: + 3c:07:71:15:f1:48: + bytes: 798 + signal: 1 + vendor: Sony Corporation + 78:31:c1:7f:25:43: + bytes: 4632 + signal: -52 + vendor: Apple, Inc. + signal: -86 + ssid: TEST_SSID + vendor: Broadcom + +eduroam: + 90:48:9a:e3:58:25: + bssid: 90:48:9a:e3:58:25 + bytes: 5073 + channels: + - 1 + devices: + 01:00:5e:96:e1:89: + bytes: 476 + signal: -62 + vendor: '' + 30:8c:fb:66:23:91: + bytes: 278 + signal: -46 + vendor: Dropcam + 34:23:ba:1c:ba:e7: + bytes: 548 + signal: 4 + vendor: SAMSUNG ELECTRO-MECHANICS(THAILAND) + signal: -80 + ssid: eduroam + vendor: TU Dortmundddd + +hacker_network: + 80:2a:a8:e5:de:92: + bssid: 80:2a:a8:e5:de:92 + bytes: 5895 + channels: + - 11 + devices: + 80:1f:02:e6:44:96: + bytes: 960 + signal: -46 + vendor: Edimax Technology Co. Ltd. + 80:2a:a8:8a:ec:c8: + bytes: 472 + signal: 4 + vendor: Ubiquiti Networks Inc. + 80:2a:a8:be:09:a9: + bytes: 5199 + signal: 4 + vendor: Ubiquiti Networks Inc. + d8:49:2f:7a:f0:8f: + bytes: 548 + signal: 4 + vendor: CANON INC. + signal: -46 + ssid: hacker + vendor: Ubiquiti Networks Inc. + 80:2a:a8:61:aa:2f: + bssid: 80:2a:a8:61:aa:2f + bytes: 5629 + channels: + - 44 + - 48 + devices: + 78:88:6d:4e:e2:c9: + bytes: 948 + signal: -52 + vendor: '' + e4:8b:7f:d4:cb:25: + bytes: 986 + signal: -48 + vendor: Apple, Inc. + signal: -48 + ssid: null + vendor: Ubiquiti Networks Inc. + 82:2a:a8:51:32:25: + bssid: 82:2a:a8:51:32:25 + bytes: 3902 + channels: + - 48 + devices: + b8:e8:56:f5:a0:70: + bytes: 1188 + signal: -34 + vendor: Apple, Inc. + signal: -14 + ssid: hacker + vendor: '' + 82:2a:a8:fc:33:b6: + bssid: 82:2a:a8:fc:33:b6 + bytes: 7805 + channels: + - 10 + - 11 + - 12 + devices: + 78:31:c1:7f:25:43: + bytes: 4632 + signal: -52 + vendor: Apple, Inc. + 7c:dd:90:fe:b4:87: + bytes: 423223 + signal: 4 + vendor: Shenzhen Ogemray Technology Co., Ltd. + ff:ff:ff:ff:ff:ff: + bytes: 2323 + signal: 2 + vendor: none + 80:2a:a8:be:09:a9: + bytes: 5199 + signal: 4 + vendor: Ubiquiti Networks Inc. + signal: -62 + ssid: null + vendor: '' \ No newline at end of file