Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitLabGitLab/dorukerel3/rubber-ducky-esp32
Embedded Systems SecurityExploitationSecurity VirtualizationHardware HackingPenetration TestingUtilities & FrameworksHardware & IoT SecurityLearning & Education
Share
Red Teaming
Payload Development
GitLabdorukerel3/rubber-ducky-esp32

Rubber-Ducky-ESP32

An ESP32-based USB HID keystroke-injection tool built to study how BadUSB-class devices operate. A learning-focused security prototype, with no weaponized payloads.

View Repository
1 day agoNot yet reviewed

Rubber-Ducky-ESP32 (Silicon Ghost)

Custom ESP32-S3 HID-injection tool in a USB flash-drive form factor. Runs a DuckyScript-compatible payload interpreter directly from a MicroSD card, with keyboard + mouse injection, five keyboard layouts, sequential multi-stage execution, and a browser based OTA firmware updater, all in a single-.ino sketch built around a heap-fragmentation-free, industrial-grade hot path.

The firmware is engineered to reach the same effective per-keystroke throughput class as commercial injectors (Hak5 Rubber Ducky / Flipper Zero BadUSB), while still reading uncompiled .txt payloads from the SD card on the fly, no .bin pre-compilation step required.


Table of Contents

  • Feature Summary
  • Hardware Gallery
  • Hardware
  • Architecture Highlights
  • SD Card Layout
  • DuckyScript Command Reference
  • Keyboard Layouts
  • OTA Firmware Update
  • LED Status Codes
  • Build & Flash
  • Configuration Constants
  • Repository Contents
  • Disclaimer
  • License

Feature Summary

CapabilityDetail
USB enumerationNative composite HID (keyboard + mouse) via ESP32-S3 TinyUSB stack, no host-side driver install
Payload sourceUncompiled .txt DuckyScript files, read live from MicroSD, no pre-compilation
Multi-stage executionSequential run of every N.txt file in card root, sorted numerically
Keyboard layouts5 layouts: EN, TR, FR, DE, JP, switchable mid-payload with LAYOUT
Character resolutionO(1) 256-entry lookup tables per layout + tiny sorted overflow table for code points > 255
I/O strategy512-byte chunked SD reads into a fixed RAM buffer; zero character-by-character file reads
Memory modelZero use of the Arduino String class. All parsing on char[] buffers with strtok_r/strtol/strchr. No heap allocations after setup()
HID timingdelayMicroseconds()-based press/release intervals (default 1 ms), an order of magnitude tighter than a naive Arduino sketch
OTA updatesBrowser based upload page over a self-hosted WiFi Access Point, gated by a boot-time trigger
Status feedbacksingle LED signaling for ready / SD error / no payload / OTA modes

Hardware Gallery

Here are the physical production results of the custom designed printed circuit board:

Rubber Ducky Front Rubber Ducky Back


Hardware

AspectPart / Value
MicrocontrollerESP32-S3-WROOM-2 (N32R8V recommended, 32 MB flash / 8 MB PSRAM)
Power regulationAP2112K-3.3 (5 V USB → 3.3 V LDO)
USB connectorMolex 48037-2200 Type-A
SD connectorHirose DM3AT-SF-PEJM5 (MicroSD, SPI mode)
Status LEDGPIO 46
SD SPI busHSPI: CS 10, MOSI 11, SCK 12, MISO 13
OTA trigger pinGPIO 4 (INPUT_PULLUP, hold to GND at boot)

PCB schematic and layout designed in KiCad. Full Gerbers, BOM/CPL, 3D models and enclosure for independent fabrication live under rubber_ducky_files/.


Architecture Highlights

The firmware is written to industrial-embedded standards, not hobby Arduino conventions.

Zero-allocation hot path. Every text-processing routine (line reading, tokenisation, command dispatch, UTF-8 decoding) operates on stack-resident char[] buffers. The Arduino String class is not linked anywhere in the runtime, eliminating heap fragmentation entirely.

