Basic Usage
Start generating payloads right away with the duck console script:
$ duck "helloworld!\n"
This will create a sketch.ino file in the current working directory.
Compiling and uploading the code to an Arduino board will make it emulate the keystrokes when plugged into a computer.
Be ready to quickly disconnect the board to avoid triggering the payload on your machine.
Special Keys
To inject special keys (e.g. CAPS_LOCK), wrap them in <>.
When specifying a special key, the KEY_ prefix can be omitted.
$ duck "<F1>"
All default special keys are listed here. Note that some keyboards may have support for other non-standard keys.
Key Combinations
To emulate pressing multiple keys at once wrap them in <>, separated by a +.
$ duck "<LEFT_GUI+r>calc.exe\n"
Add delays
An optional delay in milliseconds can be added in between strings in the input.
$ duck "<LEFT_GUI+r>" 700 "notepad.exe\n" 500 "hello\n" "world!\n"
Presets…
Tired of writing the same payload over and over again just with minor adjustments? Not anymore! Presets take care of the repetitive aspects of writing a payload.
Let’s illustrate their usefulness with an example: you need to write a payload for a Windows machine that opens up the run dialog box and executes a command.
Instead of manually adding <LEFT_GUI+r> to the beginning of your payload, just use the win/run preset!
More complex presets can even have a custom argument parser (e.g. win/sclogon):
$ duck -p win/sclogon -- calc.exe -d "this task gets triggered at logon"
Note the use of the double dash -- to separate the preset arguments.
…and Templates!
While presets can only affect keystrokes, templates can change the structure of the payload.
For example, the win/alt template makes it so that every keystroke that the user provides is inserted as a Windows ALT code (cp1252).
This can come in handy when injecting a Windows machine with an unknown keyboard layout, since ALT codes should be universal (emphasis on the should).
Presets and templates can be used together. The following example demonstrates how to create a payload that opens up the run dialog box on Windows and executes calc.exe while using ALT codes:
$ duck -p win/run -t win/alt "calc.exe\n"