-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
159 lines (146 loc) · 4.95 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<html>
<head>
<meta charset="utf-8" />
<title>ducky2digi</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body, button, select, input, a, textarea {
color: #ffffff;
text-shadow: 0px 4px 8px rgba(0,0,0,0.5);
font-family: monospace;
}
body, button, select, input, textarea {
background-color: #000000;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 0.3em solid white;
margin: 1em 0;
padding: 0;
}
</style>
<script src="ducky2digi.js"></script>
</head>
<body>
<div style="margin:auto;max-width:850px">
<center>
<h1>Duckyscript to Digispark</h1>
<hr>
By
<a href="https://naheel.xyz">Naheel</a>
- Source and installation instructions at <a href="https://github.com/Naheel-Azawy/ducky2digi">GitHub</a>
<br><br>Convert
<a href="https://shop.hak5.org/products/usb-rubber-ducky-deluxe">USB-Rubber-Ducky</a>'s
scripts to <a href="http://digistump.com/products/1">Digispark</a> Arduino sketches
<br><br>
<table>
<tr>
<td><h2>Rubber-Ducky payload (input)</h2></td>
<td><h2>Digispark sketch (output)</h2></td>
</tr>
<tr>
<td>
<textarea id="inp" rows="25" cols="50" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
REM Sample payload
REM https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payload---Wallpaper-prank
GUI d
DELAY 500
PRINTSCREEN
DELAY 100
MENU
DELAY 300
STRING V
DELAY 40
STRING D
DELAY 300
GUI r
DELAY 700
STRING mspaint
ENTER
DELAY 1200
CTRL v
DELAY 500
CTRL s
DELAY 1000
STRING %userprofile%\a.bmp
ENTER
DELAY 500
ALT f
DELAY 400
STRING K
DELAY 100
STRING F
DELAY 1000
ALT F4
DELAY 300
GUI d
</textarea>
</td>
<td>
<textarea id="out" rows="25" cols="50" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
</textarea>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="no-flash">
<label for="no-flash">Prevent storing strings in flash</label><br>
</td>
<td>
<button style="float:right" onclick="run()">CONVERT</button>
<button style="float:right;margin-right:5px" onclick="copy()">COPY OUTPUT</button>
</td>
</tr>
</table>
</center>
</div>
<script>
// https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
function copyTextToClipboard(text) {
if (!navigator.clipboard) {
var textArea = document.createElement("textarea");
textArea.value = text;
// Avoid scrolling to bottom
textArea.style.top = "0";
textArea.style.left = "0";
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Fallback: Copying text command was ' + msg);
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
}
document.body.removeChild(textArea);
return;
}
navigator.clipboard.writeText(text).then(function() {
console.log('Async: Copying to clipboard was successful!');
}, function(err) {
console.error('Async: Could not copy text: ', err);
});
}
function run() {
const inp = document.getElementById("inp").value;
const opts = {
no_flash_str: document.getElementById("no-flash").checked
};
let out;
try {
out = ducky2digi(inp, opts);
} catch (e) {
out = e;
}
document.getElementById("out").value = out;
}
function copy() {
copyTextToClipboard(document.getElementById("out").value);
}
</script>
</body>
</html>