Advertisement
LolPenguinOwO

gdfgfdfd

Nov 24th, 2023
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import subprocess
  2. print('')
  3. data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n')
  4. profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
  5. for i in profiles:
  6. try:
  7. results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="backslashreplace").split('\n')
  8. results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
  9. try:
  10. print ("{:<30}| {:<}".format(i, results[0]))
  11. except IndexError:
  12. print ("{:<30}| {:<}".format(i, ""))
  13. except subprocess.CalledProcessError:
  14. print ("{:<30}| {:<}".format(i, "Something went wrong"))
  15. print('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement