Logger
Logger
Platform: HackTheBox | Category: Forensics | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Description
A client reported that a PC might have been infected, as it's running slow. We've collected all the evidence from the suspect workstation, and found a suspicious trace of USB traffic. Can you identify the compromised data?
Solution Approach
Core idea: Identify the weakness from source review or fingerprinting first. Iterate with incremental payloads instead of guessing.
Steps
-
First, unzip the
.zipfile given. -
Since it's a
.pcapfile, let's open it using wireshark. -
Notice there are many
URB_INTERRUPTpackets. -
These USB packets are keystrokes, there was some vuln that affect USB wireless devices. (keyboard).
-
Let's export all of it as the indicates keystrokes.
-
First we need to filter the USB Keyboard packets. I did a small outsource about the command to use, found out this one:
usb.transfer_type == 0x01 and frame.len == 35 and !(usb.capdata == 00:00:00:00:00:00:00:00)
-
Now select all the packets, then click file -> export specified packets.
-
Now to get the flag, i used this python script.
COMMAND - to get the .txt file which we will use for the script.
tshark -r ../../../../../Downloads/bin/foren/logger/exported.pcapng -Y 'usb.capdata && usb.data_len == 8' -T fields -e usb.capdata | sed 's/../:&/g2' > keystrokes.txt
- Following the capslock command, we shall get the flag!
Flag
REDACTED
Lessons Learned
- Identify the weakness from source review or fingerprinting first.
- Iterate with incremental payloads instead of guessing.
- Reuse the same pattern in future engagements.