-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWiFiKeyMaster-windos.py
35 lines (24 loc) · 1.1 KB
/
WiFiKeyMaster-windos.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
31
32
33
34
35
import subprocess
def get_saved_wifi_passwords():
"""Returns a list of all saved Wi-Fi passwords on the current Windows system."""
# Get a list of all saved Wi-Fi profiles.
command = "netsh wlan show profiles"
profiles = subprocess.check_output(command, shell=True).decode("utf-8")
# Extract the password for each profile.
passwords = []
for profile in profiles.split("\n"):
profile_name = profile.split(":")[1].strip()
command = f"netsh wlan show profile name={profile_name} key=clear"
password = subprocess.check_output(command, shell=True).decode("utf-8")
# Split the password output on the colon to get the actual password.
password = password.split(":")[1].strip()
passwords.append((profile_name, password))
return passwords
def print_saved_wifi_passwords(passwords):
"""Prints a list of saved Wi-Fi passwords to the console."""
print("Saved Wi-Fi passwords:")
for profile_name, password in passwords:
print(f"{profile_name}: {password}")
# Get and print all saved Wi-Fi passwords.
passwords = get_saved_wifi_passwords()
print_saved_wifi_passwords(passwords)