Git Product home page Git Product logo

android-hid-script's Introduction

Android HID Script

Use at your own risk. For educational purposes only.

An Android app that provides a simple Lua interface for emulating an HID device, on top of the existing android-keyboard-gadget patch by pelya. Root access is required.

Requirements

This app will not work on every Android device. If your Android OS has Linux Kernel version >= 3.18 and is compiled with configfs and f_hid, then the app can try to create usb gadgets for mouse and keyboard.

If your Android OS is compiled with the android-keyboard-gadget kernel patch, then the app can use the usb gadgets it provides.

HID Emulation?

In computing, the USB human interface device class (USB HID class) is a part of the USB 
specification for computer peripherals: it specifies a device class (a type of computer 
hardware) for human interface devices such as keyboards, mice, game controllers and 
alphanumeric display devices.
                                                                      - Wikipedia

This app provides an easy way to script HID interactions intuitively, with feedback. In addition, it contains wrappers around the HID devices allowing developers to easily integrate HID functionality into their own apps.

On the news recently, use and abuse of the trust given to HID devices was demonstrated with the BadUSB attack, where USB devices were abused to utilize HID protocol to carry out nefarious actions.

Use Cases of Scripted HID Emulation

  • Automation of deployment solutions (ie. configuring computer BIOs settings in an automated fashion)
  • Mobile password managers that type in your credentials for you, on computers you do not trust
  • Use in computer espionage or social engineering attacks

Features

A couple of demo applications are implemented:

  • Fuzzing of HID protocol
  • PowerShell download and run executable
  • PowerShell download and run PowerShell script
  • Serial transfer of data through output reports
  • Change wallpaper (video demonstration)

New demo applications can be added to assets/scripts. The API is pretty much self-documenting, just look at the existing demos to get a feel for how the API works.

For people who want to implement HID functionality in their own apps, HID interfacing code available here (HID.java), and a simple ease-of-use wrapper is available here (HIDR.java). The documentation should be enough to understand how it works.

Third-party

  • Requires ChainFire's libsuperuser to keep a su shell open.
  • Requires LuaJ to provide Lua binding and interpret Lua scripts.

android-hid-script's People

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.