DuckyScript is the payload language of Hak5 gear.

Originating on the Hak5 USB Rubber Ducky as a standalone language, the Packet Squirrel uses DuckyScript commands to bring the ethos of easy-to-use actions to the payload language.

DuckyScript commands are always in all capital letters to distinguish them from other system or script language commands. Typically, they take a small number of options (or sometimes no options at all).

Payloads can be constructed of DuckyScript commands alone, or combined with the power of bash scripting and system commands to create fully custom, advanced actions.

Ducky Script commands for the Packet Squirrel include:

CommandDocumentationDescription
BUTTONbutton.mdPauses the payload for the specified number of seconds or until the button is pressed.
C2EXFILc2exfil.mdSend a file via Cloud C²
C2NOTIFYc2notify.mdSend a notification via Cloud C²
C2WATCHDIRc2watchdir.mdWatch for new files in a directory and automatically send them to Cloud C²
DYNAMICPROXYdynamicproxy.mdCreate a dynamic man-in-the-middle TCP proxy to intercept traffic in NAT and BRIDGE modes.
KILLPORTkillport.mdKill any traffic seen on one or several ports by injecting TCP RST packets.
KILLSTREAMkillstream.mdKill any streams on or several ports by injecting TCP RST packets.
LEDled.mdControl the RGB LED on the front of the Packet Squirrel; parameters include color and pattern.
MATCHPORTmatchport.mdPause the payload until traffic is matched on one or more ports.
MATCHSTREAMmatchstream.mdPause the payload until traffic matching a regular expression is seen.
NETMODEnetmode.mdSet the network mode of the Packet Squirrel.
SELFDESTRUCTselfdestruct.mdWipe the Packet Squirrel internal storage and attached USB, and reboot into lockdown mode with transparent bridging only.
SSH_STARTssh_start.mdLaunch the SSH server
SSH_STOPssh_stop.mdStop the SSH server
SPOOFDNSspoofdns.mdOverwrite DNS queries
SWITCHswitch.mdReports the current switch position.
(This is NOT necessarily the payload currently running, if the switch was moved after boot!)
UI_STARTui_start.mdLaunch the Packet Squirrel web UI
UI_STOPui_stop.mdStop the Packet Squirrel web UI
USB_FREEusb_free.mdReturn how much USB storage is available, in bytes
USB_STORAGEusb_storage.mdDetect if USB storage is present
USB_WAITusb_wait.mdWait until USB storage is attached

A simple payload

As an extremely simple demo of payload capabilities, this payload sets the LED color, waits for a button press, then changes the LED color:

  #!/bin/bash

NETMODE NAT

LED C SINGLE

BUTTON

LED B TRIPLE