image.png

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.

image.png

The HID Data portion of any interrupt captured contains data like keyboard presses and mouse movements.

Step 1:

tshark -r cap2.pcapng -T fields -e usbhid.data > output.txt

image.png

If you use tail to print the last 10 lines within output.txt, you’ll see that it contains all HID data.

tail output.txt

image.png

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

image.png

Summary: