calfred2808

#Python see connected wifi password (windows)

Jul 19th, 2020
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. # first we will import the subprocess module
  2. import subprocess
  3.  
  4. # now we will store the profiles data in "data" variable by
  5. # running the 1st cmd command using subprocess.check_output
  6. data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
  7.  
  8. # now we will store the profile by converting them to list
  9. profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
  10.  
  11. # using for loop in python we are checking and printing the wifi
  12. # passwords if they are available using the 2nd cmd command
  13. for i in profiles:
  14.     # running the 2nd cmd command to check passwords
  15.     results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i,
  16.                         'key=clear']).decode('utf-8').split('\n')
Add Comment
Please, Sign In to add comment