Find Wi-fi Passwords using Python with Source Code

Introduction :

This article will show you how you can find wifi passwords using python. if you forget your wifi password so this python script can find your wifi password. To find the already connected wifi passwords we need to execute two commands on the terminal so in this program we’re running these two commands using the python script. 

Note: this python script shows wifi passwords only for that wifi network that was connected early to the system. this script can’t find wifi passwords for the unknown wifi network or other nearby wifi networks.

Explanation:

To find the wifi passwords we need to run two commands on the terminal so to run commands using python scripts we need to import the python subprocess module. subprocess module allows you to spawn a new process. 

The two below commands are used to check the wifi passwords

$ netsh wlan show profile
$ netsh wlan show profile PROFILE-NAME key=clear

the first command is used to find wifi the profiles of the connected wifi networks and the second command is used to display the password of the wifi network.

Source Code:

Get Discount on Top Educational Courses

Brand NameDiscount InformationCoupon Codes Link
Educative.io20% discount on Educative courses and plans
W3Schools20% discount on W3Schools courses
KodeKloud10% discount on KodeKloud courses and plans
GeeksforGeeks30% discount on GeeksforGeeks courses
Target Test Prep20% discount on Target Test Prep
Coding Ninjas₹5000 discount on Coding Ninjas courses
Skillshare40% discount on Skillshare
DataCamp50% discount on DataCamp
365 Data Science57% discount on 365 Data Science Plans
Get SmarterFlat 20% discount on Get Smarter courses
SmartKeedaFlat 40% discount on SmartKeeda courses
StackSocial20% discount on StackSocial courses
				
					# Importing the Suboprocess module 
import subprocess

# running command 
command = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
profiles = [i.split(":")[1][1:-1] for i in command if "All User Profile" in i]
for i in profiles:
    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 ("{:<30}|  {:<}".format(i, results[0]))
    except IndexError:
        print ("{:<30}|  {:<}".format(i, ""))
input("")
				
			

Output :

Find More Projects

Drawing Chhatrapati Shivaji Maharaj Using Python Chhatrapati Shivaji Maharaj, the legendary Maratha warrior and founder of the Maratha Empire, is an inspiration …

Resume Builder Application using Java With Source Code Graphical User Interface [GUI] Introduction: The Resume Builder Application is a powerful and user-friendly …

Encryption Tool using java with complete source Code GUI Introduction: The Encryption Tool is a Java-based GUI application designed to help users …

Movie Ticket Booking System using Java With Source Code Graphical User Interface [GUI] Introduction: The Movie Ticket Booking System is a Java …

Video Call Website Using HTML, CSS, and JavaScript (Source Code) Introduction Hello friends, welcome to today’s new blog post. Today we have …

promise day using html CSS and JavaScript Introduction Hello all my developers friends my name is Gautam and everyone is welcome to …

Get Huge Discounts
More Python Projects