Packet Squirrel
Search…
The BUTTON Command
BUTTON is a Ducky Script command for the Packet Squirrel which pauses the payload until either the hardware push-button has been momentarily depressed, or an optionally specified time has elapsed.
In the event that a time is specified, BUTTON will exit with a non zero return code if the push-button is not pressed in the given time, and zero if the push-button was pressed.
1
BUTTON 1m && {
2
echo "button pressed"
3
} || {
4
echo "button not pressed"
5
}
Copied!
If no time is specified the BUTTON command will pause indefinitely until the push-button is pressed.
During this pause, the LED will light the SPECIAL status, meaning a solid cyan color which blinks off for 100 ms every second.
Time may be specified in (s)econds, (m)inutes, (h)ours or (d)ays. For example:
1
BUTTON 10s # Wait for 10 seconds for button press
2
BUTTON 30m # Wait for 30 minutes for button press
3
BUTTON 365d # Wait 1 year for button press
4
BUTTON # wait indefinitely for button press
Copied!
The special LED status light may be suppressed by setting the NO_LED environment variable to 1.
1
NO_LED=1 BUTTON 1m
Copied!
Copy link