Giter VIP home page Giter VIP logo

pwnduino's Introduction

pwnduino

Hacking with the Arduino Uno!

Introduction

Many projects have existed out there (check out @samyk !) that turn Arduino HID keyboard devices into USB rubber ducky-likes. However, these devices are already themselves HID devices, and just require a bit of code in the form of Arduino .ino scripts to run. At times, many people are not able to obtain Teensy devices, or just simply want to work their existing hardware. We were able to built a framework that turns Arduino Unos into malicious HID devices, dubbed pwnduino, and effectively hack and gain escalated privilege and persistence on an open computer.

How it Works

An Arduino Uno (version rev. 3) has an atmega16u2 chip on its board. We can flash this chip using a program called dfu-programmer, available on Linux distributions

sudo apt-get install dfu-programmer

or, build from source here.

We get two .hex files, one for a USB serial device, and one for an HID keyboard device. pwnduino automates that process, first flashing the Arduino Uno into a serial device. However this still does require a bit of user input, as you will be required to do what is known as placing the Arduino into DFU Mode. In order to do this, you can take a jumper wire, and short the GND pin and the top left ICSP pin.

After doing so, the Arduino's onboard LED will light up for a few short moments. Your Arduino will be ready to be flashed. pwnduino will do this automatically.

Afterwards, you can still upload scripts to the Arduino. Once the Arduino is flashed into a HID device, it will automatically execute that code. Several scripts have been included, however, you can still write your own.

After uploading a script, pwnduino will flash your Arduino into a keyboard HID device. Plug it into a vulnerable, and open computer, and watch the magic (not really) happen.

Downloading and Installation

First, several requirements are needed. Install with your respective OS's package manager, or build from source.

sudo apt install arduino arduino-core arduino-mk dfu-programmer python-pip
sudo pip install signal pyserial arduino-sketch

Get the repo:

git clone https://github.com/ex0dus-0x/pwnduino
cd /path/to/pwnduino
python pwnduino.py

Usage

This is the output of --help

usage: pwnduino.py [-h] [--flash] [--unflash] [--detect]

Hacking with the Arduino Uno

optional arguments:
-h, --help      show this help message and exit
--flash, -f     Flash your Arduino Uno into a malicious HID Device
--unflash, -uf  Revert your Arduino Uno into a regular serial device
--detect, -d    Attempts to detect your regular Arduino serial device

Now here's how to use it.

To detect if an Arduino is plugged in, use --detect. Keep in mind this only works for USb serial devices that aren't detected as a keyboard. To check for hardware changes, use dmesg.

python pwnduino.py --detect

Before you flash to a HID, upload a script. Scripts are currently in the scripts/ folder, and a work-in-progress --upload flag is being implemented.

To flash, use --flash. Keep in mind that you should short the GND and ICSP pins, as demonstrated above.

python pwnduino.py --flash

To unflash, use --unflash. Once again, short the pins. You will now have a regular serial USB device again.

TODO

This project still presets to us A LOT of potential issues, and we wish to improve upon them. Hacking with the Arduino Uno has already been seen previously after the introduction of the Teensy and the Rubber Ducky. The Arduino Uno is not the only model of the Arduino family that can be potentially hacked and turned into a malicious HID, but also other models, such as the Mega. These challenges present to us countless possibilities and even potential hardware modifications that enable us to enhance the overall effective of the program.

pwnduino's People

Contributors

dr-d12345 avatar zp4 avatar

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.