THJCC CTF 2024 Winter

Sat, 14 - 15 Dec 2024

๐Ÿ” Crypto

Girlfriend

Description

Kohiroๆ‹ฟๅˆฐไบ†ไธ€ๆฎตๅฅณๅ‹็ตฆ็š„ๅฏ†ๆ–‡๏ผŒไฝ†ๆ˜ฏไป–ไธ็Ÿฅ้“้€™ๆ˜ฏไป€้บผ่ซ‹ๅนซๅฅน่งฃๅฏ† Kohiro received a mysterious encoded message from his girlfriend, but he doesn't know what it is. Please help him decode it. WkdsWmIwbFRSazFaUkVKTFdIcHdhazFFTVdaa01EUTk= Author : kohiro

Solve

So, this challenge doesn't provide any file attachment or something else. Then, i know this is a classical cipher that we can solve from any online tools. For a quick solve, i used CyberChefarrow-up-right.

Firstly, i tried to use Base64 to decode it because it's identically similiar with Base64 format. But it is still encrypted. I tried Base64 again and again until 3 times. After that, the encrypted format looks like ROT47.

CyberChef recipes

The last cipher is ROT13 anddd yeahh! i got the flag

Flag :

S-box

Description

In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Shannon's property of confusion. Mathematically, an S-box is a nonlinear vectorial Boolean function.

Author : Dr. Dog

Solve

In this challenge, author provided 2 attachment files, chal.py and output.txt. The output.txt is the encrypted flag, and the chal.py is the encrypting system used for output.

It's an S-box encryption system. Then, i search in google and found the exact paragraph as the description does.

In cryptographyarrow-up-right, an S-box (substitution-box) is a basic component of symmetric key algorithmsarrow-up-right which performs substitution. In block ciphersarrow-up-right, they are typically used to obscure the relationship between the key and the ciphertextarrow-up-right, thus ensuring Shannon'sarrow-up-right property of confusionarrow-up-right. Mathematically, an S-box is a nonlinear[1]arrow-up-right vectorial Boolean functionarrow-up-right.[2]arrow-up-right (Wikipedia).

So, just make a script to reverse the S-box, then decode the Base64 cipher text. Here is my script

Once you run it, you will finnd the actual flag (plaintext).

Flag :

๐ŸŒ Web

Notepad

Description

I made a notepad+++ in python! http://cha-thjcc.scint.org:10001/arrow-up-right Author: xiulan

Solve

Yeah, he just made a notepad++ in python. This is how the web look like.

notepad web

Firstly, i go to the source code that is provided from author. It has a redacted flag file and the HTML file is in a subfolder.

So, index.htmlis in the /template folder and flag.txt is in the main folder. If i want to access the flag.txt, i have to change the cookies value of the web that i accessing.

Website's cookies(before)

Change the "Value" from 5b132a89...... to ../flag.txt to access the flag file.

Cookie's value (after)

Yeah, we got the real flag from changing a value of cookie session

Flag :

Thanks for reading this writeup. Support me by buy me a coffee herearrow-up-right

PayPalarrow-up-right Ko-Fiarrow-up-right

Last updated