Skip to content

Instantly share code, notes, and snippets.

@iDCoded
Created September 1, 2021 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iDCoded/5ea6313a951e3b8333984f982fd0ae3e to your computer and use it in GitHub Desktop.
Save iDCoded/5ea6313a951e3b8333984f982fd0ae3e to your computer and use it in GitHub Desktop.
Python script to display all the stored WiFi passwords on your device.
import subprocess
data = subprocess.check_output(
['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
for i in profiles:
results = subprocess.check_output(
['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8').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, ""))
input("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment