Skip to content

Instantly share code, notes, and snippets.

@methanoliver
Created October 18, 2022 06:16
Show Gist options
  • Save methanoliver/efebfe8f4008e167417d4ab96e5e3cac to your computer and use it in GitHub Desktop.
Save methanoliver/efebfe8f4008e167417d4ab96e5e3cac to your computer and use it in GitHub Desktop.
DuckyScript commands supported by Flipper's BadUSB

DuckyScript commands supported by Flipper's BadUSB

Explanations are only given for commands not present in the original DuckyScript, for everything else refer to DuckyScript documentation.

Keys

These mean exactly what one would expect and should need no further explanation.

  • Modifiers: CTRL, CONTROL, SHIFT, ALT, GUI, WINDOWS
  • Combos: CTRL-ALT, CTRL-SHIFT, ALT-SHIFT, ALT-GUI, GUI-SHIFT
  • Cursor: DOWNARROW, DOWN, LEFTARROW, LEFT, RIGHTARROW, RIGHT, UPARROW, UP
  • Control and navigation: ENTER, BREAK, PAUSE, CAPSLOCK, DELETE, BACKSPACE, END, ESC, ESCAPE, HOME, INSERT, NUMLOCK, PAGEUP, PAGEDOWN, PRINTSCREEN, SCROLLOCK, SPACE, TAB, MENU, APP, SYSRQ
  • Function: F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12

Input

  • STRING
  • ALTSTRING <string>, ALTCODE <string> -- Not present in DuckyScript, these are the equivalent of STRING, as if the string was typed in by holding Alt and entering the unicode code of every character, as described in Windows documentation. This is the way to get around the fact that there are no standard ways to switch input keyboard language and important in parts of the world where default keyboard has no Latin characters on it at all. This only works on Windows.
  • ALTCHAR <code> -- Altstring is internally a sequence of ALTCHAR invocations.

There is no support for STRINGLN.

Structural

  • REM
  • ID <vendor:id> - Equivalent to certain features of DuckyScript's ATTACKMODE. executed in preload phase, sets USB id of the keyboard device. For example, ID 04d9:1702 is an AJAZZ keyboard.
  • DELAY
  • DEFAULT_DELAY, DEFAULTDELAY
  • REPEAT
  • DUCKY_LANG - ignored, recognized as a command purely for compatibility with existing scripts.
@nullvoid413
Copy link

Thanks for this.

@Ellnutt
Copy link

Ellnutt commented Oct 3, 2023

Does flipper support 3 stroke combinations? ALT-LEFTSHIFT-PRINTSCREEN having a hard time getting this to run via a flipper cheers

@methanoliver
Copy link
Author

Does flipper support 3 stroke combinations? ALT-LEFTSHIFT-PRINTSCREEN having a hard time getting this to run via a flipper cheers

Writing it like you do will definitely not get recognized, see the source.

Try ALT-SHIFT PRINTSCREEN instead, see if this works.

Also, the only shift key that Flipper's BadUSB interpreter can press is the left one, same about alt.

@Ellnutt
Copy link

Ellnutt commented Oct 4, 2023

Excellent 👏 cheers for the speedy reply and that info 👍

@Lucibami
Copy link

so in order for my code to work on different keyboard layouts, I just have to replace STRING with ALTCHAR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment