This release is a pre-release and may not be stable for production use.
DuckHunt
Prevent RubberDucky and Keystroke Injection Attacks
DuckHunt protects Windows from "RubberDucky" attacks by monitoring typing patterns and immediately locking the system upon detecting inhumanly fast keystroke inputs.
✨ Features
- Heuristic Detection: Analyzes typing speed and burst patterns to distinguish between human typing and automated scripts.
- Background Protection: Runs unobtrusively in the system tray.
- Smart Session Monitoring: Event-based detection automatically pauses monitoring when the workstation is locked (no polling overhead).
- Secure & Robust:
- Uses a split-process architecture (GUI + Daemon) for stability.
- Single-instance enforcement prevents conflicts.
- Auto-restarting daemon ensures continuous protection.
- Configurable: Adjustable sensitivity thresholds to match your typing style.
📦 Installation
Prerequisites: Python 3.10 or higher.
-
Install from PyPI:
pip install duckhunt-win
-
Clone the repository (for development):
git clone https://github.com/qb20nh/duckhunt.git cd duckhunt
-
Install dependencies:
pip install .
For development, you can install with dev dependencies:
pip install -e .[dev]
🚀 Usage
Starting DuckHunt
You can start the application by running the module directly:
python -m duckhunt-win
Or by running the executable if you have downloaded the latest release.
System Tray Controls
Once running, DuckHunt appears in your system tray:
- Left-Click / Toggle: Enable or Disable monitoring.
- Settings: Open the configuration window to adjust sensitivity.
- Exit: Quit the application and stop the background protection daemon.
How it Works
- Monitoring: The
Daemonprocess listens to global keystrokes using low-level hooks. - Detection: If the typing speed exceeds the configured Threshold (default 30ms/key) or exhibits suspicious Bursts, the detector flags the activity.
- Reaction: The workstation is immediately locked via Windows API.
- Notification: When you unlock your computer, DuckHunt notifies you that an attack was blocked.
⚙️ Configuration
You can configure DuckHunt via the Settings window or by creating a duckhunt.toml (or duckhunt.conf) file in your home directory or the application folder.
| Setting | Default | Description |
|---|---|---|
threshold |
30 |
Average interval between keys in milliseconds. Lower means faster typing is allowed (less sensitive). |
history_size |
25 |
Number of recent keystrokes to analyze for average speed. |
burst_keys |
10 |
Number of keys in a sequence to trigger "burst" detection. |
burst_window_ms |
100 |
Maximum time (ms) allowing burst_keys to be pressed before flagging as suspicious. |
allow_auto_type |
true |
(Experimental) Allow software simulated keys. |
📄 License
MIT License
Metadata
Release files for duckhunt-win 1.0.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| duckhunt_win-1.0.0rc1.tar.gz | 5.1 kB | With provenance | Details for duckhunt_win-1.0.0rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| duckhunt_win-1.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details for duckhunt_win-1.0.0rc1-py3-none-any.whl |
Total release size: 10.7 kB
Release files / duckhunt_win-1.0.0rc1.tar.gz
| Download URL | duckhunt_win-1.0.0rc1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e05aeaa3b29c902d0523599f0c32b7624397af2ae924efb9a436a2795a82407
|
|
BLAKE2b-256 checksum How to use checksums |
b4d671fe872737dbe67b54bc6de55f2e2548798ce9c4e8c8081fe8b39665bb8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Dec 10, 2025.
Transparency logRelease files / duckhunt_win-1.0.0rc1-py3-none-any.whl
| Download URL | duckhunt_win-1.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a4c889629ff2575942b3ccb193cc26abf5682ebfe5cd6a542a3801c9c9413ae
|
|
BLAKE2b-256 checksum How to use checksums |
f93fd1299186ed4f133c1f4a37ff48e0c11c3583ee37991de9b3c026536bb78a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Dec 10, 2025.
Transparency logSecurity for duckhunt-win 1.0.0rc1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for duckhunt_win-1.0.0rc1.tar.gz
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 Dec 10, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.