# __**ISITDTU CTF 2024 [Forensics]**__
## _swatted_
> San Andreas PD recently conducted a raid on a suspect's residence, discovering that their laptop contains crucial evidence. As a Digital Forensics Investigator, it is now your responsibility to analyze the evidence and answer the related questions.
Bài cho file .vmdk của 1 máy ubuntu, dưới đây là toàn bộ câu hỏi và câu trả lời của bài
```
[1]. What is the credential used to login to the machine?
Format: username:password
==> imsadboi:qwerty
CORRECT!
[2]. The criminal used a messaging app to communicate with his partner. What is the name of the app?
Format: AppName
==> Wire
CORRECT!
[3]. What is the username of the criminal (The app username)?
Format: username
==> anonymous69420
CORRECT!
[4]. What is his partner's username?
Format: username
==> clowncz123
CORRECT!
[5]. His partner sent him a file. What is the URL used to download the file?
Format: URL
==> https://file.io/lIPzLAvhF5n4
CORRECT!
[6]. What is the timestamp of the file sent by his partner (UTC)?
Format: YYYY-MM-DD HH:MM:SS
==> 2024-10-24 09:59:12
CORRECT!
[7]. What is the timestamp when the criminal downloaded the file (UTC)?
Format: YYYY-MM-DD HH:MM:SS
==> 2024-10-24 10:01:12
CORRECT!
[8]. His partner accidentally leaked his email. What is the email address?
Format: email@domain.com
==> theclownz723@gmail.com
CORRECT!
[9]. Luckily, we caught the criminal before he could send the sensitive information. How many credentials did he manage to steal?
Format: XX. Example 1: 01. Example 2: 42.
==> 23
CORRECT!
[10]. What is the email address and the password of user 'blistery'?
Format: email:password
==> blistery@yahoo.com:HDTSy0C7ZBCj
CORRECT!
Congrats! Here is your flag: ISITDTU{https://www.youtube.com/watch?v=H3d26v9TciI}
```
### [1]. What is the credential used to login to the machine?
Nhìn qua trong máy có user `imsadboi`, vào trong `/etc` có file `shadow` chứa hash password user, dùng johntheripper để crack pass ta có được đáp án
### [2]. The criminal used a messaging app to communicate with his partner. What is the name of the app?
Trong `/home/imsadboi/.config` có 1 directory là `Wire`, 1 phần mềm nhắn tin mã hóa, và đây là đáp án
### [3]. What is the username of the criminal (The app username)?
Dùng `ChromeCacheView` để đọc cache trong `/home/imsadboi/.config/Wire/Cache/Cache_Data`, có 1 file 100.json có chứa thông tin của user

### [4]. What is his partner's username?
Mình có tham khảo [bài viết này](https://velog.io/@hunjison/Forensic-Analysis-of-Wire-Messenger-in-Windows-OS#2-data-reading-from-indexeddb) để parse được nội dung chat trong `/home/imsadboi/.config/Wire/IndexedDB/https_app.wire.com_0.indexeddb.leveldb` ra đọc và có được thông tin của partner

### [5]. His partner sent him a file. What is the URL used to download the file?
Ngay trong nội dung đoạn chat có chứa link download file trên

### [6]. What is the timestamp of the file sent by his partner (UTC)?
Nội dung được parse ra bao gồm cả timestamp của tin nhắn như ảnh trên
### [7]. What is the timestamp when the criminal downloaded the file (UTC)?
Tên tội phạm đã dùng browser Firefox trên máy, ta dễ dàng lấy được thông tin file đã download vào `2024-10-24 10:01:12`
### [8]. His partner accidentally leaked his email. What is the email address?
Ta trong lịch sử bash thấy tội phạm có dùng docker, lấy docker và check lịch sử git ta có email của partner

### [9]. Luckily, we caught the criminal before he could send the sensitive information. How many credentials did he manage to steal?
Trong lịch sử bash cho thấy criminal đã sử dụng gpg để encrypt file `credential.txt`, chỉ còn lại `credential.txt.gpg`
Tuy nhiên thì trong lịch sử bash cũng chứa luôn cả đoạn criminal gen password dể dùng. Ta setup lại kdb(libelektra) giống như trong máy của criminal và gen lại passphrase để giải mã cho file trên, có đáp án cho Q9 và Q10

### [10]. What is the email address and the password of user 'blistery'?
Nội dung đã được decrypt từ Q9
P/s: Nội dung file credential trên còn bị lưu lại trong file vmdk và có thể bị strings grep ra được luôn (≧▽≦)

## _Corrupted Hard Drive_
Bài cho 1 file .vhd, dưới đây là toàn bộ câu hỏi và câu trả lời cho bài
```
[1]. What is the starting address of the LBA address? Format (0xXXXXX)
0x10000
[+] Correct!
[2]. What is the tampered OEM ID? Format (0xXXXXXXXXXXXXXXXX)
0x4E54460020202020
[+] Correct!
[3]. After Fixing the disk, my friend downloaded a file from Google, what is the exact time when he clicked to download that file? Eg: 2024-01-01 01:01:01
2024-10-22 21:51:13
[+] Correct!
[4]. How much time did that file take to for download (in seconds)?? Format (XXX)
126
[+] Correct!
[5]. The first directory he moved this file to?
best
[+] Correct!
[6]. Last directory the suspicious move the file to?
MustRead
[+] Correct!
[7]. The time he of the deletion?? Eg: 2024-01-01 01:01:01
2024-10-22 22:20:28
[+] Correct!
[+] Congrats! You have successfully completed the test.
Here's your reward: ISITDTU{https://www.youtube.com/watch?v=yqp61_Wqm-A}
```
### [1]. What is the starting address of the LBA address? Format (0xXXXXX)
Starting LBA bắt đầu từ NTFS Boot Sector với các bytes `EB 52 90 4E 54 46 53 20 20 20 20` (tuy nhiên trong bài file vhd được cho mất 1 byte `53` là chữ `S`)

### [2]. What is the tampered OEM ID? Format (0xXXXXXXXXXXXXXXXX)
Như đã nói ở Q1 và có thể thấy ở hình trên, các bytes bị "tampered" là `EB 52 90 4E 54 46 00 20 20 20 20`
### [3]. After Fixing the disk, my friend downloaded a file from Google, what is the exact time when he clicked to download that file? Eg: 2024-01-01 01:01:01
Trong metadata của file được download ta tìm được thời gian file được tạo trên máy, trong link download cũng có timestamp giống vậy

### [4]. How much time did that file take to for download (in seconds)?? Format (XXX)
Mình không tìm được thông tin liên quan tới thời gian file tải mất bao lâu nên brute luôn :V
### [5]. The first directory he moved this file to?
Mình không tìm thấy thông tin liên quan nên thử tên từng folder luôn :V
### [6]. Last directory the suspicious move the file to?
Trong thùng rác có folder MustRead và trong folder này có file trên nên mình nghĩ đây là chỗ cuối cùng mà "the suspicious move the file to"?

### [7]. The time he of the deletion?? Eg: 2024-01-01 01:01:01
Mình không hiểu tác giả muốn hỏi time xóa file nào nên thử bừa 1 file bị xóa, file này khác với file của câu hỏi trên (như hình trên)