Script Examples
General Approach
Section titled “General Approach”- 🤔 Think of the task you want the BadUSB to do
- ✍️ Try to do the task manually only with a keyboard and keep track of each step
- 💻 Convert the steps into BadUSB script
- 🧪 Test your script and add delays where necessary until it runs smoothly
Hello World Example
Section titled “Hello World Example”REM This is a simple Hello World Example ScriptDEFAULTDELAY 200GUI rSTRING notepadENTERSTRING Hello World
Open Fake Windows Updater
Section titled “Open Fake Windows Updater”DEFAULTDELAY 200GUI rSTRING https://fakeupdate.net/win10ue/ENTERF11
Run Terminal Command
Section titled “Run Terminal Command”DEFAULTDELAY 200GUI rSTRING cmdENTERSTRING treeENTER
MacOS and other Operating Systems
Section titled “MacOS and other Operating Systems”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.