PowerShell TIP – Reveal WIFI Network Password on your Computer

While I was on a vacation to India after two years, I was trying to connect my HOME WIFI network from my phone but unfortunately I forgot the password.

I remembered that my laptop has that WIFI network so I can reveal the password from there.

As I love to use PowerShell where ever possible and want to avoid using Graphical User interface but here I had no choice as on my machine it requires elevated rights so it can’t be fetched thru GUI.

A simple search found the below powershell script which I thought of Sharing with the audience that follows me.


(netsh wlan show profiles) | Select-String “\:(.+)$” | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} |

%{(netsh wlan show profile name=”$name” key=clear)} | Select-String “Key Content\W+\:(.+)$” |

%{$pass=$_.Matches.Groups[1].Value.Trim(); $_} |

%{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} |

Format-Table -AutoSize

 


Save this script as ps1 or just paste it in powershell Console, it will reveal all the saved passwords of all WIFI networks on your machine.

if you get in the same situation just utilize this TIP.

PowerShell was the real rescue here as I did not have administrator userid/password to use the GUI but command line was able to do without it.

Thanks for reading

Sukhija Vikas

http://SysCloudPro.com

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s