Wednesday, 6 April 2022

P#22 Python for finding wifi password

Wifi Passwords can be found using the CLI command in windows:

 CLI: netsh wlan show profile to konw the wifi name
# netsh wlan show profile campuswifi key=clear > out
# notepad out ... to find out the password from key content in security settings: section.



import subprocess

data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8', errors="backslashreplace").split('\n')

profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]

for i in profiles:
try:

results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8', errors="backslashreplace").split('\n')

results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]

try:
print ("{:<30}| {:<}".format(i, results[0]))

except IndexError:
print ("{:<30}| {:<}".format(i, ""))

except subprocess.CalledProcessError:

print ("{:<30}| {:<}".format(i, "ENCODING ERROR"))

input("i am also.. waiting") # waiting to read

# wifiname | wifipassword

Eureka... I found 👀👀👀 out the password with AMET ODL Happy Learning!!!!

No comments:

Post a Comment

Work Diary - 2025

Learnt: Date Link Gmail       28.01.2025 https://ametodl.blog...