> 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/extensions.md).

# Extensions

Extensions which augment DuckyScript with new commands and functions. For each payload.txt run, extensions are sourced automatically. Calling the function names of any extension will produce the desired result. Extensions reside in the payload library on the USB mass storage partition from `/payloads/library/extensions`.

### EXAMPLE EXTENSIONS

This table is provides a non-exhaustive list of basic usage for some extensions. Additional extension documentation can be found from the comments within each individual extension script file in `/payload/library/extensions`.

| COMMAND       | Description                                                                                                    | Example                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `RUN`         | Keystroke injection shortcut for mutli-OS command execution.                                                   | `RUN WIN notepad.exe`                            |
|               |                                                                                                                | `RUN OSX terminal`                               |
|               |                                                                                                                | `RUN UNITY xterm`                                |
| `GET`         | Exports system variables                                                                                       | `GET TARGET_IP # exports $TARGET_IP`             |
|               |                                                                                                                | `GET TARGET_HOSTNAME # exports $TARGET_HOSTNAME` |
|               |                                                                                                                | `GET HOST_IP # exports $HOST_IP`                 |
|               |                                                                                                                | `GET SWITCH_POSITION # exports $SWITCH_POSITION` |
| `REQUIRETOOL` | Exits payload with LED FAIL state if the specified tool is not found in /tools                                 | `REQUIRETOOL impacket`                           |
| `DUCKY_LANG`  | Accepts two letter country code to set the HID injection language for subsequent ducky script / QUACK commands | `DUCKY_LANG us`                                  |

{% hint style="info" %}
Extensions replaced `bunny_helpers.sh` from [Bash Bunny firmware version 1.1](https://www.bashbunny.com/downloads/) onwards.
{% endhint %}

{% hint style="info" %}
Extensions come pre-installed on the Bash Bunny Mark II
{% endhint %}


---

# 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/extensions.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.
