Turn your Raspberry Pi Pico into an HID (keyboard) device capable of sending commands to a computer. This project uses CircuitPython and supports different keyboard layouts.
By default, the keyboard is configured in French (AZERTY), but you can easily modify it to use other languages.
- Connect your Raspberry Pi Pico while holding down the BOOTSEL button.
- The Pico will appear as a storage device on your computer. Download and install CircuitPython for the Raspberry Pi Pico from the following link:
- Drag and drop the
.uf2
file into the Pico's directory to install CircuitPython.
- Open your terminal and clone the GitHub repository with the following command:
git clone https://github.com/WAYNID/PICOBAD-USB.git
- Go to the project folder:
cd PICOBAD-USB
-
Replace the
lib
folder in your CIRCUITPY directory with the one from the PICOBAD-USB project. This folder contains all the libraries necessary for the proper functioning of the project. -
Also replace the
code.py
file in your CIRCUITPY directory with thecode.py
file from the project. This file is automatically executed when you plug in the Raspberry Pi Pico.
CAUTION: If you edit and save the code.py
file, it will be automatically executed by the Raspberry Pi Pico. Depending on the payload you have created, this could lead to irreversible effects on the target computer, such as file deletion or system setting modifications.
Be extremely careful when modifying this file. Make sure you fully understand the actions you are programming before executing them.
The code.py
file is automatically executed as soon as you connect the Raspberry Pi Pico. By default, it opens the command prompt and sends commands to the target computer.
- The script sends the keys
WIN + R
, typescmd
, and pressesENTER
to open the command prompt. - It then displays the following message in the command prompt:
Welcome to PICOBAD-USB! THIS IS THE BASE CODE.
Modify the code.py
file to add your own payloads. For example, to automatically open Notepad:
keyboard.send(badUSB.WINDOWS, badUSB.R)
time.sleep(1)
layout.write("notepad")
keyboard.send(badUSB.ENTER)
The default keyboard layout is French (AZERTY). If you want to use a different keyboard layout, here are the steps to follow:
- Visit GitHub - CircuitPython Keyboard Layouts.
- Download and install the layout of your choice.
- Modify the
code.py
file to use the new layout.
- Official CircuitPython Documentation
- Adafruit HID Library - GitHub
- CircuitPython Keyboard Layouts - GitHub
- To understand how HID devices work with CircuitPython, check out Adafruit_CircuitPython_HID.
- USE THIS FOR DISABLE MASS STORAGE - you need to make a
boot.py
file in the main, put this code in it.
import storage
storage.disable_usb_drive()
To reset your Raspberry Pi Pico, hold the BOOTSEL button before plugging it in and release the button when plugged in, this will put the Raspberry Pi into default
mode, in this mode use the flash_nuke.uf2
file in the github repository, this will reset the Pico, you just need to place it in the Pico Storage.
- WAYNID - Project creator.