No announcement yet.

BASH - Hak5 USB Rubber Ducky Easy Encoder Script

  • Filter
  • Time
  • Show
Clear All
new posts

  • BASH - Hak5 USB Rubber Ducky Easy Encoder Script

    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 "./ <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.

    # USB Rubber Ducky encoderscript
    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!"
    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:
    Ducky scripting info can be found at:
    Download payloads here:
    Buy the USB Rubber Ducky here:
    Certified Security Geek