> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/lan-turtle-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle.md).

# DuckyScript for LAN Turtle

DuckyScript is the payload language of Hak5 gear.

Originating on the [Hak5 USB Rubber Ducky](https://shop.hak5.org/products/usb-rubber-ducky) as a standalone language, the LAN Turtle Hub 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.

{% hint style="info" %}
While the LAN Turtle Hub supports multiple languages for payloads (such as Python), all example use of the DuckyScript commands will be shown using a `bash` based payload. For other, custom payloads, the DuckyScript commands should be executed as system commands.
{% endhint %}

Ducky Script commands for the LAN Turtle Hub include:<br>

<table><thead><tr><th width="268">Command</th><th>Documentation</th><th>Description</th></tr></thead><tbody><tr><td><code>AUTOSSH</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md#autossh">AUTOSSH</a></td><td>Controls and configures the autossh tool</td></tr><tr><td><code>AUTOSSH_ADD_PORT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md#autossh_add_port">AUTOSSH</a></td><td>Adds a local or remote port to the autossh configuration</td></tr><tr><td><code>AUTOSSH_CLEAR</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md#autossh_clear">AUTOSSH</a></td><td>Clears the autossh configuration</td></tr><tr><td><code>AUTOSSH_DISABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md#autossh_disable">AUTOSSH</a></td><td>Disables the autossh service</td></tr><tr><td><code>AUTOSSH_ENABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md#autossh_enable">AUTOSSH</a></td><td>Enables the autossh service</td></tr><tr><td><code>BOOT_LED</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/boot_led.md">BOOT_LED</a></td><td>Configures the default LED state</td></tr><tr><td><code>BOOT_PAYLOAD</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/boot_payload.md">BOOT_PAYLOAD</a></td><td>Configures running the payload on boot</td></tr><tr><td><code>C2EXFIL</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/c2.md">C2</a></td><td>Send a file via Cloud C²</td></tr><tr><td><code>C2NOTIFY</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/c2.md">C2</a></td><td>Send a notification via Cloud C²</td></tr><tr><td><code>C2WATCHDIR</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/c2.md">C2</a></td><td>Automatically send files to Cloud C²</td></tr><tr><td><code>DNSSPOOF_ADD_HOST</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/dnsspoof.md">DNSSPOOF</a></td><td>Add a host to the DNS override list</td></tr><tr><td><code>DNSSPOOF_CLEAR</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/dnsspoof.md">DNSSPOOF</a></td><td>Clear all hosts from the DNS override list</td></tr><tr><td><code>DNSSPOOF_DEL_HOST</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/dnsspoof.md">DNSSPOOF</a></td><td>Remove a host from the DNS override list</td></tr><tr><td><code>DNSSPOOF_DISABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/dnsspoof.md">DNSSPOOF</a></td><td>Disable the DNS override service</td></tr><tr><td><code>DNSSPOOF_ENABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/dnsspoof.md">DNSSPOOF</a></td><td>Enable the DNS override service</td></tr><tr><td><code>LED</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/led.md">LED</a></td><td>Control the RGB LED on the top of the LAN Turtle Hub; parameters include color and pattern</td></tr><tr><td><code>LOG_CRITICAL</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/log.md">LOG</a></td><td>Log a critical-level message for the management UI</td></tr><tr><td><code>LOG_ERROR</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/log.md">LOG</a></td><td>Log an error-level message for the management UI</td></tr><tr><td><code>LOG_INFO</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/log.md">LOG</a></td><td>Log an info-level message for the management UI</td></tr><tr><td><code>LOG_WARNING</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/log.md">LOG</a></td><td>Log a warning-level message for the management UI</td></tr><tr><td><code>MGMT_FIREWALL</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/mgmt_firewall.md">MGMT_FIREWALL</a></td><td>Configure access to the management interface of the LAN Turtle Hub</td></tr><tr><td><code>NOTIFY_ERROR</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/notify.md">NOTIFY</a></td><td>Raise an error-level notification in the management UI</td></tr><tr><td><code>NOTIFY_INFO</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/notify.md">NOTIFY</a></td><td>Raise an info-level notification in the management UI</td></tr><tr><td><code>NOTIFY_WARNING</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/notify.md">NOTIFY</a></td><td>Raise a warning-level notification in the management UI</td></tr><tr><td><code>OPENVPN_CONFIGURE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/openvpn.md">OPENVPN</a></td><td>Configure the OpenVPN service</td></tr><tr><td><code>OPENVPN_DISABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/openvpn.md">OPENVPN</a></td><td>Disable the OpenVPN service</td></tr><tr><td><code>OPENVPN_ENABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/openvpn.md">OPENVPN</a></td><td>Enable the OpenVPN service</td></tr><tr><td><code>SSH_ADD_KNOWN_HOST</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/autossh.md">AUTOSSH</a></td><td>Add a known host to SSH</td></tr><tr><td><code>SSH_FIREWALL</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/ssh_firewall.md">SSH_FIREWALL</a></td><td>Control access to the SSH server on the LAN Turtle Hub</td></tr><tr><td><code>SYSTEM_DNS</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/system_dns.md">SYSTEM_DNS</a></td><td>Control and configure the DNS server used by the system</td></tr><tr><td><code>USB_CLAIM_DEVICE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>Claim the USB port for the LAN Turtle Hub</td></tr><tr><td><code>USB_EJECT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>Safely eject a mounted USB device</td></tr><tr><td><code>USB_FREE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>Report the free space from a connected USB device</td></tr><tr><td><code>USB_PASSTHROUGH_DEVICE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/getting-started/using-the-lan-turtle-hub/usb.md">USB</a></td><td>Pass the USB port to the target system</td></tr><tr><td><code>USB_POWER_OFF</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/getting-started/using-the-lan-turtle-hub/usb.md">USB</a></td><td>Disable power for the controllable USB port</td></tr><tr><td><code>USB_POWER_ON</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>Enable power for the controllable USB port</td></tr><tr><td><code>USB_STORAGE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>todo</td></tr><tr><td><code>USB_WAIT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/usb.md">USB</a></td><td>Wait until USB storage is attached</td></tr><tr><td><code>WAIT_FOR_NTP</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wait_for_ntp.md">WAIT_FOR_NTP</a></td><td>Wait until time is synchronized via NTP</td></tr><tr><td><code>WAN_IPCONFIG</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wan_ipconfig.md">WAN_IPCONFIG</a></td><td>Control and configure the RJ45 interface</td></tr><tr><td><code>WIFI_CONNECT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wifi.md">WIFI</a></td><td>Configure the LAN Turtle Hub as a client of another AP</td></tr><tr><td><code>WIFI_DISCONNECT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wifi.md">WIFI</a></td><td>Disconnect the LAN Turtle Hub from a client network</td></tr><tr><td><code>WIFI_MGMT_AP</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wifi.md">WIFI</a></td><td>Configure the LAN Turtle Hub management AP</td></tr><tr><td><code>WIFI_MGMT_AP_DISABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wifi.md">WIFI</a></td><td>Disable the LAN Turtle Hub management AP</td></tr><tr><td><code>WIFI_WAIT</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wifi.md">WIFI</a></td><td>Wait for a WiFi client connection</td></tr><tr><td><code>WIREGUARD_CONFIGURE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wireguard.md">WIREGUARD</a></td><td>Configure the WireGuard client</td></tr><tr><td><code>WIREGUARD_DISABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wireguard.md">WIREGUARD</a></td><td>Disable the WireGuard client</td></tr><tr><td><code>WIREGUARD_ENABLE</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wireguard.md">WIREGUARD</a></td><td>Enable the WireGuard client</td></tr><tr><td><code>WOL_ADD_HOST</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wake-on-lan.md">WAKE-ON-LAN</a></td><td>Add a host to the Wake on LAN list</td></tr><tr><td><code>WOL_CLEAR_HOSTS</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wake-on-lan.md">WAKE-ON-LAN</a></td><td>Clear the Wake on LAN hosts list</td></tr><tr><td><code>WOL_WAKE_HOST</code></td><td><a href="https://documentation.hak5.org/lan-turtle-hub/payload-development/duckyscript-for-lan-turtle/wake-on-lan.md">WAKE-ON-LAN</a></td><td>Wake a known host or device by MAC</td></tr></tbody></table>

### A Simple Payload

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

```
#!/bin/bash

# Title: Basic demo one
#
# Description: A simple payload that waits for a USB device

# Set the LED to blinking cyan
LED C SINGLE

# Wait forever until a USB device is connected
USB_WAIT

# Set the LED to blink blue in a triple pattern
LED B TRIPLE
```
