website logo
HomeShopDocsBlogForum
⌘K
Flipper Zero Documentation
Basics
🐬First start
MicroSD card setup
Firmware update
Pet dolphin
Power
Reboot
Controls
Settings
Sub-GHz
Reading signals
Reading RAW signals
Adding new remotes
Supported Sub-GHz vendors
Frequencies
125 kHz RFID
Reading 125 kHz RFID cards
Adding 125 kHz cards manually
Writing data to T5577 cards
Animal microchips
NFC
Reading NFC cards
Recovering keys with MFKey32
Unlocking cards with passwords
Writing data to magic cards
Infrared
Reading infrared signals
Using universal remotes
GPIO & modules
iButton
Bad USB
U2F (Universal 2nd Factor)
Apps
HID controllers
Flipper Mobile App
Reporting Mobile App bugs
qFlipper
Troubleshooting drivers on Windows
Development
Hardware
Blueprints
Docs powered by
Archbee

Bad USB

Document image


Flipper Zero can act as a BadUSB device, recognized by computers as a Human Interface Device (HID), such as a keyboard. A BadUSB device can change system settings, open backdoors, retrieve data, initiate reverse shells, or do 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.



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 but provides additional commands and features, such as the ALT+Numpad input method, SysRq command, and more.

Both \n and \r\n line endings are supported. Empty lines are allowed, as well as spaces or tabs for line indentation. The Bad USB application can execute only scripts in the .txt format. No compilation is required.

Below you can find the commands Flipper Zero can execute in addition to the Rubber Ducky Scripting Language 1.0 syntax.

Modifier keys

Command

Notes

CTRL-ALT

CTRL+ALT

CTRL-SHIFT

CTRL+SHIFT

ALT-SHIFT

ALT+SHIFT

ALT-GUI

ALT+WIN

GUI-SHIFT

WIN+SHIFT



ALT+Numpad input

On Windows, you can input characters by pressing the ALT key and entering its code on the Numpad.

Command

Parameters

Notes

ALTCHAR

Character code

Print single character

ALTSTRING

Text string

Print text string using ALT+Numpad method

ALTCODE

Text string

Same as ALTSTRING, presented in some Ducky Script

implementations



Magic SysRq key

On Linux, you can execute commands using the Magic SysRq Key.

Command

Parameters

SYSRQ

Single character



Once the payload is created, upload it to your Flipper Zero via qFlipper or Flipper Mobile App to the SD Card/badusb/ folder.



Using your Flipper Zero as a BadUSB device

To use your Flipper Zero as a BadUSB device, do the following:

1

If the qFlipper application is running on your computer, close the application.

2

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

3

Select the payload and press the %ok%OK button.

4

Modify the keyboard layout by pressing the %left%LEFT button, if necessary. The default configuration is the US English keyboard layout.

5

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

6

Press Run to execute the payload on the computer.

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






Bad USB application source code



Updated 11 Sep 2023
Did this page help you?
PREVIOUS
iButton
NEXT
U2F (Universal 2nd Factor)
Docs powered by
Archbee
TABLE OF CONTENTS
Flipper Zero scripting language
Using your Flipper Zero as a BadUSB device
Docs powered by
Archbee

Community

Kickstarter Habr.com Discord Forum Blog

For developers

Documentation GitHub Design Guide

Distributors

Lab401 Joom How to buy Become a Partner

About

Contacts Jobs Compliance Company Abuse Report Privacy Policy

Copyright © 2023 Flipper Devices Inc.