Лаборатория TJCTF 2016 - Curses and Hexes [forensics 65]

, 01 June 2016

Find a flag in this PNG.

A PNG image file is given.

Previous tasks from this CTF has shown that it is necessary to check RGB channels first.
So I've written a script to get all data from R, G and B channels and save to out0, out1 and out2 respectively.

Here is what I've got:
out0 = O rn eGg m kfmrbdrm  u mltnoeih dn hrlvm.eaoh mri c dfeieh a...
out1 = nmngwnroSswer ol eshfnhsfrsrdnib taoieei  yniao-kbka   fdihd...
out2 = eoi,h eraao otueda,eodie afm  seio rb rnHl  srulea,nihlt se ...

If read by one character from each lines in series (from out0, out1, out2, out1, out2, ...) we will have the next text:
One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin......

And in the middle of this text the flag was inserted :)

Python script to get the text with a flag:

from PIL import Image

img = Image.open('curses_and_hexes.png')
p = img.load()
w, h = img.size
out0 = ''
out1 = ''
out2 = ''
for y in range(h):
    for x in range(w):
        out0 += chr(p[x, y][0])
        out1 += chr(p[x, y][1])
        out2 += chr(p[x, y][2])

res = ''
for i in xrange(0, len(out0)):
    res += out0[i] + out1[i] + out2[i]
print res

The flag is: