Skip to content

Instantly share code, notes, and snippets.

@ConceptCodes
Created January 21, 2019 00:01
Show Gist options
  • Save ConceptCodes/a65d5528062a975fbfb5f369c6871e71 to your computer and use it in GitHub Desktop.
Save ConceptCodes/a65d5528062a975fbfb5f369c6871e71 to your computer and use it in GitHub Desktop.
this python script will create a txt file that shows saved passwords to networks your computer has connected to.
import time
from tqdm import tqdm
import subprocess
txt = ""
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n')
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
for i in tqdm(profiles):
time.sleep(1)
try:
results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="backslashreplace").split('\n')
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
try:
txt += "{:<30}| {:<}\n".format(i, results[0])
except IndexError:
txt += "{:<30}| {:<}\n".format(i, "")
except subprocess.CalledProcessError:
txt += "{:<30}| {:<}\n".format(i, "ENCODING ERROR")
with open('./saved_passwords.txt', 'w') as f:
f.write(txt)
print('Complete!\nopen saved_passwords.txt to view list.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment