How to see WIFI password using python?

Python is a widely used high-level programming language for general-purpose programming.Tutorial, Question, Experiment, or Project can discuss or post here.
User avatar
dondon pramis
Inventor
Contact:
Location: Philippines
Posts: 64
Joined: Sun Feb 12, 2017 8:28 am

How to see WIFI password using python?

Wed May 20, 2020 3:25 pm

This code will help you to see all saved WiFi password in your PC.

Code: Select all

import subprocess
a = subprocess.check_output(['netsh',
	'wlan', 'show', 'profiles'])
	.decode('utf-8').split('\n')
a = [i.split(":")[1][1:-1] for i in a if 
	"All User Profile" in i]
for i in a:
	results = subprocess.check_output
			(['nettsh', '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 ("{:<30}| {:<}".format(i, results[0]))
	except IndexError:
		print ("{:<30}| {:<}".format(i, ""))
* This code is edited so be careful while writing


Return to “Python and OpenCV”

Links