Writeup: Pragyan 2019 - EXORcism
Information
- Category: misc
Description
My friend Alex needs your help very fast. He has been possessed by a ghost and the only way to save him is if you tell the flag to the ghost. Hurry up, time is running out!
Writeup
The challenge file, called encoded.txt
is just a list of 0s and 1s; one per line.
Let’s check if we can create an ASCII art:
1 | with open("encoded.txt", "r") as f: |
This script prints the content of the file stripping the newline char on the terminal.
Shrinking around your terminal emulator you can eventually get:
This two QRcodes are equals but shifted just of a line. With PIL
it’s easy to get the QRcode into a PNG file.
1 | from PIL import Image |
The PNGs in output are identical:
Eventually the QRCode in output returns a string:
160f15011d1b095339595138535f135613595e1a
The strings could be a cipher text XORed with some unknown key…but! Since we know part of the plain text (pctf{
) we can check if the ciphertext leaks some infos.
From CyberChef we can see that the first part of the key is flag
.
Just using flag as key we got the flag.
Flag
pctf{wh4_50_53r1u5?}