This repository contains scripts to automate the process of scanning wireless networks, retrieving BSSIDs and channels, and monitoring those BSSIDs using a wireless adapter in monitor mode.
Important: This tool is intended for legal and ethical use only. It is created for security researchers who have explicit permission from the network owner to scan and monitor wireless networks. Unauthorized access to wireless networks is illegal and can result in severe legal consequences. The use of this tool is solely the responsibility of the user, and the creator of this script assumes no responsibility for any misuse or illegal activity carried out with this tool. Users must take full responsibility for ensuring they comply with all applicable laws and regulations.
- Description: This Python script scans for BSSIDs corresponding to a list of SSIDs provided in a file. It saves the BSSIDs and their channels to an output file.
- Usage:
python3 get_bssids.py <ssid_list_file> <bssid_output_file> <interface>
- Arguments
<ssid_list_file>: The file containing the list of SSIDs to scan.<bssid_output_file>: The file where BSSIDs and channels will be saved.<interface>: The wireless interface to use for scanning (e.g.,wlan0mon).
- Arguments
- Description: This Bash script monitors the BSSIDs obtained from the
get_bssids.pyscript. It logs the results and outputs signal strength information. - Usage:
bash monitor_bssids.sh <interface>
- Arguments
<interface>: The wireless interface to use for scanning (e.g.,wlan0mon).
- Arguments
- Description: This wrapper script automate the process by first running the
get_bssids.pyscript to retrive BSSIDs and then runningmonitor_bssids.shto monitor those BSSIDs. It handles the setup of the wireless interface and ensuresNetworkManageris restarted afterward. - Usage:
bash automate_monitoring.sh <interface>
- Process
- Finds a suitable wireless interface and puts it into monitor mode.
- Runs the
get_bssids.pyscript to retrive BSSIDs and channels. - Runs the
monitor_bssids.shscript to monitor the BSSIDs. - Restarts
NetworkManagerafter monitoring is complete.
- Process
To run the automate_monitoring.sh script automatically at boot using systemd, follow these steps:
Create a service file in /etc/systemd/system/ directory
sudo nano /etc/systemd/system/wifi-monitor.service[Unit]
Description=Wireless BSSID Monitoring
[Service]
Type=simple
ExecStart=/path/to/automate_monitoring.sh
Restart=on-failure
[Install]
WantedBy=multi-user.targetTo enable the service so that it runs at boot, use the following command:
sudo systemctl enable wifi-monitor.serviceYou can start the service immediately with:
sudo systemctl start wifi-monitor.serviceTo verify that service is running correctly, check its status:
sudo systemctl status wifi-monitor.service- Interface Setup: The scripts handle setting the wireless interface to monitor mode and ensuring
NetworkManageris restarted afterward to restore network connectivity. - Lock File: The
automate_monitoring.shscript uses a lock file to prevent multiple instances from running simultaneously.
- Interface Not Found: Ensure your wireless adapter supports monitor mode. If
airmon-ngfails to set the interface to monitor mode, the script will log an error and exit. - Network Connectivity: Running
airmon-ng check killdisables network services that may interfere with monitor mode. The script restartsNetworkManagerafter monitoring is complete.