USB Ripper-- Hack the Box write up--parse json in python
Tool:
- python
- json
- md5
Problem:
Material:
After we download the zip file, we have two files, one is auth.json and the other one is syslog which is dumped from the system. Both are quite large cannot handle manually.
Analysis:
Part of the syslog:
The auth.json contains several attributes, they are 'manufact', 'prod', 'serial'.
Part of auth.json
solution:
From the question, we can guess that the attacker don't have the permission and plug his USB in the machine. So we are going to find the log in syslog while not in auth.json
we choose the serial number to compare and store it in the sya_serial file:
here is my code:
Then we get one record:
Then we try to crack this with MD5
Then we get the flag!