WiFi Duck Scripting

StefanStefan
3 min read

Our popular wireless BadUSB tool WiFi Duck is programmable using a simple scripting language. Here we will have a look at all the available commands and functions.

WiFi Duck Header

Visit wifiduck.com to learn more about this project.

About

The scripting language used for the WiFi Duck is made to be compatible with Ducky Script from the awesome people at Hak5. This allows you to use any Ducky Scripts you can find on the interwebs.

For example, you can find some great payloads on Github. Duck Toolkit also has a library of common payloads.

Basics

The scripting language is straightforward, here are the basics:

  • Keys are separated by a single space.
  • Everything written in a single line gets pressed and released at the same time.
  • To write text, use the STRING function.
ExampleExplanation
WINDOWS
r
Type the Windows key and then the r key
WINDOWS rPress the Windows key and the r key simultaneously
STRING WINDOWS rWrite WINDOWS r

Functions

CommandExampleDescription
REMREM Hello World!Comment
DEFAULTDELAY or DEFAULT_DELAYDEFAULTDELAY 200Time in ms between every command
DELAYDELAY 1000Delay in ms
STRINGSTRING Hello World!Types the following string
REPEAT or REPLAYREPEAT 3Repeats the last command n times
LOCALELOCALE DESets the keyboard layout. Currently supported: DE, ES, GB, US, DK, RU, FR, BE, PT, IT
KEYCODEKEYCODE 0x02 0x04Types a specific key code (modifier, key1[, ..., key6]) in decimal or hexadecimal
LEDLED 40 20 10Changes the color of the LED in decimal RGB values (0-255)

Standard Keys

Key
a - z
A - Z
0 - 9
F1 - F12

Modifier Keys

Key
CTRL or CONTROL
SHIFT
ALT
WINDOWS or GUI

Other Keys

Key
ENTER
MENU or APP
DELETE
HOME
INSERT
PAGEUP
PAGEDOWN
UP or UPARROW
DOWN or DOWNARROW
LEFT or LEFTARROW
RIGHT or RIGHTARROW
TAB
END
ESC or ESCAPE
SPACE
PAUSE or BREAK
CAPSLOCK
NUMLOCK
PRINTSCREEN
SCROLLLOCK

Examples

REM Hello World for Windows PCs
DEFAULTDELAY 200
GUI r
STRING notepad
ENTER
STRING Hello World!

Hello World for Windows PCs

0
Subscribe to my newsletter

Read articles from Stefan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Stefan
Stefan

CS student building open-source tools for fun and profit. Mostly hacking around with Arduino.