Belkasoft Write-up: CTF 4
This will be my write-up for the 4th Belkasoft CTF! This CTF follows a plot based progression to make it fun, so I’ll also include the plot details unlike my other write-ups :)
Prompt
— Have you heard the news?
I have.
— The CID has interrogated the father. Other than the ransom amount, there was nothing interesting.
I heard this as well.
— This Mr. Alex is a big shot… Do you know who I got a call from, asking for my intervention?
I didn’t and I really didn’t want to know either.
— The old man says the kid was fond of computers and even slept, curled up with his laptop.
Well, now this has become more interesting. For the first time during our conversation, I looked at the Boss with curiosity.
— You sure have a lot to talk about today, don’t you boy. Well, I will shut my mouth for now, the guy’s laptop is waiting for you in the lab.
1. List all users of the laptop.
Examine /etc/passwd
file.
2. What web application was used by the boy to earn his pocket money?
— What the hell is with these young people… chickens do not peck at their dad’s money, but he is still doing it!
I raised my eyebrows in surprise.
— Chief, have you never been a teenager before?
— Okay, you’re right, — Chief grimaced. He obviously did not like to remember his youth.
I pushed away the spontaneous smirk from my face, and the Chief continued:
— So, was he doing that from his secondary account?
I always look at the .bash_history
files first for every user to get a rough idea of what happened.
To examine internet history, I ran Autopsy ingest modules.
3. Which BTC wallet did the boy use to sell drugs?
— So, the boy uses one account for studying, and the other for selling drugs?
— Yes, Sir.
— Any evidence?
— Of course, Chief. Look, here is his bitcoin wallet…
Visit the web app, it accepts payment via bitcoin at shown address.
4. On which date does the kid’s database show the most sales for “Acapulco Gold”?
— Chief, you know what? Looks like that’s not his only business. The boy is definitely dealing with larger sharks.
— You sure?
— Absolutely! I have just found that he reports his sales to someone else.
Looking at the emails parsed by Autopsy, we can see a conversation between the victim and his friend Tux, asking for his monthly sales probably to tally his drug supplies and profit made by the victim from his sales.
There are numerous ways to get this attachment:
- We can either use an online parser for
.eml
files. (Not optimal for real cases, your parsers and tools must be well known.) - Extract the
.eml
file and manually get the base64 encoded attachment data from theContent-Disposition
HTTP header. (Viable, requires extra reporting on the manual parsing done.) - Perform a file attribute search or a keyword search. (Suggested, you’re most likely already working on Autopsy or other tools.)
We can crack the password using john
as always.
5. What was the other BTC wallet of the victim, which he used to hide his “under the counter” sales from his superior?
— They called me again. Twice, — It looked like the Chief was angry at me because of that.
— Are you saying I work too slow? Or should I take these calls on your behalf?
The Chief missed my words, he seemed to be looking for his cigarettes.
— Look, Chief, I found something interesting. The boy was selling their goods under the counter.
The Chief stopped the search.
— You said what? And did his supervisor…
The Chief did not complete the sentence. We looked at each other knowingly.
This is where malice rises in the case, our victim decided to start selling the common “goods” between him and Tux, his friend, under the counter to profit from it.
In the same directory there are a lot of files with different extensions. However, they are intentionally mismatched we can verify this by looking at their file signatures.
For the remaining 2 files, one is only missing the first 4 bytes of the file signature %PDF
and other file is not only missing that but also the endianness is swapped for every 2 bytes. So, we will need to first convert the hex values, in 2 word lengths, from little endian to big endian and then add the 4 missing file signature bytes.
After all that, you will see that both result in the exact same file. Maybe the challenge author forgot to delete the other file or maybe it was to keep the CTF beginner friendly.
6. What is the password to the boy’s notes?
— Look, Chief. I found the kid’s notes but…
— Encrypted, — growled the Chief, without allowing me to finish.
I acted impressed.
— No wonder you are the Chief!
The Chief showed no sign that he heard me.
— And you cannot find the password.
— Yes sir. You seem like you have an idea?
My boss smiled slyly.
— Do you know what a container is?
7. What is the “secret pin” mentioned in the notes?
— That did the trick! But how did you know?
— Was it you who said “no wonder”?
Wow, he actually heard me that time.
— If you only knew sonny, how many cases just like this I’ve already had! Though I am no expert in this “digital forensics” stuff, but…
The Chief rolled his eyes but quickly came to his senses again.
— So why are you here again?
— Chief, I found the conversation the boy tried to hide. Looks like there is a pin to access it.
This time the Chief did not have anything for me.
— So what? Go and find it!
Now that we have the note password, we can access the contents.
8. When did the boy receive a threat?
— Chief, I am close to the solution. If I learn the time of the threat, everything else should be easy.
In the notes, the victim states that he got threatened 10 minutes ago, before he got to school and made this entry in notes.docx
Flag was asked in Epoch format so we need to convert it back after subtracting 10 minutes.
9. Who was the kidnapper?
The Chief glanced at me in surprise.
— I was pretty sure this time you would come with a full report.
— Sir, I know the name of the kidnapper, but I also need an email.
We already know the name of the kidnapper from the victim’s notes. To get the email address we can examine this file called mycon.zip
which is again password protected.