Giter Club home page Giter Club logo

usb-sniffer's Introduction

Low-cost USB Sniffer (LS/FS/HS) with Wireshark interface

This sniffer can be used standalone from a command line or as a plugin for Wireshark with direct control from the UI.

Either way, the capture is saved in a standard PcapNG format.

Wireshark UI

Here are some example capture files:

Note: You will need a recent version of Wireshark (v4.x.x). Older versions may not be able to decode USB payload, but should still show the raw data.

Hardware

The sniffer is based around Cypress CY7C68013A MCU, Lattice LCMXO2 FPGA, and Microchip USB3343 USB PHY.

Prices and availability of ICs vary, but the total BOM should be less than $50.

LCMXO2-2000HC speed grades 5 and 6 were tested and the provided JED file was built for the speed grade 5, so it should work for both. Speed grade 4 should work too, but they are the least available and the price difference is negligible.

Caution: Do not buy CY7C68013A from eBay or AliExpress, they all are either fake or sketchy in some way. This IC can be quite expensive from regular suppliers, but LCSC is a legitimate supplier and they often have it at much cheaper prices.

PCBs can be ordered from OSH Park or any other PCB manufacturer, gerber files are provided.

There are also STL files for the case.

Bare PCB 3D Printed Case

Hardware bring up

This hardware does not require external programmers, both MCU and FPGA are programmed using a USB interface.

When a board with a blank EEPROM is connected, it would enumerate as an unconfigured FX2LP device.

The first step is to load the firmware into the MCU SRAM:

./usb_sniffer --mcu-sram usb_sniffer.bin

The device would reset and enumerate as a USB Sniffer with a dummy serial number. After that, program the EEPROM:

./usb_sniffer --mcu-eeprom usb_sniffer.bin

After resetting or power cycling, the device would enumerate as a USB Sniffer with a real serial number. The serial number is derived from the FPGA unique identifier, so if this step succeeds, it means that FPGA is also functional.

After that program the FPGA flash:

./usb_sniffer --fpga-flash usb_sniffer_impl.jed

MCU EEPROM can be reprogrammed at any time as long as it is running valid firmware.

In case the firmware gets corrupted, it is possible to run the MCU in the unconfigured mode by shorting BOOT and VCC test points (located near the EEPROM IC on the board) and resetting the device. You would need to repeat both steps for programming the MCU firmware to recover it to the working state.

The functionality and performance of the MCU and FPGA connection can be tested using the following command:

./usb_sniffer --test

You should be getting 40-50 MB/s. If the speed is significantly slower, connect the sniffer directly into the root USB port without intermediate hubs.

It is a good idea to run this test after each work session.

Installation

Pre-built binaries are provided for Linux and Windows.

To use with Wireshark, copy the file into the extcap plugin directory: ~/.config/wireshark/extcap on Linux, and C:/Users/<user>/AppData/Roaming/Wireshark/extcap/ on Windows.

For Linux, make sure that the binary file has an executable attribute set.

After that, refresh the list of interfaced in Wireshark and you should see "USB Sniffer" as one of the interfaces. Configure capture settings and start/stop the capture as with any other interface.

usb-sniffer's People

Contributors

ataradov avatar

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.