-
Notifications
You must be signed in to change notification settings - Fork 0
/
EdiFi_enum.ps1
32 lines (27 loc) · 1.17 KB
/
EdiFi_enum.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This script is for enumerating wifi password on the device, and exporting the result to a text file.
# Show registered Wi-Fi AP SSIDs to external files
$aup = " All User Profile : "
$kc = " Key Content : "
$aup_jp = " すべてのユーザー プロファイル : "
$kc_jp = " 主要なコンテンツ : "
netsh wlan show profiles | find " : "|Out-File ./SSIDs.txt
# clean up the data and delete unecessary parts.
$SSID_list = Get-Content ./SSIDs.txt | ForEach-Object {$_ -replace $aup, ""} |ForEach-Object {$_ -replace $aup_jp, ""}
$SSID_list | Out-File ./SSIDs.txt
# Get-Content ./SSIDs.txt
# Function to provide a password: argument: SSID
$SSIDs = Get-Content ./SSIDs.txt
function show_pw {
param (
$temp_SSID
)
netsh wlan show profile name=$temp_SSID key=clear | find "Key Content"
}
# repeat show_pw and append to a csv file
# read each line of ./SSIDs.txt and use it as argument: SSID'
ForEach ($SSID in $SSIDs) {
$pw = show_pw $SSID
$pair = $SSID + "," + $pw -replace $kc, "" | ForEach-Object {$_ -replace $kc_jp, ""}
$pair | Add-Content ./wlanpass.csv
}
Write-Output "EdiFi: PW extraction Completed."