Turning a regular USB flash drive into a USB rubber ducky | DIY rubber ducky | Pendrive to bad USB

3 min read 1 year ago
Published on Aug 07, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, you'll learn how to transform a regular USB flash drive into a USB Rubber Ducky, a tool often used in ethical hacking for automating tasks and executing commands. This step-by-step guide will cover how to write VBS scripts that simulate keyboard inputs, allowing your USB device to perform various actions automatically. Whether you're interested in cybersecurity or just want to enhance your technical skills, this guide provides practical insights and instructions.

Step 1: Download Required Software

To get started, you need to download the USB Auto Creator tool, which will help set up your flash drive.

  • Visit the following link to download the USB Auto Creator: USB Auto Creator
  • Follow the installation instructions provided on the website.

Step 2: Write the VBS Script

Next, you will write a VBS (Visual Basic Script) that will execute commands when the USB drive is plugged in.

  1. Open Notepad or any text editor.

  2. Copy and paste the following VBS code into the editor:

    set x=createobject("wscript.shell")
    x.run "notepad.exe"
    wscript.sleep 1000
    x.sendkeys "You have been hacked"
    
  3. Save the file with a .vbs extension, for example, attack.vbs. Make sure to select “All Files” in the save dialog to avoid saving it as a .txt file.

Step 3: Configure the USB Drive

You will now configure your USB flash drive to execute the VBS script automatically.

  1. Open the USB Auto Creator tool.
  2. Follow the prompts to set up the USB drive for autorun. You may need to specify the path to your VBS file.
  3. Ensure the VBS script is placed in the root directory of your USB drive.

Step 4: Test Your USB Rubber Ducky

It's time to test your newly created USB Rubber Ducky.

  1. Safely eject your USB drive from your computer.
  2. Insert it into another computer (make sure you have permission to do so).
  3. Observe if Notepad opens automatically and displays the message "You have been hacked".

Practical Tips

  • Always use this knowledge ethically and within legal boundaries.
  • Test your USB Rubber Ducky only on devices you own or have explicit permission to use.
  • Modify the VBS script to perform different actions by changing the commands within the script.

Common Pitfalls to Avoid

  • Avoid saving your VBS script with a .txt extension, as it will not execute properly.
  • Ensure your antivirus software is not blocking the execution of scripts on the USB drive.

Conclusion

You've successfully turned a regular USB flash drive into a USB Rubber Ducky capable of executing commands. This tutorial provided a step-by-step guide to writing VBS scripts and configuring your USB drive. Remember to use these skills responsibly and ethically. For further learning, explore more about VBS scripting and ethical hacking practices.