
In this write-up, we’ll look at USB HID data more closely.
Open the file cap2.pcapng in Wireshark and find packet number 31.
- HID (Human Interface Device) data is a structured data format used to communicate input from devices like keyboards, mice, and game controllers to a computer, typically following the USB HID protocol to represent actions such as key presses, movements, and clicks.

The HID Data portion of any interrupt captured contains data like keyboard presses and mouse movements.
Step 1:
- Extract the HID data from the file to a text file called
output.txt
- We’ll use
tshark to do this:
tshark -r cap2.pcapng -T fields -e usbhid.data > output.txt

If you use tail to print the last 10 lines within output.txt, you’ll see that it contains all HID data.
- HID data is transferred from USB devices to the host computer 8-bytes at a time.
tail output.txt

Keyboard presses, when they exist, will be captured at byte positions 4 and 5.

Summary:
- We have extracted all the HID data using
tshark
- We have a file called
output.txt that contains all the 8-byte values transferred between the host and the USB device.