USB D-Byte

USB D-Byte

USB D-Byte is a compact and powerful USB device that emulates a keyboard—just like the USB Rubber Ducky and other BadUSB tools. What sets it apart is its sleek design, ease of use, and advanced features that make payload deployment faster, smarter, and more flexible.

Key Features

  • Plug & Play Script Deployment: Simply drag and drop your payloads—no need for SD cards or WiFi.
  • Dual Mode Operation: Effortlessly switch between Attack Mode and Setup Mode.
  • USB Mass Storage Support: Recognized as a USB flash drive for easy access and file management.
  • Advanced Scripting Functions: New powerful commands to enhance payload flexibility and control.
  • Multi-Language Keyboard Support: Compatible with a wide range of international keyboard layouts.
  • HID Emulation: Acts as a USB keyboard and mouse, including boot keyboard support for BIOS-level access.
  • Custom USB Identity: Easily modify VID, PID, serial number, manufacturer name, and more.
  • Fully Open-Source: Source code and firmware available for modification and customization.
  • Built-in USB-A Connector: No adapters required—just plug directly into any USB-A port.

Specs USB D-Byte

USB D-Byte
  • Dimensions: 38mm x 16.5mm x 6.5mm
  • Dual-core 133 MHz 32-bit CPU
  • 4/8/16 MB SPI flash
  • 2 Position Mode Switch (Attack & Setup)
  • USB-A plug
  • Reset & boot button

Scripting: Basics

USB D-Byte's script language is compatible with Ducky Script (1.0). However, some functions and keys were added or expanded. You can find a great Ducky Script quick reference at docs.hak5.org.

Basic Rules

  • A single space separates the keys
  • All keys as part of the same line get pressed and released simultaneously
  • To write text, use the STRING function
  • Upper and lower case matters!
ExampleExplanation
WINDOWS RPress the Windows key and the R key simultaneously
STRING Hello WorldWrite "Hello World"

Example Script

REM Hello World Example Script
DEFAULTDELAY 200
DELAY 1000
GUI r
STRING notepad
ENTER
DELAY 1000
STRING Hello World!
LineExplanation
REM This is a commentComment something.
DEFAULTDELAY 200Set the default delay between each line to 200 milliseconds.
DELAY 1000Wait 1 second.
GUI rPress the Windows key and the R key simultaneously to open the run window.
STRING notepadType "notepad".
ENTERPress enter key to launch the Windows Notepad application.
DELAY 1000Wait 1 second.
STRING Hello World!Type "Hello World!" into the newly opened notepad window.

Scripting: Functions

CommandExampleDescription
# or REM# Hello World!Comment
DEFAULTDELAY or DEFAULT_DELAYDEFAULTDELAY 200Time in milliseconds between every command
DELAYDELAY 1000Delay in milliseconds
STRINGSTRING Hello World!Types the following text
STRINGLNSTRINGLN Hello World!Like STRING but presses enter at the end
REPEAT or REPLAYREPEAT 3Repeats the previous line n times

Keyboard Layout

Tip: You can also change the default keyboard layout in the preferences.json. That way, you don't have to use LOCALE in your script.
Use LOCALE to change the keyboard layout. This is necessary for everyone who's not using the US keyboard.
Otherwise, your BadUSB might type the wrong characters.

LOCALE DE
STRING Gänsefüßchen

Available Keyboard Layouts

RegionStandard LayoutMac LayoutNote
Belgium 🇧🇪BEBE_MAC
Bulgaria 🇧🇬BGBG_MAC
Canada 🇨🇦CA-CM, CA-FRCA-FR_MAC
Switzerland 🇨🇭CH-DE, CH-FRCH-DE_MAC, CH-FR_MAC
Czech Republic 🇨🇿CZCZ_MAC
Germany 🇩🇪DEDE_MAC
Denmark 🇩🇰DKDK_MAC
Estonia 🇪🇪EEEE_MAC
Spain 🇪🇸ESES_MAC
Latin-America 🌎ES-LAES-LA_MAC
Finland 🇫🇮FIFI_MAC
France 🇫🇷FRFR_MAC
United Kingdom 🇬🇧GBGB_MAC
Greece 🇬🇷GRGR_MAC
Croatia 🇭🇷HRHR_MACSince v1.2.1
Hungary 🇭🇺HUHU_MAC
Ireland 🇮🇪IE-
India 🇮🇳ININ_MAC
Iceland 🇮🇸ISIS_MAC
Italy 🇮🇹ITIT_MAC
Latvia 🇱🇻LTLT_MAC
Lithuania 🇱🇹LVLV_MAC
Netherlands 🇳🇱NLNL_MAC
Norway 🇳🇴NONO_MAC
Poland 🇵🇱PLPL_MAC
Brazil 🇧🇷PT-BRPT-BR_MAC
Portugal 🇵🇹PTPT_MAC
Romania 🇷🇴RORO_MAC
Russia 🇷🇺RURU_MAC
Sweden 🇸🇪SESE_MAC
Slovenia 🇸🇮SISI_MAC
Slovakia 🇸🇰SKSK_MAC
Turkey 🇹🇷TRTR_MAC
Ukraine 🇺🇦UAUA_MAC
United States 🇺🇸USUS_MAC

Multi-Line Comments

If you have a lot to say, you can use multi-line comments using ###:

###
The quick brown 
fox jumps over 
the lazy dog
###

