This commit is contained in:
Zarcolio
2023-07-02 17:40:32 +02:00
parent 5db696f8af
commit de20f93fc7
24 changed files with 100956 additions and 100956 deletions
+38
View File
@@ -0,0 +1,38 @@
# Ducky Script Creator Guide
This guide provides instructions on how to create a DuckyScript for your Flipper Zero using your smartphone when you don't have access to a laptop or computer.
## Prerequisites
To follow this guide, you will need the following:
1. A smartphone with internet access
2. Flipper Zero
3. A compatible browser on your smartphone
## Creating a DuckyScript
To create a DuckyScript for your Flipper Zero using your smartphone, follow these steps:
1. Open the browser on your smartphone and navigate to the [Ducky Script Creator](https://github.com/Zarcolio/Duckyscript/blob/main/Ducky%20script%20creator/index.html) page.
2. Download the HTML file to you phone or upload it to your own website.
3. The Ducky Script Creator is an online tool that allows you to write and generate DuckyScripts easily. It provides a user-friendly interface for creating the scripts.
4. Read the [instructions](https://gist.github.com/methanoliver/efebfe8f4008e167417d4ab96e5e3cac) and familiarize yourself with the DuckyScript syntax if you are not already familiar with it.
5. Start writing your DuckyScript by adding the desired commands and keystrokes. You can use the provided examples or create your own from scratch.
6. As you write the DuckyScript, you will see the corresponding keystrokes and commands being displayed in real-time on the screen.
7. Once you have finished writing your DuckyScript, review it to ensure it meets your requirements and does not contain any errors.
8. After verifying the script, click on the "Save as" button to download the generated DuckyScript file to your smartphone.
9. Transfer the downloaded DuckyScript file to your Flipper Zero using the Flipper app.
10. On your Flipper Zero, use the BadUSB/BadKB app to navigate to the DuckyScript folder to execute the created script.
Congratulations! You have successfully created and loaded a DuckyScript onto your Flipper Zero using your smartphone.
## Additional Notes
- The Ducky Script Creator tool mentioned in this guide is a third-party tool hosted on GitHub. Make sure you review the tool's documentation and terms of use before utilizing it.
- It is essential to exercise caution and comply with legal and ethical guidelines while using the Flipper Zero and DuckyScripts.
- Keep your Flipper Zero's firmware up to date to ensure compatibility and access to the latest features.
## Disclaimer
Using the Flipper Zero or any hacking tools and techniques should only be performed within legal and ethical boundaries. Make sure to obtain proper authorization and use these tools responsibly. The information provided in this guide is for educational purposes only, and the user assumes all risks and responsibilities associated with its implementation.
+339
View File
@@ -0,0 +1,339 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ducky Script Creator</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
padding: 10px;
background-color: #f8f8f8;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
h2, h3 {
margin-top: 10px;
}
textarea {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
.container {
margin-bottom: 20px;
}
.other {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: 5px;
}
.other button {
width: 100%;
height: 40px;
font-size: 12px;
border: none;
background-color: #FFB866; /* Light shade of orange */
color: black; /* Black text */
cursor: pointer;
border-radius: 4px; /* Added rounded corners */
}
.other input[type="number"],
.other input[type="text"],
.other .large-btn {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
#createStringButton,
#createRemarkButton,
#saveButton {
padding: 10px;
border: none;
background-color: #FFB866; /* Light shade of orange */
color: black; /* Black text */
font-size: 16px;
cursor: pointer;
border-radius: 4px; /* Added rounded corners */
}
#output {
width: 100%;
height: 100px; /* Adjust the height as desired */
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
/* Added new styles for input fields and buttons in the "other" class */
.other > input[type="number"],
.other > input[type="text"],
.other > button {
display: block;
width: 100%;
margin-bottom: 5px;
}
.other .large-btn {
width: 100%;
white-space: normal;
line-height: 1.2;
border-radius: 4px; /* Added rounded corners */
margin-top: 5px; /* Added margin-top to create space */
}
.fixed-header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: white;
padding: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
z-index: 9999;
}
/* Added a class to style the save button */
.save-button {
font-family: Arial, sans-serif;
font-size: 12px;
}
.container.function {
padding-top: 180px;
}
</style>
</head>
<body>
<div class="fixed-header">
<b>Output:</b>
<textarea id="output" rows="4" cols="50" placeholder="Your Ducky script will appear here.
You can edit this manually before saving, if needed."></textarea>
<button id="saveButton" class="save-button">Save As...</button>
</div>
<div class="container function">
<b>Function:</b>
<div class="other">
<button onclick="appendToOutput('F1')">F1</button>
<button onclick="appendToOutput('F2')">F2</button>
<button onclick="appendToOutput('F3')">F3</button>
<button onclick="appendToOutput('F4')">F4</button>
<button onclick="appendToOutput('F5')">F5</button>
<button onclick="appendToOutput('F6')">F6</button>
<button onclick="appendToOutput('F7')">F7</button>
<button onclick="appendToOutput('F8')">F8</button>
<button onclick="appendToOutput('F9')">F9</button>
<button onclick="appendToOutput('F10')">F10</button>
<button onclick="appendToOutput('F11')">F11</button>
<button onclick="appendToOutput('F12')">F12</button>
</div>
</div>
<div class="container">
<b>String:</b>
<div class="other">
<textarea id="input" rows="4" cols="50" placeholder="Type your text here."></textarea>
</div>
<button id="createStringButton">Write String</button>
<button id="createRemarkButton">Write Remark</button>
</div>
<div class="container">
<b>Delay:</b>
<div class="other">
<input id="delayInput" type="number" value="1000" min="0">
<button onclick="appendToOutput('DELAY ' + document.getElementById('delayInput').value)">DELAY</button>
</div>
<div class="other">
<input id="defaultDelayInput" type="number" value="1000" min="0">
<button onclick="appendToOutput('DEFAULT_DELAY ' + document.getElementById('defaultDelayInput').value)">DEFAULT_DELAY</button>
</div>
<div class="other">
<button class="large-btn" onclick="appendToOutput('WAIT_FOR_BUTTON_PRESS')">BUTTON_PRESS</button>
</div>
</div>
<div class="container">
<b>Modifiers:</b>
<div class="other">
<button onclick="appendToOutput('CTRL')">Ctrl</button>
<button onclick="appendToOutput('SHIFT')">Shift</button>
<button onclick="appendToOutput('ALT')">Alt</button>
<button onclick="appendToOutput('GUI')">Gui</button>
<input id="charInput" type="text" maxlength="1" placeholder="Modified key" oninput="insertChar()">
</div>
</div>
<div class="container">
<b>Combos:</b>
<div class="other">
<button onclick="appendToOutput('CTRL-ALT')">Ctrl-Alt</button>
<button onclick="appendToOutput('CTRL-SHIFT')">Ctrl-Shift</button>
<button onclick="appendToOutput('ALT-SHIFT')">Alt-Shift</button>
<button onclick="appendToOutput('ALT-GUI')">Alt-Gui</button>
<button onclick="appendToOutput('GUI-SHIFT')">Gui-Shift</button>
</div>
</div>
<div class="container">
<b>Cursor:</b>
<div class="other">
<button onclick="appendToOutput('DOWNARROW')">Down arrow</button>
<button onclick="appendToOutput('LEFTARROW')">Left arrow</button>
<button onclick="appendToOutput('RIGHTARROW')">Right arrow</button>
<button onclick="appendToOutput('UPARROW')">Up arrow</button>
</div>
</div>
<div class="container">
<b>Control:</b>
<div class="other">
<button onclick="appendToOutput('ENTER')">Enter</button>
<button onclick="appendToOutput('BREAK')">Break</button>
<button onclick="appendToOutput('PAUSE')">Pause</button>
<button onclick="appendToOutput('CAPSLOCK')">Caps Lock</button>
<button onclick="appendToOutput('DELETE')">Delete</button>
<button onclick="appendToOutput('BACKSPACE')">Back space</button>
<button onclick="appendToOutput('END')">End</button>
<button onclick="appendToOutput('ESC')">Esc</button>
<button onclick="appendToOutput('ESCAPE')">Escape</button>
<button onclick="appendToOutput('HOME')">Home</button>
<button onclick="appendToOutput('INSERT')">Insert</button>
<button onclick="appendToOutput('NUMLOCK')">Num Lock</button>
<button onclick="appendToOutput('PAGEUP')">Page Up</button>
<button onclick="appendToOutput('PAGEDOWN')">Page Down</button>
<button onclick="appendToOutput('PRINTSCREEN')">Print Screen</button>
<button onclick="appendToOutput('SCROLLOCK')">Scroll Lock</button>
<button onclick="appendToOutput('SPACE')">Space</button>
<button onclick="appendToOutput('TAB')">Tab</button>
<button onclick="appendToOutput('MENU')">Menu</button>
<button onclick="appendToOutput('APP')">App</button>
<button onclick="appendToOutput('SYSRQ')">SysRq</button>
</div>
</div>
<div class="container">
<b></b>
<div class="other"></div>
</div>
<script>
document.getElementById('createStringButton').addEventListener('click', createString);
document.getElementById('createRemarkButton').addEventListener('click', createRemark);
document.getElementById('saveButton').addEventListener('click', saveOutput);
function createString() {
const input = document.getElementById('input');
const output = document.getElementById('output');
let translatedInput = '';
const lines = input.value.split('\n');
for (let i = 0; i < lines.length; i++) {
const line = lines[i].trim();
if (line === '') {
continue; // Skip empty lines
}
if (hasDeadKeys(line)) {
translatedInput += `ALTCODE ${line}\n`;
} else {
translatedInput += `STRING ${line}\n`;
}
}
// If the input does not end with a new line, append a new line to the translated input
if (input.value[input.value.length - 1] !== '\n') {
translatedInput += '\n';
}
output.value += translatedInput.trim() + '\n'; // Append to the output and add a new line
input.value = ''; // Clear the input
}
function createRemark() {
const input = document.getElementById('input');
const output = document.getElementById('output');
let translatedInput = '';
const lines = input.value.split('\n');
for (let i = 0; i < lines.length; i++) {
const line = lines[i].trim();
if (line === '') {
continue; // Skip empty lines
}
if (hasDeadKeys(line)) {
translatedInput += `ALTCODE ${line}\n`;
} else {
translatedInput += `REM ${line}\n`;
}
}
// If the input does not end with a new line, append a new line to the translated input
if (input.value[input.value.length - 1] !== '\n') {
translatedInput += '\n';
}
output.value += translatedInput.trim() + '\n'; // Append to the output and add a new line
input.value = ''; // Clear the input
}
function hasDeadKeys(input) {
const deadKeys = /[`^~"']/;
return deadKeys.test(input);
}
function appendToOutput(value) {
const output = document.getElementById('output');
if (value === 'CTRL' || value === 'CONTROL' || value === 'SHIFT' || value === 'ALT' || value === 'GUI' ) {
output.value += value + ' ';
} else {
output.value += value + '\n';
}
}
function insertChar() {
const output = document.getElementById('output');
const charInput = document.getElementById('charInput');
const char = charInput.value.trim();
if (char !== '') {
appendToOutput(char); // Execute the insert function directly
charInput.value = '';
}
}
function saveOutput() {
const output = document.getElementById('output');
const filename = prompt("Enter the filename", "output.txt");
const blob = new Blob([output.value], { type: 'text/plain' });
const anchor = document.createElement('a');
anchor.download = filename || 'output.txt';
anchor.href = window.URL.createObjectURL(blob);
anchor.click();
anchor.remove();
}
</script>
</body>
</html>