2

I'm currently attempting to use an Arduino Micro as a ducky USB for penetration testing, and currently when I attempt to open a command prompt (or any other window) the window loses focus which prevents me from typing anything in it. Here's my sample code:

#include <Keyboard.h>

void setup() {
  delay(5000); //Delay for testing
  Keyboard.begin();

  Keyboard.write(KEY_LEFT_GUI);
  delay(400);
  print(F("notepad"));
  enter();

  Keyboard.print("This is a test");
  enter();

  clear();
  Keyboard.end();
}

void print(const __FlashStringHelper *value) {
  Keyboard.print(value);
}

void clear() {
  Keyboard.releaseAll();
}

void enter() {
  Keyboard.write(KEY_RETURN);
  Keyboard.releaseAll();
}
void loop(){}

Any thoughts on what might be causing this? I'm testing it on windows 10 home (not sure if that matters).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.