Reaver9 Posted April 12, 2013 Share Posted April 12, 2013 I have been all over this forum, the github and google code page, but i cannot find the script to flash new firmware to the ducky using linux. i did find a couple things that mentioned how to do it as well as dependencies needed and the mention of duckyflash.sh, but it seems that this file is no longer exsists anywhere for download. So does anyone have any idea where to get it or how to get this done. Also when is the usbrubberducky website going to be back up and running. Quote Link to comment Share on other sites More sharing options...
no42 Posted April 12, 2013 Share Posted April 12, 2013 (edited) https://code.google.com/p/ducky-decode/source/browse/#svn%2Ftrunk%2FFlash File are: dump.sh flash.sh Edited April 12, 2013 by midnitesnake Quote Link to comment Share on other sites More sharing options...
Reaver9 Posted April 12, 2013 Author Share Posted April 12, 2013 Thanks midnight.....i did find that before but the flash.sh seems to be flawed somewhere or im using incorrectly........i keep getting syntax errors from the code reaver9@reaver9-Aspire-5536:~/Downloads$ ./flash.sh m_duck_v2.hex ./flash.sh: 24: ./flash.sh: Syntax error: "fi" unexpected (expecting "then") Quote Link to comment Share on other sites More sharing options...
no42 Posted April 12, 2013 Share Posted April 12, 2013 (edited) Can you check that the file matches the following script: #!/bin/sh EXIT=0 if lsusb | awk '$6=="03eb:2ff6"{e=1}END{exit e}'; then echo "Is your Ducky connected and in DFU mode? I don't see it. Try" echo "unplugging it, then holding down the button while plugging it back in." EXIT=1 fi FILE=${1:-firmware.hex} # Where to get our dump. if test -r "$FILE"; then if egrep -vq '^:' "$FILE"; then echo "That doesn't look like an ihex file." EXIT=1 fi else echo "No such input file or you don't have permissions to read it." EXIT=1 fi if ! which dfu-programmer &>/dev/null; then echo "dfu-programmer not found. Go install it and try again." EXIT=1 fi test $EXIT -eq 1 && exit 1 # Get all the errors at once, then exit die() { echo "$*" exit 2 } echo Erasing... sudo dfu-programmer at32uc3b1256 erase || die "Failed to erase" echo Flashing... sudo dfu-programmer at32uc3b1256 flash --suppress-bootloader-mem "$FILE" \ || die "Failed to flash" echo Flash complete. Resetting your Ducky... sudo dfu-programmer at32uc3b1256 reset || die "Failed to reset" Edited April 12, 2013 by midnitesnake Quote Link to comment Share on other sites More sharing options...
Reaver9 Posted April 13, 2013 Author Share Posted April 13, 2013 Srry Midnight....I just saw this....unfortunately I switched OSs in the mean time. I did get it to work earlier (backbox linux) by removing the lines of code pertaining to that error(asking about if/which dfu-programmer was available) once I did that it worked just fine. I understand just enough code to know what its trying to accomplish but not enough to find a simple syntax error. I now have Kali linux and will attempt to use the original file and see if i get the same errors. If I do i will compare to what you just posted. Either way I'll let you know what happens. Thank you. Quote Link to comment Share on other sites More sharing options...
Reaver9 Posted April 14, 2013 Author Share Posted April 14, 2013 ok sooo after testing it on my new install using kali....i get a completely different error with both the downloaded flash.sh and the cut and paste of the script you posted above. als happens with dump.sh .....all files will tell me that dfu-programmer is not installed. root@reaper:~/ducky/firmware# ./flash.sh m_duck_v2.hex dfu-programmer not found. Go install it and try again. root@reaper:~/ducky/firmware# /usr/local/bin/dfu-programmer not sure why it says "/usr/local/bin/dfu-programmer" Im not typing that...the script is. also again after i delete the portion of the script that checks which dfu-programmer...it continues on and appears to flash properly but im not sure it actually is flashing. root@reaper:~/ducky/firmware# ./flash.sh m_duck_v2.hex Erasing... Flashing... Validating... 33672 bytes used (13.26%) Flash complete. Resetting your Ducky... so it is clear...i have tried installing dfu-programmer through both apt-get and the downloaded tar file. any Ideas? Quote Link to comment Share on other sites More sharing options...
no42 Posted April 14, 2013 Share Posted April 14, 2013 (edited) dfu-programmer not found. Go install it and try again. root@reaper:~/ducky/firmware# /usr/local/bin/dfu-programmer dfu-programmer isn't in your path... edit the script so dfu-programmer becomes /usr/bin/local/dfu-programmer also the script calls "sudo dfu-programmer" if your on backtrack / kali running as root, you can remove the sudo prefix. looks like its flashed! - whats in dmesg when you insert the Ducky? The script is just a wrapper the main commands (per rubber ducky flashing guide on ducky-decode) http://code.google.com/p/ducky-decode/wiki/Flashing_Guide The USB Rubber Ducky Draft.doc dfu-programmer at32uc3b1256 erase dfu-programmer at32uc3b1256 flash --suppress-bootloader-mem <firmware.hex> dfu-programmer at32uc3b1256 reset Edited April 14, 2013 by midnitesnake Quote Link to comment Share on other sites More sharing options...
kmichael500 Posted April 17, 2013 Share Posted April 17, 2013 I created a program in python to easily flash your ducky. It just requires you to have dfu-programmer installed. http://forums.hak5.org/index.php?/topic/29281-release-ducky-flasher-v10/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.