-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassword.py
More file actions
18 lines (18 loc) · 942 Bytes
/
Password.py
File metadata and controls
18 lines (18 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# first we will import the subprocess module
import subprocess
data = subprocess.check_output(['netsh', 'wlan', 'show',
'profiles']).decode('utf-8').split('\n')
# now we will store the profile by converting them to list
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
for i in profiles:
# running the 2nd cmd command to check passwords
password= subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i,
'key=clear']).decode('utf-8').split('\n')
# storing passwords after converting them to list
password = [b.split(":")[1][1:-1] for b in password if "Key Content" in b]
# printing the profiles(wifi name) with their passwords using
# try and except method for exception handing
try:
print ("{:<30}| {:<}".format(i, password[0]))
except IndexError:
print ("{:<30}| {:<}".format(i, ""))