-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.py
More file actions
27 lines (24 loc) · 882 Bytes
/
scan.py
File metadata and controls
27 lines (24 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import json
import subprocess
import time
# Загружаем список BSSID из базы
with open("bssid-list.txt") as f:
known_bssids = set(line.strip().lower() for line in f if line.strip())
while True:
try:
scan_output = subprocess.check_output(["termux-wifi-scaninfo"])
networks = json.loads(scan_output)
except Exception as e:
# Ошибка сканирования — просто пропускаем цикл
time.sleep(15)
continue
for net in networks:
bssid = net.get("bssid", "").lower()
ssid = net.get("ssid", "")
if bssid in known_bssids:
subprocess.run([
"termux-notification",
"--title", "⚠️ Обнаружена известная сеть",
"--content", f"{ssid} ({bssid})"
])
time.sleep(15)