{"id":27781205,"url":"https://github.com/slendidev/picoduck","last_synced_at":"2025-04-30T12:41:38.228Z","repository":{"id":63738093,"uuid":"570326697","full_name":"slendidev/picoduck","owner":"slendidev","description":"A cheap \"bad\" USB using a Raspberry Pi Pico running on Lua.","archived":false,"fork":false,"pushed_at":"2022-12-09T13:18:29.000Z","size":231,"stargazers_count":31,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T20:12:04.439Z","etag":null,"topics":["bad-usb","keyboard","keyboard-emulation","lua","lua-script","mouse","mouse-emulation","penetration-testing","penetration-testing-tools","pentest","raspberry-pi","raspberry-pi-pico","rp2040","rubber-ducky","rubberducky","trolling","usb-hid"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slendidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-24T22:52:08.000Z","updated_at":"2025-04-05T09:19:30.000Z","dependencies_parsed_at":"2023-01-26T07:16:36.894Z","dependency_job_id":null,"html_url":"https://github.com/slendidev/picoduck","commit_stats":null,"previous_names":["slendidev/picoduck","xslendix/picoduck"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slendidev%2Fpicoduck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slendidev%2Fpicoduck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slendidev%2Fpicoduck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slendidev%2Fpicoduck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slendidev","download_url":"https://codeload.github.com/slendidev/picoduck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251702010,"owners_count":21629933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bad-usb","keyboard","keyboard-emulation","lua","lua-script","mouse","mouse-emulation","penetration-testing","penetration-testing-tools","pentest","raspberry-pi","raspberry-pi-pico","rp2040","rubber-ducky","rubberducky","trolling","usb-hid"],"created_at":"2025-04-30T12:41:37.423Z","updated_at":"2025-04-30T12:41:38.222Z","avatar_url":"https://github.com/slendidev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePicoDuck\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n    A cheap \"bad\" USB using a Raspberry Pi Pico running on Lua.\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n## Features\n\n - Multiple program support: allows multiple programs to be stored.\n - Hold pin support: when the configured pinned is powered, the program will pause execution.\n - No need to recompile multiple times.\n\n## DISCLAIMER\n\nSince this acts as effectively a mouse and keyboard, it cannot be usually detected by systems. As such, I do not condone and I am not responsible for any illegal use of this software. Use it for pranks and other legal practical uses, such as setting up systems, BUT NEVER FOR CRIME. You have been warned.\n\n## Requirements\n\nNOTE: Those are only needed if you are going to build the code yourself!\n\n - [Arduino IDE](https://www.arduino.cc/en/software)\n - [Raspberry Pi Pico Arduino core](https://github.com/earlephilhower/arduino-pico)\n - [Adafruit SPIFlash](https://github.com/adafruit/Adafruit_SPIFlash) (get from Sketch-\u003eInclude Library-\u003eManage Libraries)\n\n## Installation\n\n[Youtube video](https://youtu.be/scNjgT32pO0)\n\nThere are 2 ways of installing the code onto your Raspberry Pi Pico:\n - Getting the latest version from the releases tab\n - Compiling everything yourself\n\n### Getting the latest version from the releases tab\n\nWARNING: The releases version contains the default (configuration)[config.h]! Make sure your wiring corresponds to it first!\n\n1. Head on over to the [releases](https://github.com/xslendix/picoduck/releases) page to get the latest version. You are looking for the UF2 image file.\n2. Insert yout Raspberry Pi Pico into your computer while holding the BOOTSEL button down.\n3. Copy the UF2 image to the newly found USB device.\n4. That's it! You can now use your Raspberry Pi Pico as a bad USB!\n\n### Compiling everything yourself\n\n1. Install the Arduino IDE. Both 1.8.x and 2.x should work just fine.\n2. Download the source code onto your computer.\n3. Open the Arduino IDE and go to File-\u003ePreferences and add the following URL to \"Additional Boards Manager URLs\": `https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`. Hit \"OK\".\n4. Go to Tools-\u003eBoards-\u003eBoard Manager, type \"pico\" and select \"Add\".\n5. Go to where you downloaded the project and open the .ino file. Go to Tools-\u003eBoard and select the \"Raspberry Pi Pico\", Tools-\u003eUSB Stack \"Adafruit TinyUSB\".\n6. Go to the \"config.h\" tab. Change stuff to your needs.\n7. Plug in your Raspberry Pi Pico in UF2 mode.\n8. Go to Tools-\u003ePort and select \"UF2 Board\".\n9. Press the upload button, you can also use Ctrl+U.\n10. That's it! You can now use your Raspberry Pi Pico as a bad USB!\n\n## Usage\n\nYou can switch between programs using binary. For example, to load the first program, use `0001`, to load the third one use `0011`, 0 meaning false and 1 meaning true.\n\nPrograms stored in the Pico must have the following file name format: `\u003cProgram ID\u003e.lua`.\n\nUse the HOLD pin to halt the current execution of the program while HIGH.\n\nSet the MSD pin HIGH when booting to put the PicoDuck into _Mass Storage Device mode_ which allows you to upload code to it.\n\n## Documentation\n\n### LED status codes\nIf the LED blinks at a rate of 1000 ms, then formatting the FAT12 partition failed. If it blinks at a rate of 500 ms, it means that PicoDuck couldn't find the program to run.\n\n### General\n```\nwait(Number milliseconds) -\u003e Wait for a x amount of time. Aliases: sleep, delay\n```\n\n### Keyboard\n```\ntype(String) -\u003e Type a string. Aliases: string\ntypeln(String) -\u003e Type a string and press key.enter.\nwrite(Key) -\u003e Write a key.\npress(Key) -\u003e Press a key.\nrelease(Key or nil) -\u003e Release a key, if nil, releases all keys.\ngui(Key) -\u003e Press a key while the GUI key is pressed. Aliases: win, meta\nalt(Key) -\u003e Press a key while the Alt key is pressed.\nctrl(Key) -\u003e Press a key while the Control key is pressed.\nsetSpeed(Number) -\u003e Set the speed at which keys are pressed. Keys per second.\n```\n\nThere is also a `keys` table which contains a bunch of useful keycodes such as: `keys.menu`, `keys.home`, `keys.f9` etc.\n\n### Mouse\n```\nmouseMove(x, y) -\u003e Move mouse x and y amount.\nmouseClick(MouseButton or nil) -\u003e Click a mouse button, if nil, left click is used.\nmousePress(MouseButton or nil) -\u003e Press a mouse button, if nil, left click is used.\nmouseRelease(MouseButton or nil) -\u003e Release a mouse button, if nil, only left click is released.\n```\n\n### I/O\n```\nsetLed(Boolean state) -\u003e Set the LED state.\nsetLedExternal(Boolean state) -\u003e Set the external LED state.\nblinkLed(Number rate or nil) -\u003e Blink the LED, if nil, the rate is 1000. This goes into an infinite loop.\npinMode(Integer pin, PinMode) -\u003e Set the pin mode (INPUT, OUTPUT, INPUT_PULLUP).\ndigitalWrite(Integer pin, Number) -\u003e Set the digital output value of a pin (HIGH, LOW).\ndigitalRead(Integer pin) -\u003e Read a pin's digital value.\nanalogWrite(Integer pin, Number) -\u003e Set the analog value for a pin.\nanalogRead(Integet pin) -\u003e Read a pin's analog value.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslendidev%2Fpicoduck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslendidev%2Fpicoduck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslendidev%2Fpicoduck/lists"}