Skip to content
/ usblock Public

A python tool which uses the Linux kernel's USB authorization support to lockdown USB devices (interfaces). Aimed to protect against (some) USB related attack vectors like malicious HID attacks.

License

Notifications You must be signed in to change notification settings

cddmp/usblock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

usblock

A simple tool to protect against malicious USB devices.

Once the tool is started (as root), it will lock all USB devices (interfaces) by using the Linux kernel's USB authorization support. It will then monitor for any USB devices being plugged in. Once a USB device it detected, the tool will list all interfaces. The user then has 3 options for every interface:

  • Unlock the interface and probe the kernel to load the corresponding driver
  • Only unlock the interface but don't probe
  • Keep the interface locked

If the second option is chosen, the tool will print out the interface path in sysfs. Such a path could look like that:

3-2:1.0

The user can then manually probe the driver at any point in time via:

# echo 3-2:1.0 > /sys/bus/usb/drivers_probe 

This approach allows to unock only those interfaces, which the user considers trustworthy.

Dependencies

  • python3-pyudev
  • python3-pyusb

About

A python tool which uses the Linux kernel's USB authorization support to lockdown USB devices (interfaces). Aimed to protect against (some) USB related attack vectors like malicious HID attacks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages