This script provides way to setup a monitoring service of specific MACs for a Hostapd Wifi Access Point.
It uses the hostapd-cli list_sta to list the connected devices to the AP.
-
Install python3
-
Install telegram-send for python3
-
Create your own telegram bot and configure telegram-send
⚠Important, since the script runs as root, set the configuration of telegram-send as root:
$ sudo telegram-send --configure
-
Setup hostapd and enable hostapd_cli by adding to the config
ctrl_interface=/var/run/hostapd ctrl_interface_group=0
-
Place the mac-monitoring.py, mac-monitoring.json in /etc/hostapd/
-
Place the daemon file mac-monitoring.service at /etc/systemd/system/ and start the daemon
$ sudo systemctl daemon-reload $ sudo systemctl enable --now mac-monitoring $ sudo systemctl restart mac-monitoring
-
Configure the MACs you want to monitor
- Set your MAC monitoring filter with the file ac-monitoring.json. The format is:
["mac0", …, "macN"]
- Restart the daemon
$ sudo systemctl restart mac-monitoring
["mac0", …, "macN"]
["48:01:C5:76:14:53", "87:0F:32:45:01:64"]