Chunked buffered I/O. SD payloads are read in 512-byte blocks into a LineReader struct that walks a pointer through the buffer, transparently stitching lines across chunk boundaries. File::readStringUntil() is not used.

O(1) character lookup. Every layout's charmap is expanded once at boot (buildCharTables()) into a flat 256-entry array indexed directly by Unicode code point. A single memory dereference (g_table256[layout][cp]) retrieves the HID report (modifier + keycode) for any Latin-1 character. Code points above 255 (TR İığĞşŞ, FR œŒ, the shared €) live in a per-layout overflow table of ≤ 8 entries, serviced by binary search: mathematically O(log n) on a single-digit n, effectively free.

Microsecond HID timing. Press/release spacing runs on delayMicroseconds() (default 1 ms per phase) rather than the millisecond-scale delay() calls a typical sketch uses. The interval sits above the standard 1 ms USB HID polling interrupt so no reports are dropped, but well below anything a human scale delay would impose, putting the effective character rate in the same class as dedicated commercial injectors.

Fixed size stage table. SD root discovery lands into a static int[256] sorted with an insertion sort. No std::vector, no std::sort, no allocator activity.


SD Card Layout

Format the card as FAT32. The firmware only touches the root directory.

  • Files are matched by exact pattern: numeric basename + .txt (case-insensitive extension).
  • Between stages the interpreter waits 500 ms, resets g_layout to EN, and clears the REPEAT history; stages do not leak state.
  • After the last stage completes the LED turns off and the device halts. It does not loop back and rerun stage 1 automatically.

No payloads are included in this repository. The interpreter executes only user-supplied .txt scripts.


DuckyScript Command Reference

All commands are case-sensitive and one per line. Blank lines and lines beginning with REM, //, or # are ignored.

Text injection

CommandBehavior
STRING <text>Type UTF-8 text through the active layout
STRINGLN <text>Same as STRING, then press ENTER
STRING_DELAY <ms> <text>Type text with an inter-character pause of <ms> milliseconds
STRINGLN_DELAY <ms> <text>As above, then ENTER

Timing

CommandBehavior
DELAY <ms>Blocking wait for <ms> milliseconds
DEFAULT_DELAY <ms> / DEFAULTDELAY <ms>Insert this delay after every subsequent command

Modifier / key combos

Combine any of CTRL/CONTROL, SHIFT, ALT, GUI/WINDOWS/COMMAND/META, ALTGR/RALT with one named key or single character.

Named keys

ENTER/RETURN, TAB, SPACE, BACKSPACE/BKSP, DELETE/DEL, ESCAPE/ESC, HOME, END, INSERT, PAGEUP/PAGE_UP, PAGEDOWN/PAGE_DOWN, UP/DOWN/LEFT/RIGHT, CAPSLOCK/CAPS_LOCK, NUMLOCK/NUM_LOCK, SCROLLLOCK/SCROLL_LOCK, PRINTSCREEN/PRTSC, PAUSE/BREAK, MENU/APP, F1 through F24.

Mouse

CommandBehavior
MOUSE_MOVE <dx> <dy>Relative move; any range, auto-chunked into ±127 HID reports
MOUSE_CLICK LEFT|RIGHT|MIDDLESingle click
MOUSE_PRESS LEFT|RIGHT|MIDDLEHold button down (no auto-release)
MOUSE_RELEASERelease all mouse buttons
MOUSE_SCROLL <n>Vertical wheel scroll, -127..127

Control flow

CommandBehavior
REPEAT <n>Run the previous non-REPEAT line <n> times
LAYOUT <code>Switch active keyboard layout: EN, TR, FR, DE, JP

Keyboard Layouts

Layouts are compile-time embedded and activated at runtime with LAYOUT.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    957
  • 2

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    770
  • 3

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    566
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    512
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    470
  • 6

    mcp-reverse

    1llu50ry/mcp-reverse

    MCP server exposing 180+ reverse-engineering tools that aggregate Ghidra, IDA, x64dbg, Frida and 56 other backends with native binary parsers and a 4,200-skill knowledge base.

    359

Explore all tools

Browse our collection of tools

View all tools →