Path: blob/master/payloads/examples/Button/Button-example4.txt
2968 views
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.1REM 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.2REM 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.34BUTTON_DEF5STRING The button was pressed!6STOP_PAYLOAD7END_BUTTON89WHILE TRUE10STRING .11DELAY 100012END_WHILE131415REM The payload will type a period every second until the button is pressed.16REM Once the button is pressed, the payload will type the text “The button was pressed!”17REM After the button press text is typed, the payload will terminate.181920