Skip to main content

📦 arduck

License: GPL v3 Python version: 3.12+ Common Changelog

Overview

This package provides a simple and flexible way to generate keystroke injection scripts. It supports a variety of boards and keyboard layouts.

Rather than relying on expensive proprietary devices (rubberducky cough cough), you can use any Arduino-compatible board that supports the Keyboard.h library.

Installation

Install the package from PyPI by running:

$ pip install arduck

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"

A Word of Caution

Be careful when using and testing arduino scripts that emulate keyboard and mouse presses, because they might make it difficult to program your board. And please, always ask for permission from the owner of the machine before plugging in any external devices. Keep in mind that, if abused, this tool has the potential to cause serious harm.

This software is distributed ‘as is’ and without warranties of any kind, either express or implied. Use of the software is at your own risk.

Documentation

Release files for arduck 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arduck 0.0.6
File Size Uploaded
arduck-0.0.6.tar.gz 76.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arduck 0.0.6
File Interpreter ABI Platform
arduck-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 138.9 kB

Release files / arduck-0.0.6.tar.gz

Download URL arduck-0.0.6.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
adffc9c3b5c93dcc827d4c72086d08fd4cc219a5622306103d7d73fda6be06fb
BLAKE2b-256 checksum
How to use checksums
08bf3574bfca383c89d860880dc951f163b6e5ec9d956862a81871eda122bdc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2025.

Transparency log

Release files / arduck-0.0.6-py3-none-any.whl

Download URL arduck-0.0.6-py3-none-any.whl
Size 62.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9d5b3f48e71b5df71017059448a09c4650c74a1de05e03aa8200e38510a5d59
BLAKE2b-256 checksum
How to use checksums
d01d5f5a3180987777c694c432b25372e1900accce42cc70cf468ff1abf840f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page