Keystroke Injection via USB
ATtiny 85 microcontrollerâ
Environment setup on Kali and "Hello World"â
- Download the Arduino IDE and install the dependecies.
sudo apt-get install libusb-0.1-4
- Extract and install.
./install.sh
./arduino
Go to
Preferences > Additional Boards Manager URLs
and pastehttp://digistump.com/package_digistump_index.json
.Go to
Tools > Board > Board Manager
and search forDigistump AVR
and install the latest version.Copy this script.
#include "DigiKeyboard.h"
void setup() {
//empty
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.print("Hello World");
for(;;){ /*empty*/ }
}
- Click on
Upload
and plug the USB device.
Change the product ID (PID) and the vendor ID (VID)â
- Check the VID:PID .
lsusb
- Edit the configuration file (example
06ab:0107
).
nano /root/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/usbconfig.h
#define USB_CFG_VENDOR_ID 0xab, 0x06
#define USB_CFG_DEVICE_ID 0x07, 0x01
Rubber Duckyâ
- Installation.
cd /opt
git clone https://github.com/hak5darren/USB-Rubber-Ducky
cd USB-Rubber-Ducky/
- Test hello world script.
REM Hello World
DELAY 1000
STRING Hello world
- Load the script.
java -jar duckencoder.jar -i /path/to/hello_world.duckyscript -o /media/root/A87B-A154/inject.bin
- Unplug the device.
umount /media/root/A87B-A154