Add files via upload

This commit is contained in:
Adil Sadqi 2023-04-23 00:22:36 +00:00 committed by GitHub
commit cda3c00fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 225 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<!-- saved from url=(0038)https://cedarctic.github.io/digiQuack/ -->
<html data-arp-injected="true"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>digiQuack: Convert DuckyScript to Digispark Scripts</title>
<meta name="description" content="Convert DuckyScript to Digispark Scripts">
<meta name="keywords" content="bad usb, rubber ducky, hak5, convert, script, digispark">
<link rel="stylesheet" type="text/css" href="./digiQuack_ Convert DuckyScript to Digispark Scripts_files/style.css">
<script src="./digiQuack_ Convert DuckyScript to Digispark Scripts_files/digiQuack.js.download"></script>
</head>
<body>
<div class="navbar">
<div class="container">
<a href="https://asadqi.com" target="_blank"><h1>DigiDuck 🦆</h1></a>
<a href="https://asadqi.com" target="_blank"><p>by Sadqi</p></a>
</div>
</div>
<div class="container about">
<p>Convert DuckyScript scripts (of the hak5 USB Rubber Ducky) to Digispark scripts that you can use with the 1$ bad USB.</p>
<p>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!</p>
<p>Want to convert Duckyscript to Python programs? Check out <a href="https://python.asadqi.com"><b>ducky2python!</b></a></p>
</div>
<div class="container">
<textarea rows="15" id="inputBox" placeholder="Enter DuckyScript to convert..."></textarea>
<button onclick="if(document.getElementById(&#39;inputBox&#39;).value != &#39;&#39;){convert()}">Convert</button>
<textarea rows="15" id="outputBox" placeholder="Converted Digispark script will appear here. Paste it into the Arduino IDE to load it onto your Digispark."></textarea>
</div>
<a href="https://python.asadqi.com" target="_blank"><img src="./digiQuack_ Convert DuckyScript to Digispark Scripts_files/677843.png" alt="Github Icon"></a>
</body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -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;
}

View File

@ -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;
}