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

# ATTACKMODE

`ATTACKMODE` is a DuckyScript command which specifies which devices to emulate. The ATTACKMODE command may be issued multiple times within a given payload. For example, a payload may begin by emulating Ethernet, then switch to emulating a keyboard and serial later based on a number of conditions.

| ATTACKMODE       | Description                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SERIAL`         | <p>ACM – Abstract Control Model<br>Serial Console</p>                                                                                                                                                                                                                                                                                                                               |
| `ECM_ETHERNET`   | <p>ECM – Ethernet Control Model<br>Linux/Mac/Android Ethernet Adapter</p>                                                                                                                                                                                                                                                                                                           |
| `RNDIS_ETHERNET` | <p>RNDIS – Remote Network Driver Interface Specification<br>Windows (and some Linux) Ethernet Adapter</p>                                                                                                                                                                                                                                                                           |
| `AUTO_ETHERNET`  | <p>Automatic Ethernet. This attack mode will first attempt to bring up ECM\_ETHERNET. If after the default timeout of 20 seconds no connection is established, RNDIS\_ETHERNET will be attempted. The timeout may be changed by adding ETHERNET\_TIMEOUT\_XX where XX is the number of seconds, e.g. ETHERNET\_TIMEOUT\_60 for one minute.</p><p>Requires firmware version 1.5+</p> |
| `STORAGE`        | <p>UMS – USB Mass Storage<br>Flash Drive</p>                                                                                                                                                                                                                                                                                                                                        |
| `HID`            | <p>HID – Human Interface Device<br>Keyboard – Keystroke Injection via Ducky Script </p>                                                                                                                                                                                                                                                                                             |

Many combinations of attack modes are possible, however some are not. For example, `ATTACKMODE HID STORAGE ECM_ETHERNET` is valid while `ATTACKMODE RNDIS_ETHERNET ECM_ETHERNET STORAGE SERIAL` is not. Each attack mode combination registers using a different USB VID/PID (Vendor ID/Product ID) by default. VID and PID can be spoofed using the VID and PID commands.

| ATTACKMODE COMBINATION      | VID / PID     |
| --------------------------- | ------------- |
| SERIAL STORAGE              | 0xF000/0xFFF0 |
| HID                         | 0xF000/0xFF01 |
| STORAGE                     | 0xF000/0xFF10 |
| SERIAL                      | 0xF000/0xFF11 |
| RNDIS\_ETHERNET             | 0xF000/0xFF12 |
| ECM\_ETHERNET               | 0xF000/0xFF13 |
| HID SERIAL                  | 0xF000/0xFF14 |
| HID STORAGE                 | 0xF000/0xFF02 |
| HID RNDIS\_ETHERNET         | 0xF000/0xFF03 |
| HID ECM\_ETHERNET           | 0xF000/0xFF04 |
| HID STORAGE RNDIS\_ETHERNET | 0xF000/0xFF05 |
| HID STORAGE ECM\_ETHERNET   | 0xF000/0xFF06 |
| SERIAL RNDIS\_ETHERNET      | 0xF000/0xFF07 |
| SERIAL ECM\_ETHERNET        | 0xF000/0xFF08 |
| STORAGE RNDIS\_ETHERNET     | 0xF000/0xFF20 |
| STORAGE ECM\_ETHERNET       | 0xF000/0xFF21 |


---

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