Large Strings

For longer texts, use LSTRING_BEGIN and LSTRING_END. Everything between those two commands, including linebreaks, gets typed out:

LSTRING_BEGIN
The quick brown 
fox jumps over 
the lazy dog
LSTRING_END

Loops

To repeat one or more lines, you can use LOOP_BEGIN and LOOP_END, which works just like a for-loop:

LOOP_BEGIN 3
STRING Hello 
DELAY 1000
STRINGLN World!
LOOP_END

Imports

With IMPORT, you can start running another script from within a script! This is particularly useful if you want to split your script into multiple files for better readability - instead of having one gigantic script.

IMPORT second_script.txt

LED

Control the onboard LED with the LED function.
You can either set the color (R, G, or B) and mode (SOLID, SLOW, FAST, or OFF):

LED R SOLID
LED G SLOW
LED B FAST

Or you can set a specific RGB color value (0-255):

LED 42 13 37

And optionally, you can also set a blink interval in milliseconds (r,g,b, blink):

LED 42 13 37 500

Custom Keycodes

The KEYCODE function sends specified keycodes to the target computer. You can use it to press any key or combination possible. This is particularly useful if a key is not specified in the script language.
This example presses shift and a, resulting in an "A":

KEYCODE 0x02 0x04

The first argument specifies the modifiers (like shift, ctrl, or alt). The second argument is a key; you can specify up to 6 keys.
Values can be in decimal or hexadecimal:
KEYCODE modifier key1 [key2] [key3] [key4] [key5] [key6]

Scripting: Keys

Standard Keys

a - z, A - Z, 0 - 9, F1 - F12

Modifier Keys

  • CTRL or CONTROL
  • SHIFT
  • ALT
  • GUI or WINDOWS or COMMAND

Other Keys

  • ENTER
  • MENU or APP
  • DELETE
  • HOME
  • INSERT
  • PAGEUP
  • PAGEDOWN
  • UP or UPARROW
  • DOWN or DOWNARROW
  • LEFT or LEFTARROW
  • RIGHT or RIGHTARROW
  • TAB
  • END
  • ESC or ESCAPE
  • SPACE
  • PAUSE or BREAK
  • CAPSLOCK
  • NUMLOCK
  • PRINTSCREEN
  • SCROLLLOCK

Numpad Keys

  • NUM_0 - NUM_9
  • NUM_ASTERIX
  • NUM_ENTER
  • NUM_MINUS
  • NUM_DOT
  • NUM_PLUS

Scripting: Mouse

CommandExampleDescription
MOVE x y or MOUSE x yMOVE 100 0Move the mouse cursor
CLICK button or MOUSE_CLICK buttonCLICK 1Click a mouse button
PRESS button or MOUSE_PRESS buttonPRESS 2Keep pressing a mouse button
RELEASE button or MOUSE_RELEASE buttonRELEASE 2Release a mouse button
SCROLL v h or MOUSE_SCROLL v hSCROLL -10 0Scroll vertically or horizontally

Mouse Buttons

ButtonDescription
0Left button
1Right button
2Middle button
3Backward button
4Forward button

Preferences

1.2 preferences.json

The preferences.json file lets you configure the default behavior of your USB D-Byte device. Place this file in the root directory of the device's storage. The device will read these preferences on startup.

{

  "$schema": "https://raw.githubusercontent.com/RDHRobotics/D-Byte/refs/heads/main/schema.json",
  "enable_msc": false,
  "enable_led": true,
  "enable_hid": true,
  "vid": "16D0",
  "pid": "11A4",
  "version": "0100",
  "serial": "1337",
  "manufacturer": "RDH Robotics",
  "product": "USB D-Byte",
  "default_layout": "US",
  "default_delay": 5,
  "main_script": "main_script.txt",
  "attack_color": [
    128,
    0,
    0,
    0
  ],
  "setup_color": [
    0,
    0,
    20,
    0
  ],
  "idle_color": [
    0,
    30,
    0,
    0
  ],
  "disable_capslock": true,
  "run_on_indicator": false,
  "initial_delay": 1000

}
Setting Default Value Explanation
enable_mscfalseEnable USB mass storage (USB drive) in attack mode
enable_ledtrueEnable RGB LED
enable_hidtrueEnable HID in setup mode
vid16D0USB Vendor ID
pid11A4USB Product ID
version0100USB Product Revision (0100 => 1.00)
serial1337USB serial number descriptor
manufacturerRDH RoboticsUSB manufacturer descriptor
productUSB D-ByteUSB product descriptor
default_layoutUSDefault Keyboard Layout (see all available layouts)
default_delay5Default delay between each line
main_scriptmain_script.txtName of your BadUSB script
attack_color[128,0,0,0]LED color for attack mode
setup_color[0,0,20,0]LED color for setup mode
idle_color[0,30,0,0]LED color for finished attack
disable_capslocktrue(*) Turn off capslock before starting attack
run_on_indicatorfalse(*) Start script when the user presses capslock, numlock, or another indicator key
initial_delay1000Startup delay

Tip: If you want to use a different keyboard layout, set default_layout here so you don't need to specify it in every script.

Credits

This project is based on USB Nova by SpacehuhnTech.
Firmware and hardware have been modified under the terms of the MIT and CERN-OHL-P-2.0 licenses.

Thank you to the open-source community for making innovation accessible to all.