-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwifi_catcher.py
30 lines (26 loc) · 1.03 KB
/
wifi_catcher.py
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
28
29
30
import subprocess
import platform
identify = platform.system()
print(f"Your Operating Platform Is {identify}")
if identify == "Windows":
cmd = ["netsh", "wlan", "show", "networks", "mode=BSSID"]
networks = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output, errors = networks.communicate()
print(output.decode("utf-8"))
data = output.decode("utf-8")
f = open("output.txt", "a+")
f.write(data)
f.write("\n----------------------------------------------------------------------------")
f.close()
elif identify == "Linux":
cmd = ["nmcli", "-f", "SSID,BSSID,ACTIVE", "dev", "wifi", "list"]
networks = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output, errors = networks.communicate()
print(output.decode("utf-8"))
data = output.decode("utf-8")
f = open("output.txt", "a+")
f.write(data)
f.write("\n----------------------------------------------------------------------------")
f.close()
else:
print("Unsupported For Your Operating System/\.")