Last active
April 28, 2022 16:29
-
-
Save trimad/1829b942568540b704b9ec21cfe99279 to your computer and use it in GitHub Desktop.
Dump WiFi Passwords
This file contains hidden or 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
# Tristan Madden | |
# 2022-04-11 | |
# trimad.github.io | |
$cmd= @(netsh wlan show profile) | |
$profiles = @() | |
foreach ($line in $cmd) | |
{ | |
$skip = 27 | |
if($line -Match "All User Profile") | |
{ | |
$line = $line.SubString($skip, $line.Length-$skip) | |
$profiles += $line | |
} | |
} | |
$output = foreach ($profile in $profiles) | |
{ | |
$skip = 29 | |
$info = @(netsh wlan show profile $profile key=clear) | |
foreach ($line in $info) | |
{ | |
if($line -Match "Key Content") | |
{ | |
New-Object -TypeName PSObject -Property @{ | |
SSID = $profile | |
Password = $line.SubString($skip, $line.Length-$skip) | |
} | |
} | |
} | |
} | |
$output | Export-Csv output.csv -NoTypeInformation | |
Invoke-Item "output.csv" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment