---
title: Bad USB
slug: zero/bad-usb
description: Learn about how BadUSB devices work and how to turn your Flipper Zero into one
image: https://archbee-image-uploads.s3.amazonaws.com/3StCFqarJkJQZV-7N79yY/Z7KSHodItHk5UKKCgmWdP_badusb1.png
docTags: 
createdAt: 2022-10-18T10:11:52.000Z
---

![](https://api.archbee.com/api/optimize/3GUDYkC5JgUWgo6RW8piO-PUVMYpliqUJ_2-MPHnZtf-20241025-125639.png)

Flipper Zero can act as a [BadUSB device](https://web.archive.org/web/20220816200129/https://github.com/hak5darren/USB-Rubber-Ducky/wiki/), recognized by computers as a [Human Interface Device](https://en.wikipedia.org/wiki/Human_interface_device) (HID), such as a keyboard or even a mouse. A BadUSB device can change system settings, open backdoors, retrieve data, initiate reverse shells, or do basically anything that can be achieved with physical access. It is done by executing a set of commands written in the Rubber Ducky Scripting Language, also known as DuckyScript. This set of commands is also called a payload.

:::Iframe{iframeHeight="0" code="<div class=&#x22;warning flipper-callout&#x22;>&#xA;    <div class=&#x22;callout-header&#x22;>Insert a microSD card to use the Bad USB app</div>&#xA;    Before using the Bad USB app, make sure to update your Flipper Zero firmware with a microSD card inserted since Flipper Zero stores databases on a microSD card. For more information about the update process, visit the <a href=&#x22;https://docs.flipper.net/zero/basics/firmware-update&#x22; onclick=&#x22;next.router.push('https://docs.flipper.net/zero/basics/firmware-update')&#x22;><u>Firmware update</u> page.  &#xA;</div>"}

:::

On this page, you’ll learn about how BadUSB devices work and how to turn your Flipper Zero into one. Note that you can connect Flipper Zero to a computer not only via USB, but also via Bluetooth Low Energy (BLE).

***

# Flipper Zero scripting language

Before using your Flipper Zero as a BadUSB device, you need to write a payload in the `.txt` format in any common ASCII text editor using the scripting language. Flipper Zero can execute extended Rubber Ducky script syntax. The syntax is compatible with the classic [Rubber Ducky Scripting Language 1.0](https://web.archive.org/web/20220816200129/http://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript) but provides additional commands and features, such as the ALT+Numpad input method, SysRq command, and more.

:::Iframe{iframeHeight="0" code="<div class=&#x22;info flipper-callout&#x22;>&#xA;    <div class=&#x22;callout-header&#x22;></div>&#xA;    To learn more about the Flipper Zero scripting language, see <a href=&#x22;https://developer.flipper.net/flipperzero/doxygen/badusb_file_format.html&#x22; onclick=&#x22;next.router.push('https://developer.flipper.net/flipperzero/doxygen/badusb_file_format.html')&#x22;><u>this page</u>.&#xA;</div>"}

:::

***

# Uploading new payloads to Flipper Zero

Once the payload is created, you can upload it to your Flipper Zero via [qFlipper](https://docs.flipper.net/zero/qflipper) or [Flipper Mobile App](https://docs.flipper.net/zero/mobile-app) to the `SD Card/badusb/` folder. The new payloads will be available in the Bad USB application.

:::Iframe{code="<video&#xA;    autoplay muted loop playsinline style=&#x22;width: 90%; margin: auto !important;&#x22;&#xA;    src=&#x22;https://cdn.flipperzero.one/qflipper_file_manager.mp4&#x22;&#xA;></video>" iframeHeight="0"}

:::

:::Iframe{code="<div class=&#x22;info flipper-callout&#x22;>&#xA;    <div class=&#x22;callout-header&#x22;></div>&#xA;    When uploading, files with the same names will be overwritten without warning.&#xA;</div>" iframeHeight="500"}

:::

***

# Using your Flipper Zero as a BadUSB device

## Via USB connection

To turn your Flipper Zero into a BadUSB device using USB, do the following:

:::::WorkflowBlock
:::WorkflowBlockItem
If qFlipper is running on your computer, close it.
:::

:::WorkflowBlockItem
On your Flipper Zero, go to **Main Menu -> Bad USB.**
:::

:::WorkflowBlockItem
Select the payload.
:::

:::WorkflowBlockItem
Make sure the Bad USB app is in **USB mode** — you should see a USB logo (as shown below).

To switch to USB mode, press %right%**USB**.

![](https://api.archbee.com/api/optimize/3GUDYkC5JgUWgo6RW8piO-omz_V33ZLFGQ2rbXBT8Ox-20250123-160117.jpg "The Bad USB app in USB mode")
:::

:::WorkflowBlockItem
If needed, you can modify the keyboard layout (US English is default) by pressing %left%**Layout** and selecting from the list of layouts.
:::

:::WorkflowBlockItem
Connect your Flipper Zero to the computer via a USB cable.
:::

::::WorkflowBlockItem
Press %ok%**Run** to execute the payload on the computer.

:::Iframe{code="<video&#xA;    autoplay muted loop playsinline style=&#x22;width: 100%; margin: auto !important;&#x22;&#xA;    src=&#x22;https://cdn.flipperzero.one/bad_usb_compressed.mp4&#x22;&#xA;></video>&#xA;<div class=&#x22;text-center mt-2.5 text-gray-400 pb-5&#x22;>&#xA;    Run your payloads with the help of Flipper Zero&#xA;</div>" iframeHeight="500"}

:::
::::
:::::

## Via BLE сonnection

To turn your Flipper Zero into a BadUSB device using Bluetooth Low Energy, do the following:

::::WorkflowBlock
:::WorkflowBlockItem
Activate Bluetooth on your Flipper Zero by going to **Main Menu -> Settings -> Bluetooth**.
:::

:::WorkflowBlockItem
If qFlipper is running on your computer, close it.
:::

:::WorkflowBlockItem
On your Flipper Zero, go to **Main Menu -> Bad USB.**
:::

:::WorkflowBlockItem
Select the payload.
:::

:::WorkflowBlockItem
Make sure the Bad USB app is i&#x6E;**&#x20;BLE mode** — you should see a Bluetooth logo (as shown below).

To switch to BLE mode, press %right%**BLE**.

![](https://api.archbee.com/api/optimize/3GUDYkC5JgUWgo6RW8piO-PaLRtyIS_G30RTcFVA71N-20250123-161302.jpg "The Bad USB app in BLE mode")
:::

:::WorkflowBlockItem
If needed, you can modify the keyboard layout (US English is the default) by pressing %left%**Config** and selecting from the list of layouts.
:::

:::WorkflowBlockItem
On your computer, go to Bluetooth settings and connect to the detected wireless BadUSB device.
:::

:::WorkflowBlockItem
Confirm the connection on both your computer and Flipper Zero (by selecting **OK** on both devices).
:::

:::WorkflowBlockItem
On your Flipper Zero, press **Run** to execute the payload on the computer.
:::

:::WorkflowBlockItem
To unpair your Flipper Zero, go to %left%**Config** and select **Remove Pairing**.
:::
::::



***

::::LinkArray{contentSource="CUSTOM"}
:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/3StCFqarJkJQZV-7N79yY/qK2fDzhhnl66oU16O74Iw_monosnap-miro-2022-10-25-19-31-25.png"}
[Bad USB application source code](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/main/bad_usb)
:::
::::

