Dump WiFi Passwords

This script uses the Windows command-line tool "netsh" to retrieve information about wireless network profiles that have been previously connected to on the computer. It then parses the information to extract the SSID (name) and password for each profile, and outputs that information to a CSV file named "output.csv". Finally, the script opens the "output.csv" file.

The script uses the "Invoke-Item" command to open the "output.csv" file, which is the PowerShell command equivalent of double-clicking on a file in Windows Explorer. It opens the file in the default application associated with the .csv file type on the system, typically it will be opened in excel or similar spreadsheet software.

 1$cmd= @(netsh wlan show profile)
 2$profiles = @()
 3foreach ($line in $cmd)
 4{
 5$skip = 27
 6if($line -Match "All User Profile")
 7    {
 8$line = $line.SubString($skip, $line.Length-$skip)
 9  $profiles += $line
10    }
11}
12$output = foreach ($profile in $profiles)
13{
14$skip = 29
15  $info = @(netsh wlan show profile $profile key=clear)
16  foreach ($line in $info)
17  {
18  if($line -Match "Key Content")
19    {
20        New-Object -TypeName PSObject -Property @{
21            SSID = $profile
22            Password = $line.SubString($skip, $line.Length-$skip)
23        }
24    }
25  }
26}
27$output | Export-Csv output.csv -NoTypeInformation
28Invoke-Item "output.csv"