1. Add a column name HID Data and value usbhid.data in wireshark. Now we need to extract this column values using tshark.
2. Use this command in order to extract.
tshark -r key_mission.pcap -Y 'usbhid.data' -T field -e usbhid.data > hid_data
or
tshark -r key_mission.pcap -T fields -e usb.capdata | tr -d : > hid_data (This is the default command and if you use this command then you dont need to add extra column like the first command)
3. Now we need a script to convert this binaries to meaningful ASCII.
4. https://blog.stayontarget.org/2019/03/decoding-mixed-case-usb-keystrokes-from.html
https://gist.github.com/ImAnEnabler/091a9e1ee2d6a0805408e009e2f4a2b5#file-decodeusbkeypress-py
5. Download the script from the above link and run using following command.
python decodeusbkeypress.py hid_data
Here hid_data is the file name.
6. Now after decode you will get some message that contains the flag. You may need to little bit clean that file. for example, find all the keyword called 'space' and replace with actual keyboard space.
Comments
Post a Comment