This mini how-to walks you through the steps of translating Rubber Ducky scripts and installing all tools needed to flash a new firmware onto your attiny85 board.
- Install Arduino from https://www.arduino.cc/en/main/software .
- Open Arduino, go to
File/Preferencesand paste the following URL intoAdditional Boards Manager URLs.- http://digistump.com/package_digistump_index.json
- If your Arduino IDE does not show you the
Additional Boards Manger URL, your IDE version may be outdated.
- Go to
Tools/Boards/Board Managerand installDigistump AVR Boards. - Restart Arduino IDE.
- Select
Digispark (Default 16.5MHz)as default board underTools/Boards.
- Download latest bootloader for attiny85 controller: https://raw.githubusercontent.com/micronucleus/micronucleus/master/upgrade/releases/upgrade-t85_default.hex .
- Flash it to the board:
$ ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher -cdigispark --timeout 60 -Uflash:w:~/Downloads/upgrade-t85_default.hex:i
- The compiler provided by the Digispark package installation may be outdated and does not let you upload a precompiled firmware (binary) to the board. Thus you need to update it manually by compiling the latest version.
- This error could accure: "Warning: device with unknown new version of Micronucleus detected. This tool doesn't know how to upload to this new device. Updates may be available.Device reports version as: 2.3"
- You need a version of
libusb-devandgccinstalled to follow the next steps.$ sudo apt install libusb-dev gcc
$ mkdir -p ~/micronucleus_build
$ cd ~/micronucleus_build
$ git clone [email protected]:micronucleus/micronucleus.git
$ cd micronucleus/commandline/
$ make
$ cd ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/
$ mv micronucleus micronucleus.OLD
$ cp ~/micronucleus_build/micronucleus/commandline/micronucleus .
- In order to flash new binaries to the microcontroller you need to place a udev rule e.g. in
/etc/udev/rules.d/49-micronucleus.rules.
# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules (preferred location)
# or
# /lib/udev/rules.d/49-micronucleus.rules (req'd on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.
- Reload the rules as root-user afterwards:
$ sudo udevadm control --reload-rules
(Based on README.rst from https://github.com/mame82/duck2spark .)
In order to convert the Rubber Ducky script, you need Java and python installed on your machine. You may download encoder.java and duck2spark.py from GitHub-repositories listed in section References into your workspace.
$ echo "STRING Hello World!" > hello.duck
$ java -jar encoder.java -i hello.duck -o raw.bin -l de
$ python duck2spark.py -i raw.bin -l 1 -f 2000 -o hello.ino
- Open
hello.inowith Arduino IDE, accept to place the sketchfile into a new directory. - Compile the script.
- Upload it to the board.
- Remove board from USB and reinsert it after you opened a text-editor of your choice.
- After a few seconds the board should type "Hello World!" into your text-editor.
- https://hackernoon.com/low-cost-usb-rubber-ducky-pen-test-tool-for-3-using-digispark-and-duck2spark-5d59afc1910
- https://github.com/mame82/duck2spark
- https://github.com/hak5darren/USB-Rubber-Ducky
- digistump/DigistumpArduino#17
- https://forum.arduino.cc/index.php?topic=629327.0
- https://kovo-blog.blogspot.com/2019/01/how-to-upgrade-bootloader-on-digistump.html
- https://askubuntu.com/questions/503928/missing-usb-h-file-what-is-it-where-do-i-get-it
- https://digistump.com/board/index.php?topic=1945.0
- https://digistump.com/wiki/digispark/tutorials/connecting
- http://digistump.com/wiki/digispark/tutorials/linuxtroubleshooting