Last active
September 12, 2015 19:57
-
-
Save harriha/11332150 to your computer and use it in GitHub Desktop.
[Windows 8] Show passwords of Wi-Fi profiles in clear-text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(netsh wlan show profiles) | # Fetch all Wi-Fi profiles | |
Select-String "\:(.+)$" | # Grab the profile name (note: not necessarily equal to SSID) | |
%{$name=$_.Matches.Groups[1].Value.Trim(); $_} | # Store profile name to a var | |
%{(netsh wlan show profile name="$name" key=clear)} | # Fetch profile details with clear-text password | |
Select-String "Key Content\W+\:(.+)$" | # Grab the password | |
%{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | # Store password to a var | |
%{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | # Construct an object to be able to use Format-Table | |
Format-Table -AutoSize # Format the output | |
Write-Host "" | |
Write-Host "Press any key to continue..." | |
Read-Host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@randomuser1234 Yeah, this was crafted on Windows 8 and haven't tested it on Windows 7 at all. My guess is that some underlying APIs or PowerShell versions are slightly different.