Jump to content

fiveseven808

Active Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

1,169 profile views

fiveseven808's Achievements

Newbie

Newbie (1/14)

  1. I don't know how to use git. If anyone can walk me through it, I'd be happy to post the source! Otherwise, this will have to do : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AHK Auto loader GUI for USB Rubber Ducky ; Compile and install DUCK scripts for custom firmware versions. ; ; 0703.xxxx Changelog ; .0831 Implemented keyboard layout changer ; .0934 Added ducky icon experiment... it kinda worked... have to change many may icons though... ; ; ; Wishlist ; - Custom layout chooser ; - Overwrite all checkbox ; - Overwrite all checkbox works... kinda... deletes all of the files before continuing... lololol ; - Include the ability to change your encoder?/specify one? ; ; ; MegaWish ; - Verify that a drive and not a folder is selected ; - Verify that the compiler finished ; ; Copyright July, 2014 ; By fiveseven808 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #NoTrayIcon #SingleInstance,force ;Variable Initialization scriptfile1 = None scriptfile2 = None scriptfile3 = None scriptfile4 = None TestVarON = 0 ;Initialize variables for testing purposes LoadTestVariables: If TestVarON = 1 { PathLetter = C scriptpath1 = C:\Users\OMITTED\Desktop\ducky\DuckEncoder_2_6_3\ccs.duck scriptpath2 = C:\Users\OMITTED\Desktop\ducky\DuckEncoder_2_6_3\ccs_2.duck scriptpath3 = C:\Users\OMITTED\Desktop\ducky\DuckEncoder_2_6_3\ccs_3.duck scriptpath4 = C:\Users\OMITTED\Desktop\ducky\DuckEncoder_2_6_3\ccs_4.duck } ;Ask the user for an output path upon bootup Querypath: { Gui, Add, Text,, Ducky SD Card Drive Letter: Gui, Add, Edit, vPathLetter ym Gui, Add, Button, default, OK Gui, Show,, Initial Config Return } ;After the user submits the form, check to see if path is empty or not (located in Main routine after GUI is created) ButtonOK: Gui, Submit ;Main GUI routine Main: Gui,Destroy Gui,Add,Checkbox,x261 y41 w70 h13 gChkChange vNL1,NumLock Gui,Add,Checkbox,x350 y41 w70 h13 gChkChange vCL1,CapsLock Gui,Add,Checkbox,x172 y41 w70 h13 gChkChange vOB1,On Boot Gui,Add,Checkbox,x439 y41 w75 h13 gChkChange vSL1,ScrollLock Gui,Add,Checkbox,x529 y41 w90 h13 gChkChange vSS1,Single Script Gui,Add,Checkbox,x261 y76 w70 h13 gChkChange vNL2,NumLock Gui,Add,Checkbox,x350 y76 w70 h13 gChkChange vCL2,CapsLock Gui,Add,Checkbox,x172 y76 w70 h13 gChkChange vOB2,On Boot Gui,Add,Checkbox,x439 y76 w75 h13 gChkChange vSL2,ScrollLock Gui,Add,Checkbox,x529 y76 w90 h13 gChkChange vSS2,Single Script Gui,Add,Checkbox,x261 y111 w70 h13 gChkChange vNL3,NumLock Gui,Add,Checkbox,x350 y111 w70 h13 gChkChange vCL3,CapsLock Gui,Add,Checkbox,x172 y111 w70 h13 gChkChange vOB3,On Boot Gui,Add,Checkbox,x439 y111 w75 h13 gChkChange vSL3,ScrollLock Gui,Add,Checkbox,x529 y111 w90 h13 gChkChange vSS3,Single Script Gui,Add,Checkbox,x261 y147 w70 h13 gChkChange vNL4,NumLock Gui,Add,Checkbox,x350 y147 w70 h13 gChkChange vCL4,CapsLock Gui,Add,Checkbox,x172 y147 w70 h13 gChkChange vOB4,On Boot Gui,Add,Checkbox,x439 y147 w75 h13 gChkChange vSL4,ScrollLock Gui,Add,Checkbox,x529 y147 w90 h13 gChkChange vSS4,Single Script Gui,Add,Text,x59 y10 w60 h13,Script Name Gui,Add,Text,x187 y23 w400 h13,------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Gui,Add,Text,x40 y23 w100 h13,------------------------------------- Gui,Add,Text,x326 y11 w120 h13,Script Activation Control Gui,Add,Button,x21 y36 w43 h23 gBrowseFile1 Default, Browse Gui,Add,Button,x21 y72 w43 h23 gBrowseFile2, Browse Gui,Add,Button,x21 y108 w43 h23 gBrowseFile3, Browse Gui,Add,Button,x21 y144 w43 h23 gBrowseFile4, Browse Gui,Add,Text,x73 y42 w70 vScriptnames1,%scriptfile1% Gui,Add,Text,x73 y77 w70 vScriptnames2,%scriptfile2% Gui,Add,Text,x73 y112 w70 vScriptnames3,%scriptfile3% Gui,Add,Text,x73 y148 w70 vScriptnames4,%scriptfile4% Gui,Add,Text,x400 y180 w150 vUpdatePath, Files will be written to %PathLetter%:\ Drive Gui,Add,Text,x422 y205 w150, Compile and Load Scripts! Gui,Add,Checkbox,x25 y185 h13 vEAC,&Eject Drive After Compiling Gui,Add,Checkbox,x25 y205 h13 vOAS,&Delete all files before Compiling Gui,Add,ComboBox,x25 y225 w40 vKeyboardLayout, us||be|ca|ch|de|dk|es|fr|gb|it|no|pt|ru|se|sv|uk Gui,Add,Text,x72 y228,Keyboard Layout Gui,Add,Button,x550 y175 w70 h23 ,Change &Path Gui,Add,Button,x550 y200 w49 h23 ,&Compile Gosub CheckOPath ;Gui,Show,x232 y276 w661 h187 , Gui,Show, , Ducky Deploy: The USB Rubber Ducky Helper WinActivate, Ducky Deploy: The USB Rubber Ducky Helper return CheckOPath: { If PathLetter = { Msgbox, 48,WARNING, WARNING `nYou didn't specify an initial output path GuiControl,,Updatepath,WARNING! No Drive Selected Gui, Font, cRed GuiControl,Font,UpdatePath } Return } ;When the user wants to change the output path, this subroutine will change it then update the GUI ButtonChangePath: { FileSelectFolder, PathLetter PathLetter := RegExReplace(PathLetter, ":\\$") GuiControl,,Updatepath, Files will be written to %PathLetter%:\ Drive Gui, Font, cNorm GuiControl,Font,UpdatePath Gosub CheckOPath return } ;The Next 4 subroutines connect to a button and correspondingly select a file and update the gui. BrowseFile1: { scriptfile1 := BrowseFilefunc(scriptpath1) GuiControl,,Scriptnames1,%scriptfile1% return } BrowseFile2: { scriptfile2 := BrowseFilefunc(scriptpath2) GuiControl,,Scriptnames2,%scriptfile2% return } BrowseFile3: { scriptfile3 := BrowseFilefunc(scriptpath3) GuiControl,,Scriptnames3,%scriptfile3% return } BrowseFile4: { scriptfile4 := BrowseFilefunc(scriptpath4) GuiControl,,Scriptnames4,%scriptfile4% return } ;When a checkbox is checked off, this subroutine will go and run a function to determine what boxes it should disable. ChkChange: { tftemp = 0 ResetChkVar = 0 ChkChangeFcn("NL",0,0) ChkChangeFcn("CL",0,0) ChkChangeFcn("SL",0,0) ChkChangeFcn("OB",0,0) ChkChangeFcn("SS",0,0) SSactive := CheckSSActivated() Return } ; This function disables all boxes and returns "1" if an SS is checked CheckSSActivated() { Loop, 4 { GuiControlGet, CheckBoxState,,SS%A_Index% If (CheckBoxState = 1) { ChkChangeFcn("NL",1,0) ChkChangeFcn("CL",1,0) ChkChangeFcn("SL",1,0) ChkChangeFcn("OB",1,0) tftemp = 1 } } return %tftemp% } ;This function is called by the ChkChange subroutine and disables checkboxes that make sense ChkChangeFcn(BoxType,KillAll,SaveLCN) { Loop, 4 { GuiControlGet, CheckBoxState,,%BoxType%%A_Index% If (CheckBoxState = 1 AND KillAll = 0) { GuiControl, Enable, %BoxType%%A_Index% If (SaveLCN = 1) { scripttoloadtemp = % scriptpath%A_Index% } } Else { GuiControl, Disable, %BoxType%%A_Index% ResetChkVar++ } } If (ResetChkVar = 4 AND KillAll = 0) { Loop, 4 { GuiControl, Enable, %BoxType%%A_Index% } } Return %scripttoloadtemp% } ;This subroutine is called when the browse button for a ducky file is pushed. BrowseFileFunc(ByRef ScriptFullPath) { FileSelectFile, ScriptFullPath, 3, Filename, Open a file, Ducky Scripts (*.duck) If ScriptFullPath = MsgBox, You didn't select anything. Else SplitPath, ScriptFullPath, ScriptFilenameOnly Return ScriptFilenameOnly } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ButtonCompile: { Gui, Submit, NoHide Gosub CheckOPath Gosub LoadallScripts Gosub CheckOverwrite Gosub CompileScripts Gosub CheckandEject Return } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Subroutines in ButtonCompile ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LoadallScripts: { If (SSactive = 1) { scripttoload1 := ChkChangeFcn("SS",0,1) scripttoload2 := ChkChangeFcn("SS",0,1) scripttoload3 := ChkChangeFcn("SS",0,1) scripttoload4 := ChkChangeFcn("SS",0,1) } Else { scripttoload1 := ChkChangeFcn("OB",0,1) scripttoload2 := ChkChangeFcn("NL",0,1) scripttoload3 := ChkChangeFcn("CL",0,1) scripttoload4 := ChkChangeFcn("SL",0,1) } MsgBox, Scripts to be run `n`nOnBoot Script = `n%scripttoload1% `nNumLock Script = `n%scripttoload2% `nCapsLock Script = `n%scripttoload3% `nScrollLock Script = `n%scripttoload4% Return } CheckOverwrite: { GuiControlGet, OASBoxState,,OAS If OASBoxState = 1 { msgbox, deleting all files lol Loop 4 { If A_Index = 1 { FileDelete %PathLetter%:\inject.bin } IfExist, %PathLetter%:\inject%A_index%.bin { FileDelete %PathLetter%:\inject%A_Index%.bin } } } Loop 4 { If A_Index = 1 { IfExist, %PathLetter%:\inject.bin { Msgbox, 3, Delete?, The script for On Boot already exists. Delete before Overwriting? IfMsgbox Yes { Omitt1 = 0 FileDelete %PathLetter%:\inject.bin } Else IfMsgbox No { Omitt1 = 1 } Else IfMsgbox Cancel { return } } } IfExist, %PathLetter%:\inject%A_index%.bin { Msgbox, 3, Delete?, The inject%A_Index%.bin already exists. Delete before Overwriting? IfMsgbox Yes { Omitt%A_Index% = 0 FileDelete %PathLetter%:\inject%A_Index%.bin } Else IfMsgbox No { Omitt%A_Index% = 1 Continue } Else IfMsgbox Cancel { return } } } Return } CompileScripts: { Loop 4, { Omitttempvar := Omitt%A_index% If Omitttempvar = 1 { Continue } Else { If A_Index = 1 { tempscriptvar := scripttoload%A_Index% Run java -jar "DuckEncoder_2_6_3\encoder.jar" -i "%tempscriptvar%" -o %PathLetter%:\inject.bin -l %KeyboardLayout% } Else { tempscriptvar := scripttoload%A_Index% Run java -jar "DuckEncoder_2_6_3\encoder.jar" -i "%tempscriptvar%" -o %PathLetter%:\inject%A_Index%.bin -l %KeyboardLayout% } } } MsgBox, Compiling Complete! Return } CheckandEject: { GuiControlGet, CheckBoxState,,EAC If (CheckBoxState = 1) { EjectDrive(PathLetter) } Return } EjectDrive(DriveL) { Driveletter = %DriveL%: ; Set this to the drive letter you wish to eject. hVolume := DllCall("CreateFile" , Str, "\\.\" . Driveletter , UInt, 0x80000000 | 0x40000000 ; GENERIC_READ | GENERIC_WRITE , UInt, 0x1 | 0x2 ; FILE_SHARE_READ | FILE_SHARE_WRITE , UInt, 0 , UInt, 0x3 ; OPEN_EXISTING , UInt, 0, UInt, 0) if hVolume <> -1 { DllCall("DeviceIoControl" , UInt, hVolume , UInt, 0x2D4808 ; IOCTL_STORAGE_EJECT_MEDIA , UInt, 0, UInt, 0, UInt, 0, UInt, 0 , UIntP, dwBytesReturned ; Unused. , UInt, 0) DllCall("CloseHandle", UInt, hVolume) } return } Esc:: GuiClose: ExitApp This program will only compile with AHK-L or equivilant.
  2. Thank you guys!!! :D I really appreciate the comments! @411: Actually, my program was made with AutoHotKey :P I have limited java background so I'm not sure how much use I can be, but I can definitely share my code with you and help to integrate it with Duck Toolkit!
  3. Intro If you're like me, you'll want to get the most out of your USB Rubber Ducky. How do we do that? We flash firmwares that allow multiple payloads such as Detour Duck! The problem I had with Detour Duck is that the process of selecting your scripts, compiling them, and loading them on your microSD AND THEN TESTING was a giant pain in the ass. When troubleshooting/debugging your scripts the last thing I want to do is spend half of my time, typing out the compiler commands, and loading the files onto my flash drive in the correct script order. My solution? Ducky Deploy! An automated DuckyScript Encoder GUI that enables anyone, especially first timers, to code and load their first Ducky Script within seconds! What can you do with Ducky Deploy? - One click compile, load AND eject your microSD (No more long cli commands!) - Quickly associate Ducky Scripts with Trigger keys (Ducky Decode and variants only) - Quickly choose keyboard layouts - Quickly change out existing ducky scripts on your microSD - Easily visualize all your Ducky settings at a glance This project is not quite finished as there's a couple of other improvements I want to make, but otherwise, it's working pretty well IMHO. Let me know in the comments what you think! Suggestions/improvements? Current version - v1.0.0703.0831 - Duck encoder 2.6.3 Wishlist - Custom keyboard layout chooser (workaround already there) - Overwrite all checkbox - Instead of delete all... - Include the ability to change your encoder?/specify one? MegaWish - Verify that a drive and not a folder is selected - Verify that the compiler finished Ducky Deploy Release.rar
  4. Of course it's possible! It just makes life much more difficult. You'd need a custom firmware with the payload baked in. But then you wouldn't be able to make any changes easily without the SDK and working knowledge of your custom firmware.
  5. REM Whatever initial delay you want below DELAY 250 GUI r REM Whatever delay you want after the run command has been sent DELAY 250 STRING file_to_run_goes_here ENTER
  6. Seriously... Why is this not a sticky? It's the closest thing we'll get to an IDE :P It's amazing btw! Thanks a million!
  7. So, seeing as Detour Duck can read and respond to Special keys on the keyboard, I just had an idea for a firmware that could detect when the driver was loaded, and then launch it's payload! Think about it... When you first plug in a new keyboard to a computer, you can't type (obviously). You ALSO can't toggle any of the special keys (caps, num, scroll) until the driver fully loads and the keyboard is ready. My idea: Make a firmware that upon insertion, toggles the caps lock key rapidly, Check the caps key between each transition If the caps lock key is detected "on" after an "off" transition, then the keyboard had the capslock key on before the driver was fully installed Unfortunately, this method is not fullproof to detect and existing capslock condition When it registers at least 2 capslock activations, the keyboard is ready. Run the payload Alternatively, based on a particular "blank" file on the card (caps.bin, num.bin, scroll.bin, etc...) rapidly toggle and use that key specifically :] That way it's even more customizeable! Think it's possible? Also, is there any way to get the source of the hex firmwares? Specifically m_duck_v2.hex? I feel that is the most useful for my application and I wouldn't mind playing around with the firmware. Thanks!
×
×
  • Create New...