Lab42Jason Posted April 4, 2012 Share Posted April 4, 2012 We have been hard at work on the new firmware and here it is. Added Linux Support Beta RC0 - https://github.com/downloads/hak5darren/USB-Rubber-Ducky/Duck%20Linux%20Beta.hex How to re-flash : - Download http://hak5.org/Duck%20Programming.zip - Install appropriate driver from Atmel FLIP package - hold button while inserting the duck into a windows computer. The duck is now in firmware update mode (DFU) - Run 'program.bat duck.hex' There will be more releases as the week goes on. Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted April 4, 2012 Share Posted April 4, 2012 Here's a script in Linux to flash the duck. #!/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; # 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" And a script to backup the existing firmware from the duck. #!/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:-dump.bin} # Where to put our dump. if [ -f "$FILE" ]; then echo "Output file already exists. Remove it or specify another." 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 sudo dfu-programmer at32uc3b1256 dump >$FILE echo Dump complete. Resetting your Ducky... sudo dfu-programmer at32uc3b1256 reset So sorry I forget the user who posted the scripts, will update with credit with I find it. Quote Link to comment Share on other sites More sharing options...
PineDominator Posted April 4, 2012 Share Posted April 4, 2012 (edited) does this firmware still function the same on windows? and what about the duckencoder, is there an updated one with a few extra languages? thank you Jason and Darren for releasing this I am sure once the process for figuring out other languages/key codes becomes second nature will make this project bloom again:-D Edited April 4, 2012 by petertfm Quote Link to comment Share on other sites More sharing options...
no42 Posted April 5, 2012 Share Posted April 5, 2012 (edited) does this firmware still function the same on windows? and what about the duckencoder, is there an updated one with a few extra languages? thank you Jason and Darren for releasing this I am sure once the process for figuring out other languages/key codes becomes second nature will make this project bloom again:-D I will try later.... (edit) Actually still works fine in Windows(/edit) Sadly, does not work for me in Linux Gentoo kernel 3.2.1, or Ubuntu Kernel 11.04 3.0.1. Looking at the USB packets there are descriptors for an apple keyboard (?why?), and it tries to setup Mass Storage support (i can see LUN setup). Still get a few malformed USB packets but not as many as the previous firmware. So the USB handshake looks like it needs more work, but looks like we are getting closer. There are a lot of code changes in the hex file...so Im interested in what has actually changed in the code. ASF Framework has about 10 layers of abstraction which makes things difficult, but once you get it right, the USB handshake should work on any OS. I don't forsee the need for different firmwares for different OS's. So in theory it should work in both Linux and Windows. Think this release is just to settle people, who appear fed up. To prove support is actually still ongoing. ] Would be nice to see updates in the git source repo. Edited April 5, 2012 by midnitesnake Quote Link to comment Share on other sites More sharing options...
Lab42Jason Posted April 5, 2012 Author Share Posted April 5, 2012 I will try later.... (edit) Actually still works fine in Windows(/edit) Sadly, does not work for me in Linux Gentoo kernel 3.2.1, or Ubuntu Kernel 11.04 3.0.1. Looking at the USB packets there are descriptors for an apple keyboard (?why?), and it tries to setup Mass Storage support (i can see LUN setup). Still get a few malformed USB packets but not as many as the previous firmware. So the USB handshake looks like it needs more work, but looks like we are getting closer. There are a lot of code changes in the hex file...so Im interested in what has actually changed in the code. ASF Framework has about 10 layers of abstraction which makes things difficult, but once you get it right, the USB handshake should work on any OS. I don't forsee the need for different firmwares for different OS's. So in theory it should work in both Linux and Windows. Think this release is just to settle people, who appear fed up. To prove support is actually still ongoing. ] Would be nice to see updates in the git source repo. It was tested on Ubuntu and it works great. Based on your comments is seems you might have a usb analyzer, can you provide me with a capture? Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted April 5, 2012 Share Posted April 5, 2012 I've tested it against 2.6.32-38-generic. Will try 3.1 later today. Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted April 6, 2012 Share Posted April 6, 2012 This is what I'm seeing from dmesg on 2.6.32 [195381.975755] usb 6-1: new full speed USB device using uhci_hcd and address 8 [195382.156921] usb 6-1: configuration #1 chosen from 1 choice [195382.159936] scsi22 : SCSI emulation for USB Mass Storage devices [195382.160016] usb-storage: device found at 8 [195382.160019] usb-storage: waiting for device to settle before scanning [195382.165870] input: Apple Inc. Keyboard as /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.1/input/input12 [195382.165951] generic-usb 0003:16C0:047C.0009: input,hidraw6: USB HID v1.11 Keyboard [Apple Inc. Keyboard] on usb-0000:00:1d.0-1/input1 And it's executing my payloads. Quote Link to comment Share on other sites More sharing options...
webdirector Posted April 6, 2012 Share Posted April 6, 2012 Hello, Just for my understanding...... 1- Is there a way to make sure it is in DFU mode ? ( is the LED on or blinking ? ) 2- When I execute "program.bat" a cmd window opens and closes real fast so i am not even sure it updated the duck is that normal ? 3- How can I see what firmware version I have on duck ? ( just to see if it updated OK ) Thanks Quote Link to comment Share on other sites More sharing options...
webdirector Posted April 6, 2012 Share Posted April 6, 2012 Hello, Just some more info. At first I took the Micro SD card out and I was not able to install the drivers. I also had issues installing the Atmel drivers. So here are my findings. 1- Make sure to leave the Micro SD in the Ducky 2- To get the ducky into DFU mode when inserting press the button and hold it do not release immediatly it takes some time. 3- You should see under Devices a " Atmel USB Device" under there you can see that the drivers are missing, right click and install the drivers from where you downloaded them now you should be able to see the ducky. So I got that but I believe the flashing is still not functionning the CMD screen pops up and closes so fast I can not see it it flashes or not. Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted April 7, 2012 Share Posted April 7, 2012 Open a new command prompt from Start > Run > CMD <enter> That way when you run the program.bat it won't disappear on completion. Also you must specify the hex file to be programmed. I believe the syntax is program.bat duck.hex Also keep in mind there are no drivers to install if flashing on the Linux side. Cheers, Darren Quote Link to comment Share on other sites More sharing options...
Black0p Posted April 7, 2012 Share Posted April 7, 2012 Glad to see this project taking off again! Any news on USB storage support? Quote Link to comment Share on other sites More sharing options...
webdirector Posted April 7, 2012 Share Posted April 7, 2012 (edited) Hello, In windows i have this: I copied "program.bat" and "duck.hex" on to C: I then opened a terminal window and typed in " program.bat duck.hex" The "bat" file executes but stops with the following error message: " The command "batchisp" is either written wrong or could not be found " In Linux I have this: I put the script above into a file called duck.sh ( and made it executable) I then ran " sh duck.sh Duck.hex " I got the following output: Erasing... sudo: dfu-programmer: command not found Failed to erase So also in Linux no luck has anybody been able to flash the ducky ? Thanks Edited April 7, 2012 by webdirector Quote Link to comment Share on other sites More sharing options...
webdirector Posted April 7, 2012 Share Posted April 7, 2012 Got it ! I needed to install "dfu-programmer" in linux. funny how things are always easier in Linux now I got it flashed Thanks Quote Link to comment Share on other sites More sharing options...
Kenny Posted April 9, 2012 Share Posted April 9, 2012 Test failed in Ubuntu with 2.6.35-32-generic. Still not working for me unless a keyboard LED is activated. Seems like this is still triggering on the same condition as the previous firmware. See this thread for more detail on that. If this is the same firmware that was being tested back in February, why is the source still not available? If binary is released before source, then it is not open source. The section Darren commented out of flash.sh was missing the "then". That error check should make things a bit more clear for folks like webdirector. Quote Link to comment Share on other sites More sharing options...
Taka Posted September 15, 2012 Share Posted September 15, 2012 Sorry for bumping an old post, but I have searched everywhere: Does anyone still have the Duck Programming.zip file mentioned in the first post? The original link at http://hak5.org/Duck%20Programming.zip is not working. Can't attempt to flash the Linux beta without it. Quote Link to comment Share on other sites More sharing options...
anode Posted September 22, 2012 Share Posted September 22, 2012 Sorry for bumping an old post, but I have searched everywhere: Does anyone still have the Duck Programming.zip file mentioned in the first post? The original link at http://hak5.org/Duck%20Programming.zip is not working. Can't attempt to flash the Linux beta without it. try this: DuckPrograming https://www.box.com/s/dr19nfs97apyi1hsy3va 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.