Make your own USB Rubber Ducky using a normal USB Stick

Did you ever wanted to make your own USB Rubber Ducky?

duckme

Well now you can using a regular USB stick, i must start with mentioning that it can not be done with all the USB sticks you will need one with a specific Nand chipset on it.

More specific the Phison 2251-03 (2303)

So now you are probably wondering where do i get that specific usb stick then, and how do i know what chipset is on it?

On github there is a list with all know compatible devices, but most off them are not for sale anymore.

So what do i do then ?

Well you can buy one in my webshop ūüôā

So this is what u need to get started, and you will also need the following things:

FILE ONE:

  • The Zip file from github found here : LINK

duck1

FILE TWO:

  • Visual Studio 2012 Express¬†which can be downloaded here : LINK

duck2File THREE:

  • SDCC (Small Device C Compiler) which can be downloaded here : LINK

duck3

FILE FOUR:

  • Java Runtime Environment 7 which can be downloaded here : LINK

duck4

FILE FIVE:

  • ¬†Duckencoder.jar which can be downloaded here : LINK

duck5

FILE SIX:

The Burner image and firmware for flashing the USB stick

Which can be download here : LINK

==============================================

Now that u downloaded all these files u are ready to install them!

Follow along with me for how to install all this properly

So we only need to install 3 things (cause other are just zip packages you will need).

Let’s begin with Microsoft Visual Studio Express 2012

Step One :

Go to the location where u downloaded the Visual Studio Express 2012 setup

Mine is in Downloads

so double click this icon where u saved it

duck6now follow along with the procedure shown below.

duck7

Now make sure u check the box I agree to the License terms and conditions

and click INSTALL

u should then see the following things pass by

duck8duck9duck10duck11duck12

and when it’s done u should see this

duck13u now need to press the LAUNCH button to start Visual Studio Express

From the moment u pressed LAUNCH u should see this

duck14Click on the Register Online (Dont worry u will not need to pay anything cause this is a free version, but you must sign in using a existing e-mail address u have at Microsoft)

like shown here

duck15

So fill in the email address and password you have at Microsoft (aka hotmail.com, outlook.com,..etc)

and click Sign In

next u should see this

duck16

now when u see this the email address you signed in with should be automatically be filled in, i blanked out mine(for spam reason) but in the Dropdown menu where it’s asking Are you registering Visual Studio for Academic, Business or Personal use? u should choose Personal

And where it’s asking Are you creating software for public distribution, online use by others or private use? u should choose Private Use

Once u did all this Click on Continue

U should now get this

duck17

Your Product Key for activating the Visual Studio Express 2012

So copy the Product Key and go back to the pop-up u started with

duck18

And paste the Product Key in the field and Click Next

when u did this and everything is fine u should get this

duck19

so click Close

and next u will end up in Visual Studio Express 2012

duck20

since we don’t need it right away u can close the program for now.

Step Two :

Next we are going to install SDCC (Small Device C Compiler)

so double click this icon where u download it to mine is again also under Downloads

duck21

 

now follow along with the pictures below

duck22

duck23

duck24

duck25

Now the next step is Very Important! 

U should make sure u are installing it to C:\Program Files\SDCC

duck26

after u clicked Install u should see it installing like shown here below

duck27

And followed by this

duck28

So now click Next

duck29

And click Finish

U are now done with installing SDCC (Small Device C Compiler)

Step Three :

We are now going to install Java Runtime Environment 8

well be needing this to run Duckencoder.jar

Now again go to the location where u saved the installer and double click this icon

duck30

and follow along with the pictures below

duck31

when u see this click Install

duck32

and yes it’s true 3 Billion Devices Run Java maybe even your microwave ūüôā

when the setup process is complete u should get this

duck33

So now that it’s done click Close

Setting things up:

Unpacking the Psychson-master.zip u downloaded from github (so FILE ONE)

duck34

So browse to the location where u downloaded it to, mine again is in Downloads

And now where u see this icon right click on it and select Extract Here like shown here below

duck35

Now that u did this u should get the Folder Psychson-master in the location where u started from so in my case C:\Users\Pentestlab\Downloads>duck36

Now that u have this folder we should copy it to another location.

I highly suggest you do exactly the same as i do so that afterwards u can download my help file with the commands in it.

So now right click on the folder Psychson-master and select copy like shown here

duck37

Now that u copied the file Open My Computer and go to your C:\ 

And create a new folder called fw (all in lowercase)

like shown below:

duck38

Now open that folder fw that u just created and paste the Psychson-master folder inside!

duck39

u should then have the folder Psychson-master inside the folder c:\fw\

like shown here

duck40

So now that u pasted the folder Psychson-master here where going to place all the other files we need here under c:\fw

since you are now in the folder c:\fw right click here and create a new folder called fw_bn

like shown here

duck41

now create another folder called ducky like shown here

ducky42

now on top u downloaded file six and it is named firmware_ps2251-03.rar

it should be in your Downloads folder at this time, but we need to place it in the fw_bn folder and extract it there

so copy the firmware_ps2251-03.rar file from your Downloads folder like shown below

ducky43

and paste it under c:\fw\fw_bn

like shown here

duck44

And now that u pasted the file firmware_ps2251-03.rar here under c:\fw\fw_bn u should extract it here

like shown here

duck45

u should then have this

duck46

But now we need to get some files out off this folder and copy it to this location c:\fw\fw_bn

So open the folder Firmware PS2251-03 like shown here below and copy the files  BN03V104M.BIN and FW03FF01V10753M_20130621.BIN

like shown here

duck47

So now that u copied these files go back one folder so to the folder c:\fw\fw_bn and paste these 2 files here

so like this

duck48

u should then have this

duck49

The files BN03V104M.BIN and FW03FF01V10753M_20130621.BIN under c:\fw\fw_bn

Now that this is done u should move on to the next step

The next step is copying the file duckencoder.jar to c:\fw\ducky

So go to the location where u saved duckencoder.jar my is still under Downloads so i need to copy it

like shown here

duck50

now that u copied this file we should move it to c:\fw\ducky

so go to the location c:\fw\ducky and paste the file duckencoder.jar here 

like shown here

duck51

u should then have this

duck52

the file duckencoder.jar in the folder c:\fw\ducky

so you should now have the folders ducky, fw_bn and Psychson-master in c:\fw

like shown here

duck53

So listed out for u once more

duckencoder.jar (file five on top) under c:\fw\ducky

BN03V104M.BIN and FW03FF01V10753M_20130621.BIN (file six on top) under c:\fw\fw_bn

and the extracted github zip file (file one on top) under c:\fw (the folder in the zipfile from github is already called Psychson-master) so make sure u don’t have this folders double!

Now we are ready with putting all the files in place!

COMPILING ALL THE THINGS

So the next step is to compile all the stuff

So go to c:\fw\Psychson-master\DriveCom

and open the file DriveCom.sln

like shown here

duck54

So you should just double click on DriveCom.sln

and get this

duck55

now that u see this u should click in the top bar on Start

like shown here

duck56

Once u clicked on start u should see this

duck57

Now that u see this u should Close the window where it says “No action specified, entering console” First

like shown here

duck58

after u closed the command prompt window u should close the Visual Studio

like shown here

duck59

Now go to c:\fw\Psychson-master\Injector

like seen here

duck60

And double click on Injector.sln to open it in Visual Studio Express

u should then see this

duck61

again now that u see this u should click in the top bar on Start

like shown here

duck62

now once you clicked start u should get this

duck63

you should see some text in Output

so next close Visual Studio again

like shown here

duck64

So once you clicked the close button we should now go to following location

c:\fw\Psychson-master\EmbedPayload

and open the file EmbedPayload.sln

like shown here

duck65

 Now once you double clicked this file u should see this

duck66

now that u see this u should click in the top bar on Start

like shown here

duck67

Once you did click in start you should again see some output text below

like seen here

duck68now that this is done close Visual Studio again like shown here

duck69

Now all the compiling is done so let’s get one more thing we need to make it complete

the thing we need is a script for putting on the self made USB rubber ducky

we will be getting the Hello world script from the github

so go to to this website : LINK

you will then see this

duck70

So as you see in the picture u now need to click on the link to Payload – Hello World

u will then come to this page

duck71

so as you see in the picture we need to select all the text marked in blue and then right click and choose Copy

Now that u copied this text we need to go to the following location

c:\fw\ducky

and create a new text file 

like shown here

duck72

And name the file HelloWorld.txt

like shown here

duck73

now that u created the text file HelloWorld.txt under c:\fw\ducky

open it by double clicking on it 

and then we need to paste the code we copied from the github page inside the HelloWorld.txt

so in the empty document right click and choose Paste

