A USB proxy for intercepting and modifying USB traffic between devices and hosts, enabling security testing and device emulation.
usb-proxy is a software tool that acts as a man-in-the-middle (MITM) proxy for USB communications. It intercepts USB packets between a physical USB device and a host computer using raw-gadget and libusb, enabling real-time inspection, modification, and injection of USB traffic. This solves the problem of analyzing and manipulating USB protocols without requiring custom hardware.
Security researchers, developers, and testers who need to analyze USB protocols, fuzz USB devices, or emulate USB hardware for debugging purposes. It is particularly suited for those working on embedded systems or hardware security testing.
Developers choose usb-proxy because it provides a transparent, programmable layer for USB communication with multiple modification approaches—from simple pattern replacement to declarative byte operations and full Lua scripting—offering flexibility for both simple and complex USB analysis tasks without specialized hardware.
A USB proxy based on raw-gadget and libusb
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers three methods: pattern replacement, declarative byte operations, and Lua scripting, allowing both simple swaps and complex logic, as detailed in the injection.json examples.
Supports USB OTG ports like Raspberry Pi 4 or the dummy_hcd kernel module for virtual setups, providing adaptability in various environments, as explained in the prerequisite steps.
Captures and modifies USB control, interrupt, bulk, and isochronous transfers on-the-fly, enabling immediate inspection and manipulation for debugging or security testing.
Uses JSON configuration files with options for modify, ignore, and stall rules, offering precise control over specific USB packets, demonstrated in the detailed injection templates.
Can automatically remap device endpoints to match UDC capabilities and adjust descriptors, handling compatibility issues when using the --auto_remap_endpoints flag.
Requires compiling raw-gadget and potentially dummy_hcd kernel modules, checking device/driver names, and installing dependencies, which is time-consuming and non-trivial for beginners.
Lua scripting adds per-packet overhead, mutex acquires, and garbage collector latency, making it unsuitable for high-bandwidth isochronous streams, as admitted in the performance note.
Currently only works on Linux with specific kernel modules, lacking native support for Windows or macOS, restricting its usability in cross-platform projects.
Requires understanding USB endpoint addresses, hex values, and protocol details to write effective injection rules, which can be a barrier for those without low-level USB experience.
Network-wide ads & trackers blocking DNS server