Git Product home page Git Product logo

ro9ueadmin / hidblock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eyedeekay/hidblock

0.0 1.0 0.0 67 KB

A shell script that generates rules and applies them to prevent new USB HID devices from registering themselves with your Linux machine. This is to prevent malicious USB attacks from hijacking you by impersonating input devices(BadUSB).

License: GNU General Public License v3.0

Shell 100.00%

hidblock's Introduction

hidblock

A shell script that generates rules and applies them to prevent new USB HID devices from registering themselves with your Linux machine. This is to prevent malicious USB attacks from hijacking you by impersonating input devices(BadUSB).

This script adds rules to your /etc/udev/rules.d/ folder that disable new USB HID's from attaching to your computer. New USB mice and keyboards will not work until you disable the rules. This should prevent USB devices from impersonating Human Interface Devices in order to prevent BadUSB attacks.

usage:

    ./hidblock < block || b > = Block all new USB Human Interface Devices  
    ./hidblock < unblock || u > = Unblock new USB Human Interface Devices  
    ./hidblock < install || i > = Install(or reinstall over) the rules file    

file location:

    /etc/udev/rules.d/10-usbblock.rules rule contents(10-usbblock.rules):  
    #ACTION=="add", ATTR{bInterfaceClass}=="03" RUN+="/bin/sh -c 'echo 0 >/sys$DEVPATH/../authorized'"    

This script uses the top answer from this StackExchange question as a guide. Thank you User10008.

Running ./install.sh will create a folder at ~/.bin and link hidblock in, then add ~/.bin to your path. ./uninstall.sh will delete it, but it will not delete ~/.bin or remove it from your path. In order to do that, you'll have to remove

    if [ -d "$HOME/.bin" ] ; then
        export PATH="$HOME/.bin:$PATH"
    fi

from your .profile file.

hidblock's People

Watchers

 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.