Coders Packet

Finding wifi passwords using python

By BhagyaLaxmi Kummaripally

This python script shows wifi passwords only for that wifi network that was connected early to the system.

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. 

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. 

# 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("")





Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by BhagyaLaxmi Kummaripally (BhagyaLaxmi)

Download packets of source code on Coders Packet