This Blog Are Share Computer Related Tutorials & Online Courses For Education Purpose.

Breaking

Saturday, April 1, 2023

How to Create a Rubber Ducky Device Using Arduino



A rubber ducky device is a type of USB device that can be programmed to act as a keyboard and execute a series of predefined keystrokes. This is a popular DIY project among technology enthusiasts, and it can be created using an Arduino board. In this article, we'll walk you through the steps to create a rubber ducky device using Arduino with code.


What You'll Need:
  • An Arduino board (such as an Arduino Leonardo or Micro)
  • USB cable
  • Arduino IDE software (downloadable from the official website)

Step 1: Setting up the Arduino Board

First, you'll need to connect your Arduino board to your computer using a USB cable. Once it's connected, open the Arduino IDE software on your computer. From the "Tools" menu, select the appropriate board and port.


Step 2: Writing the Code

The next step is to write the code that will define the keystrokes that you want the rubber ducky device to execute. In the Arduino IDE, select "File" and then "New" to create a new sketch. You can use the "Keyboard" library provided by the Arduino IDE to send keystrokes to the computer.


Here's an example code that will open the Windows "Run" dialog box and type "notepad" into it:
 
#include 

void setup() {

  // Wait for the computer to recognize the keyboard device

  delay(5000);

  

  // Open the Run dialog box using the Windows key and the R key

  Keyboard.press(KEY_LEFT_GUI);

  Keyboard.press('r');

  delay(100);

  Keyboard.releaseAll();

  delay(500);

  

  // Type "notepad" into the Run dialog box

  Keyboard.print("notepad");

  Keyboard.press(KEY_RETURN);

  Keyboard.releaseAll();

}

void loop() {

  // Empty loop

}
You can modify this code to execute any keystrokes that you want. For example, you can create a code that will open a website, type in a username and password, and log in automatically.


Step 3: Uploading the Code

Once you've written the code, upload it to the Arduino board by clicking the "Upload" button in the Arduino IDE. Wait for the upload to complete.


Step 4: Testing the Rubber Ducky Device

Disconnect the Arduino board from your computer and connect it to the target computer that you want to execute the keystrokes on. Wait for a few seconds until the computer recognizes the Arduino board as a keyboard device.


Once the computer has recognized the rubber ducky device, it will execute the keystrokes that you programmed. In our example code, the Run dialog box will open, and "notepad" will be typed into it automatically.


Conclusion

Creating a rubber ducky device using Arduino is a fun DIY project that can be used for ethical purposes. Always ensure that you have permission from the owner of the target computer before executing any keystrokes. By following the steps in this article, you'll be able to create your own rubber ducky device using Arduino with code.

Thank You.

No comments:

Post a Comment