PragyanCTF 2019|EXORcism

https://ctftime.org/task/7775

#pragyanctf

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!

HINT: We need a very quick response from you so that you can save him from the ghost by exorcizing it with the flag.

1と0しかない10000行のテキストが与えられる。とりあえず10000ということなので100x100くらいにしてみたらQRっぽい形が見える。最初2個あるのかと思ったけどちゃんとみたら1個だった。いろいろやりようはあると思うけど、strong-qr-decoderで綺麗に処理できる形にならなかったので画像にして読むことにした。

from PIL import Image

data = open("encoded.txt").read().replace("\n", "")

img = Image.new("RGB", (100, 100), (255, 255, 255))

for y in range(100):
    for x in range(100):
        if data[y*100 + x] == "0":
            img.putpixel((x, y), (0, 0, 0))

img.save("QR.png")

これを読むと160f15011d1b095339595138535f135613595e1aになっている。あとは適当にpctfとxorをとるとflagが鍵っぽいことがわかるのでflagでxorしてpctf{wh4_50_53r1u5?}