Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Button/Button-example4.txt
2968 views
1
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.
2
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.
3
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.
4
5
BUTTON_DEF
6
STRING The button was pressed!
7
STOP_PAYLOAD
8
END_BUTTON
9
10
WHILE TRUE
11
STRING .
12
DELAY 1000
13
END_WHILE
14
15
16
REM The payload will type a period every second until the button is pressed.
17
REM Once the button is pressed, the payload will type the text “The button was pressed!”
18
REM After the button press text is typed, the payload will terminate.
19
20