commit cda3c00fb43539e670a1de5c50e032bb36840a9f Author: Adil Sadqi <42699429+AdilSadqi@users.noreply.github.com> Date: Sun Apr 23 00:22:36 2023 +0000 Add files via upload diff --git a/digiQuack_ Convert DuckyScript to Digispark Scripts.html b/digiQuack_ Convert DuckyScript to Digispark Scripts.html new file mode 100644 index 0000000..6ead33a --- /dev/null +++ b/digiQuack_ Convert DuckyScript to Digispark Scripts.html @@ -0,0 +1,44 @@ + + + + + digiQuack: Convert DuckyScript to Digispark Scripts + + + + + + + + + + + + + +
+

Convert DuckyScript scripts (of the hak5 USB Rubber Ducky) to Digispark scripts that you can use with the 1$ bad USB.

+ +

Why DuckyScript and why Digispark? It's easy! DuckyScript is simple and easy to learn and has become a standard in the BadUSB and pentesting community. + Digispark is one of the cheapest and most easily accessible bad USBs available. Combine the two using digiQuack and you have a vast arsenal of ready to run + scripts on a cheap and fun to use bad USB!

+ +

Want to convert Duckyscript to Python programs? Check out ducky2python!

+
+ +
+ + + +
+ + Github Icon + + + \ No newline at end of file diff --git a/digiQuack_ Convert DuckyScript to Digispark Scripts_files/677843.png b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/677843.png new file mode 100644 index 0000000..8d1b5be Binary files /dev/null and b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/677843.png differ diff --git a/digiQuack_ Convert DuckyScript to Digispark Scripts_files/digiQuack.js.download b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/digiQuack.js.download new file mode 100644 index 0000000..9ed1e8e --- /dev/null +++ b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/digiQuack.js.download @@ -0,0 +1,120 @@ +/* + + duck2python converts DuckyScript scripts for the USB Rubber Ducky by hak5 to python scripts that function the same way +thus offering a convenient way of testing a script without requiring to load it on a Rubber Ducky each time. + +*/ + +/* + +# Print Ascii Art: +print(" _ _ ____ _ _ ") +print(" __| |_ _ ___| | ___ _|___ \\ _ __ _ _| |_| |__ ___ _ __ ") +print(" / _` | | | |/ __| |/ / | | | __) | '_ \\| | | | __| '_ \\ / _ \\| '_ \\ ") +print("| (_| | |_| | (__| <| |_| |/ __/| |_) | |_| | |_| | | | (_) | | | |") +print(" \\__,_|\\__,_|\\___|_|\\_\\\\__, |_____| .__/ \\__, |\\__|_| |_|\\___/|_| |_|") +print(" |___/ |_| |___/ \tby CedArctic ") +print("\n\n") + +*/ + +function convert(){ + // Declare and load Ducky Script and Digispark output: + var duckyScript = document.getElementById('inputBox').value; + var digisparkScript = ""; + + // Write module imports to output file: + digisparkScript += "// Converted using digiQuack by Sadqi (https://asadqi.com) \n\n"; + digisparkScript +="#include \"DigiKeyboard.h\"\n\n"; + digisparkScript += "void setup() {}\n\n"; + digisparkScript += "void loop() {\n"; + digisparkScript += "\tDigiKeyboard.sendKeyStroke(0);\n"; + + // Convert the Ducky Script lines to a list and stip whitespaces: + duckyScript = duckyScript.split(/\r\n|\r|\n/g); + /* Ducky Statements fall into one of the following 6 categories: + 1. Default Delay 2.Comment 3.Delay 4.String 5.Repeat 6.Command */ + + // Check if there is a default delay: + var defaultDelay = 0; + if (duckyScript[0].slice(0,7) == "DEFAULT"){ + defaultDelay = parseInt(duckyScript[0].slice(7)); + duckyScript.shift(); + } + + // Variables: + var previousStatement = ""; + var keys = []; + + // Dictionary containing Duckyscript and their corresponding Digispark keys + var ducky2digi = {"WINDOWS":"0, MOD_GUI_LEFT", "GUI":"0, MOD_GUI_LEFT", "APP":"101", "MENU":"101", + "SHIFT":"MOD_SHIFT_LEFT", "ALT":"MOD_ALT_LEFT", "CONTROL":"MOD_CONTROL_LEFT", "CTRL":"MOD_CONTROL_LEFT", + "DOWNARROW":"81", "DOWN":"81", "LEFTARROW":"80", "LEFT":"80", "RIGHTARROW":"79", "RIGHT":"79", "UPARROW":"82", + "UP":"82", "BREAK":"72", "PAUSE":"72", "CAPSLOCK":"57", "DELETE":"42", "END":"42", "ESC":"41", "ESCAPE":"41", + "HOME":"74", "NUMLOCK":"83", "PAGEUP":"75", "PAGEDOWN":"78", "PRINTSCREEN":"70", "SCROLLLOCK":"71", "SPACE":"44", + "TAB":"43", "ENTER":"KEY_ENTER", "F1":"KEY_F1", "F2":"KEY_F2", "F3":"KEY_F3", "F4":"KEY_F4", "F5":"KEY_F5", + "F6":"KEY_F6", "F7":"KEY_F7", "F8":"KEY_F8", "F9":"KEY_F9", "F10":"KEY_F10", "F11":"KEY_F11", "F12":"KEY_F12", + "a":"KEY_A", "b":"KEY_B", "c":"KEY_C", "d":"KEY_D", "e":"KEY_E", "f":"KEY_F", "g":"KEY_G", "h":"KEY_H", + "i":"KEY_I", "j":"KEY_J", "k":"KEY_K", "l":"KEY_L", "m":"KEY_M", "n":"KEY_N", "o":"KEY_O", "p":"KEY_P", + "q":"KEY_Q", "r":"KEY_R", "s":"KEY_S", "t":"KEY_T", "u":"KEY_U", "v":"KEY_V", "w":"KEY_W", "x":"KEY_X", + "y":"KEY_Y", "z":"KEY_Z", "A":"KEY_A", "B":"KEY_B", "C":"KEY_C", "D":"KEY_D", "E":"KEY_E", "F":"KEY_F", + "G":"KEY_G", "H":"KEY_H", "I":"KEY_I", "J":"KEY_J", "K":"KEY_K", "L":"KEY_L", "M":"KEY_M", "N":"KEY_N", + "O":"KEY_O", "P":"KEY_P", "Q":"KEY_Q", "R":"KEY_R", "S":"KEY_S", "T":"KEY_T", "U":"KEY_U", "V":"KEY_V", + "W":"KEY_W", "X":"KEY_X", "Y":"KEY_Y", "Z":"KEY_Z", "1":"KEY_1", "2":"KEY_2", "3":"KEY_3", "4":"KEY_4", + "5":"KEY_5", "6":"KEY_6", "7":"KEY_7", "8":"KEY_8", "9":"KEY_9", "0":"KEY_0", "!":"30", "\"":"49", "#":"32", + "$":"33", "%":"34", "&":"36", "\'":"52", "(":"38", ")":"39", "*":"37", "+":"46", ",":"54", "-":"45", ".":"55", + "/":"56", ":":"51", ";":"51", "<":"54", "=":"46", ">":"55", "?":"56", "@":"31", "[":"47", "]":"48", "^":"35", + "_":"45", "`":"53", "{":"47", "|":"49", "}":"48", "~":"53"}; + + // Process each line from the ducky script: + for (line = 0; line < duckyScript.length; line++){ + + // Check if the statement is a comment, delay, string, repeat or key combination + if(duckyScript[line].slice(0,3) == "REM"){ + previousStatement = duckyScript[line].replace("REM","\t//"); + }else if (duckyScript[line].slice(0,5) == "DELAY"){ + previousStatement = "\tDigiKeyboard.delay(" + parseInt(duckyScript[line].slice(6)) + ");"; + }else if (duckyScript[line].slice(0,6) == "STRING") { + previousStatement = "\tDigiKeyboard.print(\"" + duckyScript[line].slice(7).replaceAll("\\", "\\\\").replaceAll("\"", "\\\"") + "\");"; + }else if (duckyScript[line].slice(0,6) == "REPEAT"){ + var repetitions = parseInt(duckyScript[line].slice(7)) - 1; + for (i = 0; i < repetitions; i++){ + digisparkScript += previousStatement; + digisparkScript += "\n"; + + // Write Default Delay between the commands if it exists: + if (defaultDelay != 0){ + digisparkScript += "\tDigiKeyboard.delay(" + defaultDelay + ");\n"; + } + } + }else{ + // Write beginning of command: + previousStatement = "\tDigiKeyboard.sendKeyStroke("; + // Split statement into keys + keys = duckyScript[line].split(" "); + // Go through the keys matching them through the dictionary to Digispark keys + for (j = 0; j < keys.length; j++){ + if (keys[j] in ducky2digi){ + previousStatement += ducky2digi[keys[j]] + ","; + }else{ + // If it is not in the dictionary + previousStatement += "UNDEFINED_KEY" + ","; + } + } + // Remove last comma and add a parenthesis + previousStatement = previousStatement.slice(0, previousStatement.length - 1) + ");"; + } + + // Write command to output file and add a new line \n : + digisparkScript += previousStatement; + digisparkScript += "\n"; + + // Write Default Delay if it exists: + if (defaultDelay != 0){ + digisparkScript += "\tDigiKeyboard.delay(" + defaultDelay + ");\n"; + } + } + digisparkScript += "}"; + // Write Output + document.getElementById('outputBox').value = digisparkScript; +} \ No newline at end of file diff --git a/digiQuack_ Convert DuckyScript to Digispark Scripts_files/style.css b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/style.css new file mode 100644 index 0000000..ee44487 --- /dev/null +++ b/digiQuack_ Convert DuckyScript to Digispark Scripts_files/style.css @@ -0,0 +1,61 @@ +body{ + font-family: Arial, Helvetica, sans-serif; + background-color: #f4f4f4; + color: #555; + font-size: 16px; + margin: 0; + line-height: 1.6em; + text-align: center; +} + +a{ + text-decoration: none; + color:inherit; +} + +.navbar{ + background-color: black; + margin: none; + padding: 10px; + width: 100%; + height: auto; + line-height: 0.5em; + font-size: 18px; +} + +.navbar h1{ + color: white; + font-family: Arial, Helvetica, sans-serif; +} +.about{ + text-align: center; +} + +.container{ + width: 75%; + margin: auto; + overflow: hidden; +} + +textarea{ + width: 100%; + font-size: 14px; + height: auto; +} + +button{ + font-size: 18px; + padding: 5px; + border-radius: 5px; + margin: 10px; + border-width: 0px; + background-color: #c9ccd1; +} + +img{ + height:auto; + width: auto; + max-width: 80px; + max-height: 80px; + margin: 10px; +} \ No newline at end of file