Last active
April 18, 2025 09:04
-
-
Save brentvollebregt/30d278eae98e2ff221add008259d42bb to your computer and use it in GitHub Desktop.
Will find each network profile on a Windows machine and print the profile and password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| a = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="ignore").split('\n') | |
| a = [i.split(":")[1][1:-1] for i in a if "All User Profile" in i] | |
| for i in a: | |
| try: | |
| results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="ignore").split('\n') | |
| results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b] | |
| try: | |
| print ("{:<30}| {:<}".format(i, results[0])) | |
| except IndexError: | |
| print ("{:<30}| {:<}".format(i, "")) | |
| except subprocess.CalledProcessError: | |
| print ("{:<30}| {:<}".format(i, "ENCODING ERROR")) | |
| a = input("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import subprocess
import re
def get_wifi_passwords():
# الحصول على قائمة الشبكات المخزنة
wifi_list = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors='backslashreplace')
طباعة كلمات المرور للشبكات المخزنة
wifi_passwords = get_wifi_passwords()
for wifi, password in wifi_passwords.items():
print(f"شبكة: {wifi} - كلمة المرور: {password if password else 'لا توجد كلمة مرور محفوظة'}")