> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/bash-bunny/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/bash-bunny/writing-payloads/duckyscript-tm-on-the-bash-bunny.md).

# DuckyScript™ on the Bash Bunny

**DuckyScript™ is the payload language of Hak5 gear.** It consists of a number of simple commands specific to the Bash Bunny hardware, some helper functions and the full power of the Bash Unix shell and command language. These payloads, named `payload.txt`, execute on boot by the Bash Bunny depending on the switch position.

[*Extensions*](/bash-bunny/writing-payloads/extensions.md) can be sourced which extend the DuckyScript language with user contributed functions and variables which enhance and simplify payloads. \
\
All DuckyScript commands are written in ALL CAPS. <br>

The base DuckyScript commands are:

| COMMAND      | Description                                                       |
| ------------ | ----------------------------------------------------------------- |
| `ATTACKMODE` | Specifies the USB device or combination of devices to emulate.    |
| `LED`        | Control the RGB LED. Accepts color and pattern or payload state.  |
| `QUACK`      | Injects keystrokes (ducky script) or specified ducky script file. |
| `Q`          | Alias for QUACK                                                   |
| `DUCKY_LANG` | Set the HID Keyboard language. *e.g: DUCKY\_LANG us*              |

### Converting from USB Rubber Ducky

If you are looking to convert a payload from DuckyScript 1.0 from the USB Rubber Ducky, you will need to append [`QUACK`](/bash-bunny/writing-payloads/quack.md) to most lines in that payload to make it Bash Bunny Compatible.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.hak5.org/bash-bunny/writing-payloads/duckyscript-tm-on-the-bash-bunny.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
