Jump to content
Hak5 Forums

Archived

This topic is now archived and is closed to further replies.

Darren Kitchen

[Info] Usb Rubber Ducky Source Code

Recommended Posts

I can't apologize enough for the delay in the source code release. We've worked out a license issue and hopefully now we can get some of the wanted features sorted. The source code can be found on GitHub. We've also moved the Wiki there so go ahead and post findings and payloads there. usbrubberducky.com now forwards there. https://github.com/hak5darren/USB-Rubber-Ducky/wiki

The code is in C and you'll need ATMEL's ARV Studio to work with the project file. You can snag that here: atmel.com/avrstudio -- be sure to agree to their license smile.gif

When it comes to programming the Duck you'll need these resources for Windows: http://hak5.org/Duck%20Programming.zip . It's pretty simple, just execute "program.bat newfirmware.hex"
*On the Windows side you may need JRE FLIP from http://www.atmel.com/tools/FLIP.aspx and be sure to use the drivers in the Programming.zip

On the *nix side I must give props to contributor Kenny who wrote these nice shell scripts to dump existing and program new firmware. I've mirrored these scripts here: http://www.usbrubberducky.com/files/dfu-linux/
Kenny wrote:

In case it is useful to anyone, I have been using the attached scripts
for firmware loading/dumping in Linux (Ubuntu has dfu-programmer
packaged). They aren't pretty, and flash.sh should probably do some
ihex format tests on the input file. But hey, it's a start.



Thanks for sending these by Kenny! As these scripts evolve they should find their way back up to the git repo.

Edit (midnitesnake):

Community Edition Firmware source code is available at http://code.google.com/p/ducky-decode

Share this post


Link to post
Share on other sites
Kenny   

JTAG is certainly an effective way to go about debugging, albeit a little slow depending on the controller. Depending on the complexity of what you are trying to accomplish, you may find it easier to debug code in a simulator. Or on the much lighter end, adding logging features to the firmware might help you get what you want. This could look for a "DEBUG" file in the root of the MicroSD card filesystem. If that exists, then write logging output to another (or the same) file on the card.

What does bus enumeration look like on your system? Does broadcast Ack/Nack timing returning to your keyboard give away your password to neighbouring USB devices? Can has class 09h? The Ducky has so much untapped potential. I'm really looking forward to seeing what people come up with.

Share this post


Link to post
Share on other sites
keland   

JTAG is certainly an effective way to go about debugging, albeit a little slow depending on the controller. Depending on the complexity of what you are trying to accomplish, you may find it easier to debug code in a simulator. Or on the much lighter end, adding logging features to the firmware might help you get what you want. This could look for a "DEBUG" file in the root of the MicroSD card filesystem. If that exists, then write logging output to another (or the same) file on the card.

What does bus enumeration look like on your system? Does broadcast Ack/Nack timing returning to your keyboard give away your password to neighbouring USB devices? Can has class 09h? The Ducky has so much untapped potential. I'm really looking forward to seeing what people come up with.

A Simulator would be good, but I don't think ther is one for the AT32UC3B1256, unless you know otherwise. Looks like one has to use something like the JTAGICE to debug (http://www.atmel.com/tools/AVRJTAGICEMKII.aspx) Any recommendations anyone? This connects to a jtag connector, do we have a pin out yet of jtag connecter on the duck? (I can't see one....)

Share this post


Link to post
Share on other sites

I can't apologize enough for the delay in the source code release. We've worked out a license issue and hopefully now we can get some of the wanted features sorted. The source code can be found on GitHub. We've also moved the Wiki there so go ahead and post findings and payloads there. usbrubberducky.com now forwards there. https://github.com/h...bber-Ducky/wiki

The code is in C and you'll need ATMEL's ARV Studio to work with the project file. You can snag that here: atmel.com/avrstudio -- be sure to agree to their license smile.gif

When it comes to programming the Duck you'll need these resources for Windows: http://hak5.org/Duck%20Programming.zip . It's pretty simple, just execute "program.bat newfirmware.hex"

*On the Windows side you may need JRE FLIP from http://www.atmel.com/tools/FLIP.aspx and be sure to use the drivers in the Programming.zip

On the *nix side I must give props to contributor Kenny who wrote these nice shell scripts to dump existing and program new firmware. I've mirrored these scripts here: http://www.usbrubber...iles/dfu-linux/

Kenny wrote:

Thanks for sending these by Kenny! As these scripts evolve they should find their way back up to the git repo.

Where has the "Duck%20Programming.zip" been moved to?

Share this post


Link to post
Share on other sites
no42   

All the programs should be on ducky-decode (including Atmel's FLIP installer).

I have been flashing the duck successfully on Linux, and Windows.

If you download dfu-programmer from ducky-decode

try these instructions

tar -xzf dfu-programmer-0.5.4.tar.gz

cd dfu-programmer-0.5.4

make

sudo make install

dfu-programmer --help
alternatively after the make command
cd src
./dfu-programmer --help

Share this post


Link to post
Share on other sites
no42   

ok so i managaged to get the driver to sucessfully install in windows xp only but when i run the programming.bat c_duck.hex

Could not find AtJniIsp.dll

Atmel installer has probably put that driver somewhere on your disk, try copying it into the local directory containing program.bat, and try again.

Share this post


Link to post
Share on other sites
--nick--   

Thank you midnitesnake, I figured out what I was doing wrong. I extracted all the downloaded files to the wrong folder . I only had to extract the download to the c:/program files/filp_atmel/bin and then change to that directory in cmd prompt to execute the program.bat. I feel quite dumb now.

http://uploading.com...ing-WINDOWS-zip

I flashed mine on WINDOWS XP x86. maybe this dload link will help people .

also maybe someone can make a .bat for copying the .dll files to windows/system32 ?

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×