and you should then have this

duck74

Now that the code is inside we need to save it

duck75

and close it like seen here below

duck76

So now that this is done we can start playing with the stick

First we are going to check if the stick really has the Phison 2251-03 (2303) chipset

we can check this by downloading the software called GetFlashInfo

get it from this LINK

when downloaded go to the location u saved it to mine is standard in Downloads

u should there see the zip file u downloaded

duck77

now right click on this and choose Extract here

like shown here
duck78

u should then open the folder named usbflashinfo

duck79

so double click on this folder and you should then see these files 

duck80

So now Insert your USB stick and double click on GetFlashInfo.exe

u should then see this

duck81u should get this back as response

duck82

It’s very important that u get Phison 2303 (2251-03) as Controller

Normally if you bought a USB stick from my webshop it should be fine!

So now that we now for sure that the stick u have has the right nand chipset we can start making the USB Rubber Ducky

so first download this file i created with all the commands u will need for making the USB Rubber Ducky

from this LINK

For convenient work save the file under c:\fw 

so you should now have this file like shown here

duck83

So now that u have my commandsguide.txt file double click on it and you should see this

duck84

So now leave the text file open and click on START and type cmd and then right click on Command Prompt and choose Run as Administrator

like shown here

duck85

you should then get this

duck86

So now go back to the text file u downloaded from my LINK (commandguide.txt) and copy the first line like shown here

duck87

Now that u copied the first line go back to the command prompt and right click and choose paste like shown here

duck88

u should then get this

duck89

when u pasted this press ENTER

and you should then see this

duck90

a new line and no errors if you see error on line 1 you should check the file HelloWorld.txt maybe it’s still empty

so now the command u just ran converted the HelloWorld.txt to a inject.bin using the duckencode.jar

Next we need to make a firmware file

so go to C:\fw\Psychson-master\firmware

and you should see the files like shown here

duck91

So now that u are in this folder u should double click on build.bat

like shown here

duck92

u should see some thing happening in a command prompt and then it automatically closes, but afterwards you should now see a bin folder in this location

like shown here

duck93

So next step we go back to the text file u downloaded from my website and we are going to copy the second line

like shown here

duck94

Now that u copied this

go back to the command prompt and paste it there (if you closed the cmd, be sure u run it again as Administrator)

like shown here

duck95

 u should then get this

duck96

Now that u pasted the second line in the Command Prompt u should press ENTER

and when successfully you should see it print out File updated

like shown here

duck97

Now that this is done re-insert you USB stick

crop1

crop2

Now that the stick is your USB port open My computer and check what drive letter the USB Stick has.

like shown here

duck98

So make sure u remember the drive letter that has been assigned to your USB Stick!

So now go back to the text file u got from my website and copy the line under SET USB STICK IN BOOTMODE

like shown here

duck99

Like seen in the picture make sure that u change the drive letter to yours!

so where /drive=G is change the G to the drive letter that has been assigned to your USB Stick!

Now that u copied this line switch back to the Command Prompt and paste it there

like shown here

duck100

when u clicked paste u should get this

duck101

When u did this u can press ENTER 

and u should then get this

duck102

Also if you removed the casing around the USB Stick u bought from my webshop u should see that the blue led stays on

So now that the USB Stick is in BootMode 

Go back to the text file and copy the line under SET ACTION TO SEND EXECUTABLE USING BURNER IMAGE

like shown here

duck103

So now that u copied this line switch back to the Command Prompt and paste it there

like shown here

duck104

again when u clicked paste 

u should get this

duck105

Now that the line is pasted u can press ENTER

and you should then see this

duck106

Now that this is done switch back to the text file 

and copy the line under DUMP THE ORIGINAL FIRMWARE

like shown here

duck107

Now that u copied this line switch back to the Command Prompt and paste it there

like shown here

duck108

Now when u clicked paste you should see this

duck109

Now when u pasted it you can press ENTER

and should see this

duck110

Now that this is done switch one more time back to the text file and copy the line

under SEND PAYLOAD TO FIRMWARE

like shown here

duck111

now that u copied this line switch back to the Command Prompt and paste it there

like shown here

duck112

Now when u clicked paste you should get this

duck113

Now that it’s pasted u can press ENTER

and you should see this

duck114

You now just flashed your own USB Rubber Ducky using a regular USB Stick ūüôā

Leave a Reply to pentestingshop Cancel reply