├── README.md └── WifiInfo.ps1 /README.md: -------------------------------------------------------------------------------- 1 | # Retrieve-Windows-Wifi-Passwords 2 | Retreives the SSID names and passwords in cleartext for each Wifi network stored on the computer running the script. Will work with any user in Windows 10 but will need to be run as an administrator for Windows 7/8. 3 | 4 | [![Twitter](https://img.shields.io/badge/twitter-@codingo__-blue.svg)](https://twitter.com/codingo_) 5 | 6 | # Synopsis 7 | 8 | Windows networks allow you to print the passwords of historical wifi networks that you have joined in cleartext with the following: 9 | 10 | > netsh wlan show profiles 11 | 12 | > netsh wlan show profile name= key=clear 13 | 14 | This script aims to take that information and output only the ssid and passwords in json format to allow for better integration with blue team operations, or for use with bash bunnies / rubber ducky like devices. 15 | 16 | # Example Usage / Output 17 | ``` 18 | PS C:\> .\WifiInfo.ps1 19 | [ 20 | { 21 | "Password": "password1", 22 | "SSID": "The lan before time" 23 | }, 24 | { 25 | "Password": "hunter2", 26 | "SSID": "Pretty fly for a wifi" 27 | } 28 | ] 29 | ``` 30 | -------------------------------------------------------------------------------- /WifiInfo.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | A script to gather Wifi SSIDs and passwords from the computer the script is run on. 4 | .DESCRIPTION 5 | A script to gather Wifi SSIDs and passwords from the computer the script is run on. Uses the 6 | netsh wlan external command. 7 | .EXAMPLE 8 | PS C:\> .\WifiInfo.ps1 9 | Gets both the SSID name and password for each Wifi network stored on the computer running the script. 10 | .EXAMPLE 11 | $Results = .\WifiInfo.ps1 12 | Gathers the SSID and password storing them in a variable named $Results. 13 | .NOTES 14 | Outputs as JSON of SSID name and passwod. 15 | #> 16 | $WirelessSSIDs = (netsh wlan show profiles | Select-String ': ' ) -replace ".*:\s+" 17 | $WifiInfo = foreach($SSID in $WirelessSSIDs) { 18 | $Password = (netsh wlan show profiles name=$SSID key=clear | Select-String 'Key Content') -replace ".*:\s+" 19 | New-Object -TypeName psobject -Property @{"SSID"=$SSID;"Password"=$Password} 20 | } 21 | $WifiInfo | ConvertTo-Json 22 | --------------------------------------------------------------------------------