Only send names, not macs
This commit is contained in:
parent
f12194d8d9
commit
9d17358aa1
3 changed files with 12 additions and 16 deletions
|
@ -37,8 +37,7 @@ $datetime->setTimestamp($present["timestamp"]);
|
|||
foreach ($present["identities"] as $identity) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $identity["name"]; ?></td>
|
||||
<td><code><?php echo $identity["mac"]; ?></code></td>
|
||||
<td><?php echo $identity; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
|
9
scan.sh
9
scan.sh
|
@ -1,7 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
adapter=wlan0
|
||||
adapter_mon="${adapter}mon"
|
||||
|
||||
# Check for root privileges
|
||||
if [ "$(id -u)" != "0" ]
|
||||
|
@ -14,14 +13,12 @@ fi
|
|||
trackerjacker --monitor-mode-on -i $adapter
|
||||
|
||||
# Run scan
|
||||
trackerjacker -i $adapter_mon --map
|
||||
timeout 60 trackerjacker -i $adapter_mon --map
|
||||
|
||||
# Deactivate Monitor mode
|
||||
trackerjacker --monitor-mode-off -i $adapter_mon
|
||||
trackerjacker --monitor-mode-off -i $adapter
|
||||
|
||||
|
||||
# Wait for WiFi to reconnect
|
||||
sleep 20
|
||||
sleep 15
|
||||
|
||||
# Filter & upload results
|
||||
python upload.py
|
||||
|
|
16
upload.py
16
upload.py
|
@ -8,7 +8,7 @@ import hmac
|
|||
import hashlib
|
||||
|
||||
IDENTITIES_PATH = "identities.yaml"
|
||||
WEBHOOK_URL = "http://localhost:8080/update.php"
|
||||
WEBHOOK_URL = "https://cloud.flueren.eu/public/update.php"
|
||||
WEBHOOK_SECRET = "CHANGE-THIS"
|
||||
|
||||
def parse_wifi_map(map_path):
|
||||
|
@ -25,7 +25,7 @@ def parse_wifi_map(map_path):
|
|||
print('mac = {}, name = {}'.format(identity['mac'],identity['name']))
|
||||
|
||||
devices = set()
|
||||
filtered_devices = []
|
||||
filtered_identities = set()
|
||||
|
||||
# filter scan results for known identities
|
||||
for ssid in wifi_map:
|
||||
|
@ -40,23 +40,23 @@ def parse_wifi_map(map_path):
|
|||
#print('\t\tdevice = {}'.format(device))
|
||||
for identity in identities:
|
||||
if identity['mac'] == device:
|
||||
filtered_devices.append(identity)
|
||||
filtered_identities |= (identity['name'])
|
||||
|
||||
#print('\n\nSSID count: {}, Device count: {}'.format(len(wifi_map), len(devices)))
|
||||
print('\nFiltered devices:')
|
||||
print(filtered_devices)
|
||||
print('\nFiltered identities:')
|
||||
print(filtered_identities)
|
||||
|
||||
return filtered_devices
|
||||
return filtered_identities
|
||||
|
||||
if __name__ == '__main__':
|
||||
wifi_map_path = 'wifi_map.yaml'
|
||||
if len(sys.argv) > 1:
|
||||
wifi_map_path = sys.argv[1]
|
||||
|
||||
filtered_devices = parse_wifi_map(wifi_map_path)
|
||||
filtered_identities = parse_wifi_map(wifi_map_path)
|
||||
|
||||
# build request
|
||||
json_payload = json.dumps(filtered_devices).encode("utf-8")
|
||||
json_payload = json.dumps(filtered_identities).encode("utf-8")
|
||||
|
||||
signature = hmac.new(
|
||||
key=bytes(WEBHOOK_SECRET, "utf-8"),
|
||||
|
|
Loading…
Reference in a new issue