UIU CTF 2023
Some Misc challenges from UIU CTF 2023 🪟
Preface
A few days ago, I participated a fun CTF contest with my team and solved a few misc challenges. Although they are all easy, I still learn something from them and want to keep a note here for the future.
Corny Kernel
Use our corny little driver to mess with the Linux kernel at runtime!
$ socat file:$(tty),raw,echo=0 tcp:corny-kernel.chal.uiuc.tf:1337
After connecting to the server, I noticed there was a kernel module file in gzip compressed format. The challenge also gave us the source code of this so let’s check it out.
|
|
Hmmmm, I guess we can just load it then unload to see the flag.
You can use insmod
and rmmod
to load and unload the module.
As you can see, we have the first part of the flag. The last is in kernel log, use dmesg
to see it.
FLAG:
uiuctf{m4ster_k3rNE1_haCk3r}
vimjail series
vimjail1
If you connect to the server, you will get into vim environment. You can’t type anything and it’s almost impossible to get out of this.
What do we do now? Let’s see the attachments. We have four files but we just need to pay attention to entry.sh
and vimrc
.
|
|
So they use RMZu flag in vim usage.
|
|
They mapped 4 combination to nope which means they will do nothing. The point is using these combination to get out of Insert mode for us to type “:” related commands.
I’ve tried many combinations and this worked for me: “<c-\><c-o>”
We escaped!!!
You can read from here to know why we can execute commands in that mode: Link
FLAG:
uiuctf{n0_3sc4p3_f0r_y0u_8613a322d0eb0628}
vimjail2
Same problem, different approaches.
|
|
In this challenge, we need to exit vim to see the flag.
|
|
But they mapped all of the keys to “_”. Or maybe not all of the keys :D. If you notice, the “q” key and “:” key are not mapped to anything which means we can do “:q” to exit as usual.
Same method but this time we will type “:q” to exit.
Got the flag here:
FLAG:
uiuctf{<left><left><left><left>_c364201e0d86171b}
vimjail1.5
Fixed unintended solve in vimjail1
Connect with socat file:$(tty),raw,echo=0 tcp:vimjail1-5.chal.uiuc.tf:1337. You may need to install socat.
LOL, they fixed the old approach 🥲
What’s different with new vimrc
?
|
|
They replaced <c-\><c-n> with <c-\>. Now we can not use the same method as vimjail1 anymore.
After a few hours of trying combinations. I found this document on the Internet.
Here’s the interesting part:
Ohh, how about we send “\<c-o>” instead? Let’s try it.
Now I have entered expression mode.
Successfully escaped with our payload!!
FLAG:
uiuctf{ctr1_r_1s_h4ndy_277d0fde079f49d2}
vimjail2.5
Fixed unintended solve in vimjail2
Connect with socat file:$(tty),raw,echo=0 tcp:vimjail2-5.chal.uiuc.tf:1337. You may need to install socat.
Same challenge, same approach. But this time, as an improvement of vimjail2, this chal still mapped all of the keys except “q” and “:” to “_”.
So the question is: How to bypass it?
Let’s take a look back at vimrc
file. It mapped the keys not the combination so we can still use “
And here is the result:
FLAG:
uiuctf{1_kn0w_h0w_7o_ex1t_v1m_7661892ec70e3550}
Tornado Warning
“Check out this alert that I received on a weather radio. Somebody transmitted a secret message via errors in the header! Fortunately, my radio corrected the errors and recovered the original data. But can you find out what the secret message says?\n\nNote: flag is not case sensitive.”
Hint 1: The header is encoded with Specific Area Message Encoding.
Hint 2: The three buzzes are supposed to be identical, but in this challenge, they are different due to errors.
The challenge give us an audio file. If you play it, you’ll know that’s just a simple weather warning record. What are they hiding from us?
As the first hint said, the header is encoded with SAME. Google gave me this answer.
Okay that’s easy, just find a tool that support extracting SAME header from the wav file then see what we got.
I found this tool:
It can be used to read and extract SAME header from wav file, that’s what we need to do!
Extracting the header:
The flag is embed in the first three lines. If you notice, we just need to extract what’s different from the others. If the three are identical, we just need to take one.
Wrote a small script here:
|
|
FLAG:
uiuctf{3rd_w0rst_tor_outbre@k_ev3r}