Skip to content

Script Examples

  1. 🤔 Think of the task you want the BadUSB to do
  2. ✍️ Try to do the task manually only with a keyboard and keep track of each step
  3. 💻 Convert the steps into BadUSB script
  4. 🧪 Test your script and add delays where necessary until it runs smoothly
REM This is a simple Hello World Example Script
DEFAULTDELAY 200
GUI r
STRING notepad
ENTER
STRING Hello World
DEFAULTDELAY 200
GUI r
STRING https://fakeupdate.net/win10ue/
ENTER
F11
DEFAULTDELAY 200
GUI r
STRING cmd
ENTER
STRING tree
ENTER

The example scripts above are made for Windows. Macs or Linux computers might require slightly different key combinations, use other commands, and have a different terminal. For example, on macOS, instead of GUI r, you use GUI SPACE. That’s why the more you know about the target computer and how to use it, the more you can do with a BadUSB.

This topic is a great excuse to learn more about the Windows command line (cmd), or shell scripting.