The LED
The USB Rubber Ducky includes an LED which may be helpful when deploying certain payloads where feedback is important.
Keep in mind that without modification, the LED is not visible when the USB Rubber Ducky is enclosed in its Flash Drive case.
The default behavior of the LED, which may be overridden, is as follows:
LED Color | LED State | Indication |
---|---|---|
Green | Solid | Idle |
Green | Blinking | Processing Payload |
Red | Solid | No inject.bin found on root of SD card, or no SD card present. |
The
LED
command allows you to control the red and green LEDs on the USB Rubber Ducky. Using the LED
command will override the default behavior.Calling
LED_G
, LED_R
, or LED_OFF
will automatically disable all default LED behaviorsThe LED_OFF command will disable all LED modes.
ATTACKMODE HID STORAGE
LED_OFF
- The LED will turn off.
The
LED_R
command will enable the red LED.ATTACKMODE HID STORAGE
WHILE TRUE
IF ($_CAPSLOCK_ON == TRUE) THEN
LED_R
ELSE IF ($_CAPSLOCK_ON == FALSE) THEN
LED_OFF
END_IF
END_WHILE
- The LED will turn solid red while caps lock is on.
The
LED_G
command will enable the green LED.ATTACKMODE HID STORAGE
BUTTON_DEF
LED_OFF
STOP_PAYLOAD
END_BUTTON
WHILE TRUE
LED_G
DELAY 1000
LED_R
DELAY 1000
END_WHILE
- The LED will alternate between solid red and solid green at one second intervals.
- Pressing the button will turn the LED off and stop the payload.
ATTACKMODE HID STORAGE
WHILE TRUE
LED_R
WAIT_FOR_BUTTON_PRESS
LED_G
WAIT_FOR_BUTTON_PRESS
END_WHILE
- The LED will alternate between red and green after each button press.
The following internal variables relate to the LED and may be used in your payload for advanced functions.
Default set
TRUE
. May be retrieved or set.LED behaviors for boot,
ATTACKMODE
change, and idle (payload complete).Default set
TRUE
. May be retrieved or set.When
TRUE
blinks the LED red/green on storage read/write in ATTACKMODE STORAGE
.Default set
FALSE
. May be retrieved or set.When set
TRUE
and in ATTACKMODE
that includes STORAGE
the LED will light solid green when the storage has been inactive for longer than $_STORAGE_ACTIVITY_TIMEOUT
(default 1000 ms). Otherwise, the LED will light red when active.Default set
TRUE
. May be retrieved or set.When
TRUE
the LED will blink green on payload execution.Default set
TRUE
. May be retrieved or set.Default set
FALSE
. May be retrieved or set.When set
TRUE
will bind the GREEN LED state to the CAPSLOCK
state.Default set
FALSE
. May be retrieved or set.When set
TRUE
will bind the RED LED state to the NUMLOCK
state.Default set
FALSE
. May be retrieved or set.When set
TRUE
will bind the GREEN LED state to the SCROLLLOCK
state.