Extracting wifi Passwords From Windows with python.
This project code : {:-)
import subprocess
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
wifis = [line.split(':')[1][1:-1] for line in data if "All User Profile" in line]
print('All WiFi Password :-\n--------------------------------\n--------------------------------\n')
for wifi in wifis:
try:
results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', wifi, 'key=clear']).decode('utf-8').split('\n')
except:
pass
results = [line.split(':')[1][1:-1] for line in results if "Key Content" in line]
try:
print(f'Network Name: {wifi}\nNetwork Password: {results[0]}')
print('\n--------------------------------\n')
except IndexError:
print(f'Network Name: {wifi}\nNetwork Password:')
print('\n--------------------------------\n')
input("")
No comments