0% found this document useful (0 votes)
6 views1 page

USB Rubber Ducky Button Function Guide

The document describes the BUTTON_DEF function, which executes when a button is pressed unless it is already in use. If no BUTTON_DEF is defined, the button will stop execution and enter ATTACKMODE STORAGE. The example payload types a period every second until the button is pressed, at which point it types a message and terminates.

Uploaded by

y2901773
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

USB Rubber Ducky Button Function Guide

The document describes the BUTTON_DEF function, which executes when a button is pressed unless it is already in use. If no BUTTON_DEF is defined, the button will stop execution and enter ATTACKMODE STORAGE. The example payload types a period every second until the button is pressed, at which point it types a message and terminates.

Uploaded by

y2901773
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

REM BUTTON_DEF defines a function which will execute when the button is pressed

anytime within the payload so long as the button control is not already in use by
the WAIT_FOR_BUTTON_PRESS command or other such function.
REM By default, if no button definition (BUTTON_DEF) is included in the payload,
the button will stop all further payload execution and invoke ATTACKMODE STORAGE
— entering the USB Rubber Ducky into arming mode.
REM Similar to functions (described later), which begin with FUNCTION NAME() and
with END_FUNCTION, the button definition begins with BUTTON_DEF and ends with
END_BUTTON.

BUTTON_DEF
STRING The button was pressed!
STOP_PAYLOAD
END_BUTTON

WHILE TRUE
STRING .
DELAY 1000
END_WHILE

REM The payload will type a period every second until the button is pressed.
REM Once the button is pressed, the payload will type the text “The button was
pressed!”
REM After the button press text is typed, the payload will terminate.

You might also like