import subprocess
from unittest import result
def wifisasuke(NET, WAN, SHW, PRS):
data = subprocess.check_output([NET, WAN, SHW, PRS]).decode('utf-8', errors="backslashreplace").split('\n')
profile = [wifi.split(":")[1][1:-1] for wifi in data if "All User Profile" in wifi]
for send in profile:
results = subprocess.check_output([NET, WAN, SHW, PRS, send, 'key=clear']).decode('utf-8', errors="backslashreplace").split('\n')
results = [wifi_pass.split(":")[1][1:-1] for wifi_pass in results if "Key Content" in wifi_pass]
try:
print("{:<3} : {:<}".format(send, results[0]))
except IndexError:
print("{:<3} : {:<}".format(wifi_pass, "None"))
SHOW = wifisasuke('netsh', 'wlan', 'show', 'profiles')
----------------------------------------------------------------------------
import subprocess , os
os.system('cls' if os.name=='nt' else 'clear')
print('\n'1)
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
print('--------------------+-------------------------+')
print("\033[33m{:<20}\033[0m|| \033[33m{:<}\033[0m{:>16}".format("Wi-Fi Name", "Password","|"))
print('====================+=========================+')
for i in profiles:
try:
results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8').split('\n')
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
try:
print ("\033[94m{:<20}\033[0m| \033[92m{:<}\033[0m {:>13}".format(i, results[0],"|"))
print('--------------------+-------------------------+')
except IndexError:
print ("\033[94m{:<20}\033[0m| \033[92m{:<}\033[0m".format(i, ""))
except subprocess.CalledProcessError:
print ("\033[94m{:<30}\033[0m| \033[92m{:<}\033[0m".format(i, "ENCODING ERROR"))
print('\n'1)
input("Enter to close program >")