Sign in to follow this  
mesvak

Py GET the stored wifi paSSWORD in ur pc EZ method just for ttrial

Recommended Posts

ok let me explain one by one why we import subprocess becuase we needa connect to cmd and then in cmd

if you type 

netsh wlan show profile {Profile Name} key=clear    

 

you will see the wifi password so we will use that fucking command to extract the wifi password

so we use subprocess.check_output and ..... .

then we will try to decode it by utf-8 sometimes its not utf-8 if we wanna ignore that type and just print it out

we will use try 

And except    index 

done 

[hide]

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

 

 

 

[/hide]

Share this post


Link to post
Share on other sites

Thanks even tho the description seemed confusing lol

Share this post


Link to post
Share on other sites

i use to code in python for long time and i don't know if cmd return data value or plain text, by parsing this code i'm gonna figure this out

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this