CP-HIDScripter (CircuitPython-HIDScripter) is a web tool that generates circuitpython HID scripts using Mnemonics.
It basically converts the mnemonics with values into circuitpython scripts so that it directly store on flash memory to perform keystroke injection.
- Simple and clean GUI.
- Two large windows one for mnemonics and other for circuitpython script.
- Convert Button : Convert mnemonics into circuit python scripts.
- Copy Button : Copy circuitpython script to the clipboard so that it can paste anywhere.
- Reset Button : Clear all text from both windows.
- Save Button : Save circuitpython scripts on the system for future use.
- From Button : Upload
.txtfiles which contain mnemonics to load on mnemonics window.
CP-HIDScripter.Demo.Video.mp4
- Those boards which support
CircuitPythonand it supportsusb_hidmodule.
Tip
Use those boards which have atleast 2MB flash memory.
Caution
- Some boards does not have built-in UF2 bootloader.
- It need to flash UF2 bootloader to allows you to flash your firmware by just dragging and dropping
.uf2file onto the flash drive without using an external programmer. - Check CircuitPython page of that board.
- At the end of the page, if it contain link for bootloader
.binfile, that means it does not have built-in UF2 bootloader.
1Your Board1Micro-B USB / Type-C USB Cable with data transfer support
- Open Official CircuitPython download link from here.
- Search your board you have.
- Select your board and click on it.
- Download latest stable release CircuitPython
.uf2file and noted its version.- It is like
X.Y.Z. - Latest stable release is
9.2.9but it can be changed in future so keep eye on it.
- It is like
- Connect your board with Micro-B USB / Type-C USB Cable and then connect it to the PC/Laptop.
- It is shown as Mass Storage Device with some name.
- Copy the
.uf2file into the board mass storage device.- When it is copied, then it disconnects automatically and reconnect as
CIRCUITPY.
- When it is copied, then it disconnects automatically and reconnect as
- Done! CircuitPython is successfully flashed in the your board.
- Make sure that your board is connected to your PC/Laptop.
- Download latest Adafruit CircuitPython Bundle from here.
- There are
2variants of libraries :BundlesandThe Community Bundle. - In Bundles variant, download latest stable Adafruit CircuitPython Bundle as noted version of
.uf2file. - Latest stable release is
adafruit-circuitpython-bundle-9.x-mpy-20250829.zipbut it can be changed in future so keep eye on it.
- There are
- Extarct the ZIP file.
- Go to the
libfolder in the extracted ZIP file. - Copy
adafruit_hidfolders in thelibfolder ofCIRCUITPY. - Done! Now, your board is ready to use as a DIY USB Rubber Ducky.
| Mnemonic | Description | Example |
|---|---|---|
| CMT | It used to add comments in the code. | CMT This is a test script |
| TIME | It adds the time library in the code. | TIME |
| HID | It adds the usb_hid library in the code. | HID |
| HWD | It adds the board and digitalio libraries in the code. | HWD |
| KEYBOARD | It adds the Keycode, Keyboard and KeyboardLayoutUS libraries and also create objects for keycode and keyboard layout in the code. | KEYBOARD |
| MOUSE | It adds the Mouse library and also create objects for mouse in the code. | MOUSE |
| PIN | It add pin declaration in the code. | PIN |
| LED | It turns on/off the led in the code. Values are ON and OFF. |
LED ON |
| WAIT | It add time in the code. Time is in milliseconds. 1000 ms = 1 second. |
WAIT 1000 |
| TYPE | It add text want to type in the code. | TYPE Hello World! |
| MOVE | It moves the mouse pointer according to the values. Values are x-axis, y-axis and scroll. Values may be positive, negative or ZERO. Values in sequence - x-axis -> y-axis -> scroll. |
MOVE 36 -78 0 |
| CLICK | It clicks the mouse buttons. Values are LEFT, MIDDLE and RIGHT. |
CLICK LEFT |
| PRESS | It press the mouse buttons and releases immediately. Values are LEFT, MIDDLE and RIGHT. |
PRESS RIGHT |
| LOOP | It run commands for a certain number of times. | LOOP 3 TYPE Hello World! EXIT |
| INF | It run commands infinitely. | INF TYPE Hello World! EXIT |
| EXIT | It used to close both LOOP and INF blocks. | EXIT |
~
- is used to add
\nat the end of the text. - It is used when TYPE mnemonic in working.
TYPE Hello~gives the outputlayout.write("Hello\n").
A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z
F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
LEFT UP RIGHT DOWN TAB HOME END PGUP PGDN
CAPS NUM SCROLL
GUI ESC PRTSCR PAUSE
INSERT DEL BKSP ENTER
CTRL SHIFT ALT
- Make sure that your board is connected to your PC/Laptop and it has essential files.
- Open CP-HIDScripter from here.
- Type mnemonics in mnemonics window.
- Click on
Convertbutton.- The corresponding CircuitPython script is generated.
- Click on
Savebutton.- It generates a file named
code.py. - It is default file in
CIRCUITPYso that when powered the board, this file is running. - It ask for replacement of
code.pyfile, then replace it. - It will overwrite in the
code.pyfile.
- It generates a file named
- Done! As
code.pysaved in it, the script executes automatically.
Tip
Start your code with WAIT so that board get time to initiate.
Time must be atleast 1000.
- Just copy the example and paste in mnemonics window and click on
Convertbutton.
CMT Blink LED Exploit
TIME
HWD
PIN
INF
LED ON
WAIT 1000
LED OFF
WAIT 1000
EXIT
CMT Type on notepad Exploit
TIME
HID
KEYBOARD
WAIT 1000
GUI R
WAIT 1000
TYPE notepad
WAIT 1000
ENTER
WAIT 1000
TYPE This is a test script developed by CP-HIDScripter!
CMT Open CMD as Administrator Exploit
TIME
HID
KEYBOARD
WAIT 1000
GUI R
WAIT 1000
TYPE cmd
WAIT 1000
CTRL SHIFT ENTER
WAIT 1200
ALT Y
CMT Folder Creation Exploit
TIME
HID
KEYBOARD
CTRL SHIFT N
WAIT 1100
TYPE Test
WAIT 1200
ENTER
CMT Type on notepad 5 times Exploit
TIME
HID
KEYBOARD
WAIT 1000
GUI R
WAIT 1000
TYPE notepad
WAIT 1000
ENTER
WAIT 1000
LOOP 5
TYPE This is a test script developed by CP-HIDScripter!~
EXIT
CMT Mouse Jiggler Exploit
TIME
HID
MOUSE
INF
MOVE 2 0 0
WAIT 500
MOVE -2 0 0
WAIT 500
EXIT