Grab All WiFi Passwords with just One Line of Code

05 May 2020
0 Comments

Press Win button, type PowerShell and select the Windows PowerShell app.

markup Donate
                
                    
(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
                
            
markup Donate
                
                    
(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
                
            

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.