Below is a small helperscript to ease development of USB Rubber Ducky scripts. Place the script in the same folder as your payload and the duckencoder.jar file.
You will need to change the name of the SD card and the language has to fit the target operating system. In my case the SD card identifies as "1EE0-36CD" and my language is set to "dk" because the target host is running a danish version of windows.
When using the script, run it using "./encoder.sh <ducky text payload file>" and the script will encode the file to the inject.bin encoded binary version, copy it to the SD card, do a few sync commands and the eject the SD card.
Feel free to change or modify it to fit what you need it to do. Enjoy!
Hak5 USB Rubber Ducky demo
Download the encoder here: https://github.com/hak5darren/USB-Ru...wiki/Downloads
Ducky scripting info can be found at: https://github.com/hak5darren/USB-Ru...ki/Duckyscript
Download payloads here: https://thehacktoday.com/60-best-rub...-usb-payloads/
Buy the USB Rubber Ducky here: https://hakshop.com/products/usb-rubber-ducky-deluxe
You will need to change the name of the SD card and the language has to fit the target operating system. In my case the SD card identifies as "1EE0-36CD" and my language is set to "dk" because the target host is running a danish version of windows.
When using the script, run it using "./encoder.sh <ducky text payload file>" and the script will encode the file to the inject.bin encoded binary version, copy it to the SD card, do a few sync commands and the eject the SD card.
Code:
#!/bin/bash # USB Rubber Ducky encoderscript MEDIA="/media/root/1EE0-36CD" TARGET="/inject.bin" LANG="dk" echo "[*] Current content:" ls -Alh $MEDIA echo "[!] Press ENTER to encode $1 and overwrite existing payload, CTRL^C to cancel." read ANSWER java -jar duckencoder.jar -i $1 -o ${MEDIA}${TARGET} -l $LANG echo "[*] New content: (${MEDIA}${TARGET}) Language: $LANG" ls -Alh $MEDIA echo "[*] Ejecting media." sync;sleep 1;sync eject $MEDIA echo "[*] Done!"
Hak5 USB Rubber Ducky demo
Download the encoder here: https://github.com/hak5darren/USB-Ru...wiki/Downloads
Ducky scripting info can be found at: https://github.com/hak5darren/USB-Ru...ki/Duckyscript
Download payloads here: https://thehacktoday.com/60-best-rub...-usb-payloads/
Buy the USB Rubber Ducky here: https://hakshop.com/products/usb-rubber-ducky-deluxe