Full Forensics challenges write-ups from Pico CTF 2023
Foreword
PicoCTF has been one of the greatest cyber security platform for newbie in my opinion. But this year, most of Forensics challenges were so guessy. Five of them were Stegano and one chall is not like Forensics at all. I am very disappointed 🥹.
hideme
Note
Every file gets a flag. The SOC analyst saw one image been sent back and forth between two people. They decided to investigate and found out that there was more than what meets the eye.
This chall is about embed file in a file. You can either use binwalk or some hex editors to extract the content of the file. The embed file is just a normal zip file, no password protected so you can unzip it easily.
Someone just sent you an email claiming to be Google’s co-founder Larry Page but you suspect a scam. Can you help us identify whose mail server the email actually originated from? Flag: picoCTF{FirstnameLastname}
The challenge’s description is very dramatic.
First, we open the given file. We can see those informations like: IP address, mail address, name, attached file, etc. So what do we do now? According to the description, this is suspected as a scam email. We has an IP address of the sender: 173.249.33.206. I will use whois command on it to find the one who sent this mail.
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023]
└─(0)💲whois 173.249.33.206
(more contents here)
mnt-by: MNT-CONTABO
created: 2009-12-09T13:41:08Z
last-modified: 2021-09-14T10:49:04Z
source: RIPE # Filtered
person: Wilhelm Zwalina
address: Contabo GmbH
address: Aschauer Str. 32a
address: 81549 Muenchen
phone: +49 89 21268372
fax-no: +49 89 21665862
nic-hdl: MH7476-RIPE
mnt-by: MNT-CONTABO
mnt-by: MNT-GIGA-HOSTING
created: 2010-01-04T10:41:37Z
last-modified: 2020-04-24T16:09:30Z
source: RIPE
% Information related to '173.249.32.0/23AS51167'
route: 173.249.32.0/23
descr: CONTABO
origin: AS51167
mnt-by: MNT-CONTABO
created: 2018-02-01T09:50:10Z
last-modified: 2018-02-01T09:50:10Z
source: RIPE
% This query was served by the RIPE Database Query Service version 1.106 (ABERDEEN)
Can you see the person field? That’s the name of the scammer and it’s also the flag we are looking for.
FLAG:
picoCTF{WilhelmZwalina}
FindAndOpen
Note
Someone might have hidden the password in the trace file. Find the key to unlock this file. This tracefile might be good to analyze.
Take a look at the given files, they’re just one pcap file and one pass-protected zip file. We can assuming that the password for it is in the pcap.
Let’s analize the traffic. We have MDNS protocol and other sussy protocols which look like hex value. I decided to filter out the data field.
We have many duplicate packets contain the same data. Let’s take a look at this packet:
As you can see, all of the packet’s fields are informations which are readable ASCII. That’s why we have sus protocols look like hex values at the beginning because those ASCII texts has overwritten packet’s fields.
Continue follow the trafic then I found the base64 string, decode it and we have the first half of the flag.
1
2
3
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/filenopen]
└─(0)💲echo 'VGhpcyBpcyB0aGUgc2VjcmV0OiBwaWNvQ1RGe1IzNERJTkdfTE9LZF8=' | base64 -d
This is the secret: picoCTF{R34DING_LOKd_
Use it to unzip the second file then we have full of the flag. Pretty easy, right?
FLAG:
picoCTF{R34DING_LOKd_fil56_succ3ss_5ed3a878}
MSB
Note
This image passes LSB statistical analysis, but we can’t help but think there must be something to the visual artifacts present in this image…
We have another picture in this challenge 😔. You can see the title, it said MSB which means Most Significant Bit. In case you don’t know what it is, I will explain a little bit here:
I will take a random 8 bits number as an example:
10100100
When we read a binary number, we start with the right-most digit and work our way left.
It means we read from right to left.
Order: 7 6 5 4 3 2 1 0
Digits: 1 0 1 0 0 1 0 0
And here are MSB and LSB:
MSB -> 1 010010 0 <- LSB
That’s it!
So what is MSB or LSB in steganography?
Assuming that we have one pixel in whatever image. It can be red, blue, yellow, green, etc. But all of the pixel will have 3 basic values, they are R G B values (red, green, blue). Some will have 4, they have A (Alpha) which specifies the opacity for a color. In this challenge, we can put that to one side.
What will happen to those values? RGB(A) use 8 bits for R, G and B. Each color has values ranging from 0 to 255. So you can imagine a pixel will have a structure like this:
Do you recognize this cyberpunk baddie? We don’t either. AI art generators are all the rage nowadays, which makes it hard to get a reliable known cover image. But we know you’ll figure it out. The suspect is believed to be trafficking in classics. That probably won’t help crack the stego, but we hope it will give motivation to bring this criminal to justice!
Dang, another stegano challenge!
Let’s have a look at the bmp picture.
As you can see, bit planes of the picture is very noisy. I guess the picture has some file embed in it.
Stairing at the pic won’t help anything. Let’s move on the hex values.
After 2 hours looking some clues in those hexs, I found something very interesting.
According to BMP’s wikipedia, we have the structure of the BMP that maybe similar to this:
Pay attention to the Pixel Array field. We have hex values that representing RGB values (3 values for RGB, 4 for RGBA):
Return back to our image. Can you see the unusual thing?
The bitmap data of the image follow this format: XX XX YY YY XX XX YY YY …
At that moment, I guessed XX was bitmap’s value and YY was added value. Scroll back to the beginning, I noticed that those values contain PK - 50 4B which is two first hex signatures of zip file.
I decided to write a script extract the sussy thing out after cut of the header of the bmp file.
The challenge give us one disk image file. Use Autopsy to load the contents of it. The image is quite huge so Autopsy take a long time to load it.
What do we have here. Hmmm, brower history, log files, those sussy bmp images, some random text??, mails, etc.
I jumped right in log files, they were all about League of Legends, but there is one sussy:
So we have the password for steghide, openssl command that use key, IV and salt. I decided to use these things on bmp files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/disk/home/yone/gallery]
└─(0)💲steghide extract -sf 1.bmp --passphrase akalibardzyratrundle
wrote extracted data to "les-mis.txt.enc".
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/disk/home/yone/gallery]
└─(0)💲openssl enc -aes-256-cbc -d -in les-mis.txt.enc -out les-mis.txt -K "58593a7522257f2a95cce9a68886ff78546784ad7db4473dbd91aecd9eefd508" -S "0f3fa17eeacd53a9" -iv "7a12fd4dc1898efcd997a1b9496e7591"
(repeat this process with 2.bmp and 3.bmp" caption="I'm really panik right now" >}}
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/disk/home/yone/gallery]
└─(0)💲cat les-mis.txt | grep pico
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/disk/home/yone/gallery]
└─(1)💲cat dracula.txt | grep pico
┌─[Green_Onions🧅]-[📂/mnt/hgfs/Local-Lab/Workspace/pico2023/disk/home/yone/gallery]
└─(1)💲cat frankenstein.txt | grep pico
No interesting informations were extracted… Unfortunately 🥲
But the last bmp file which is 7.bmp, we can’t use the password to un-steg it. Let’s take a look at the notes. Note 1.txt and 2.txt has strings like: chizazerite, guldulheen. Nothing interesting.
Hmmmm, look like the phrase yasuoaatrox... will be our steghide password but it was not completed.
Then I move on the mails. One of them was talking about erasing sussy mail. I decided to have a look at deleted mails and found this.
The mail contain a link. Open it up.
Hmmmmm 🤔. Are you thinking what Im thinking? Maybe the password is the concatenation of 4 LOL’s champion names.
Let’s give it a try.
I found a list of name here. Changing them to lowercase then write a simple script.