Description

Someone sent me a file with white and black rectangles. I don’t know how to read it. Can you help me?

Solution

Downloading the attached misc60.zip and extracting it revealed a README.txt revealed a bunch of text

cat README.txt
4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paI4paI4paICuKWiOKWiCAgICAgICAgICAgICAg4paI4paIICDiloji
loggIOKWiOKWiCAg4paI4paIICAgICAgICAgICAgICDilojilogK4paI4paIICDilojilojiloji
lojilojilojilojilojilojiloggIOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiCAg4paI
4paIICDilojilojilojilojilojilojilojilojilojiloggIOKWiOKWiArilojiloggIOKWiOKW
iCAgICAgIOKWiOKWiCAg4paI4paIICDilojilojilojiloggICAg4paI4paIICDilojiloggICAg
ICDilojiloggIOKWiOKWiArilojiloggIOKWiOKWiCAgICAgIOKWiOKWiCAg4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paIICDilojiloggIOKWiOKWiCAgICAgIOKWiOKWiCAg4paI4paICuKW
iOKWiCAg4paI4paIICAgICAg4paI4paIICDilojiloggIOKWiOKWiOKWiOKWiCAg4paI4paI4paI
4paIICDilojiloggICAgICDilojiloggIOKWiOKWiArilojiloggIOKWiOKWiOKWiOKWiOKWiOKW
iOKWiOKWiOKWiOKWiCAg4paI4paI4paI4paIICAgIOKWiOKWiCAg4paI4paIICDilojilojiloji
lojilojilojilojilojilojiloggIOKWiOKWiArilojiloggICAgICAgICAgICAgIOKWiOKWiCAg
4paI4paIICDilojiloggIOKWiOKWiCAgICAgICAgICAgICAg4paI4paICuKWiOKWiOKWiOKWiOKW
iOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKW
iCAgICDilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojiloji
logK4paI4paI4paI4paIICDilojilojilojiloggIOKWiOKWiCAg4paI4paI4paI4paIICAgIOKW
iOKWiCAgICDilojilojilojiloggIOKWiOKWiCAg4paI4paIICDilojilogK4paI4paIICAgICAg
ICAgICAg4paI4paIICAgIOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiCAg4paI4paIICDilojiloji
lojilojilojilojilojiloggIOKWiOKWiArilojiloggIOKWiOKWiCAg4paI4paI4paI4paI4paI
4paIICAgICAgICAgICAg4paI4paI4paI4paI4paI4paI4paI4paIICDilojiloggIOKWiOKWiCAg
4paI4paICuKWiOKWiCAg4paI4paI4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDiloji
loggIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paI4paI4paICuKWiOKWiOKW
iOKWiCAg4paI4paIICAgIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDi
lojiloggIOKWiOKWiCAg4paI4paIICDilojilogK4paI4paI4paI4paI4paI4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paI
ICDilojiloggIOKWiOKWiCAg4paI4paI4paI4paICuKWiOKWiCAgICAgICAgICAgICAg4paI4paI
4paI4paI4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI
4paICuKWiOKWiCAg4paI4paI4paI4paI4paI4paI4paI4paI4paI4paIICDilojilojilojilogg
IOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDilojilojilojilogK4paI
4paIICDilojiloggICAgICDilojiloggIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg
4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paICuKWiOKWiCAg4paI4paIICAgICAg4paI4paI
ICDilojilojilojiloggIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDi
lojilojilojilogK4paI4paIICDilojiloggICAgICDilojiloggIOKWiOKWiOKWiOKWiOKWiOKW
iCAg4paI4paIICDilojiloggIOKWiOKWiCAg4paI4paIICDilojiloggIOKWiOKWiArilojilogg
IOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiCAg4paI4paIICAgIOKWiOKWiCAgICDiloji
lojilojiloggIOKWiOKWiCAg4paI4paIICDilojilojilojilogK4paI4paIICAgICAgICAgICAg
ICDilojilojilojilojilojiloggICAg4paI4paI4paI4paI4paI4paI4paI4paIICDilojilogg
ICAgICDilojilogK4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI
4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paI4paICg==
.....

This format repeated it self over and over. It’s easy to see that this is base64 encoded data.

Base64 decoding the file quickly revealed that this was QR codes

cat README.txt | base64 -d
██████████████████████████████████████████████
██              ██  ██  ██  ██              ██
██  ██████████  ██████████  ██  ██████████  ██
██  ██      ██  ██  ████    ██  ██      ██  ██
██  ██      ██  ██████████  ██  ██      ██  ██
██  ██      ██  ██  ████  ████  ██      ██  ██
██  ██████████  ████    ██  ██  ██████████  ██
██              ██  ██  ██  ██              ██
████████████████████████    ██████████████████
████  ████  ██  ████    ██    ████  ██  ██  ██
██            ██    ████████  ██  ████████  ██
██  ██  ██████            ████████  ██  ██  ██
██  ████  ██  ██  ██  ██  ██  ██  ██  ██  ████
████  ██    ██  ██  ██  ██  ██  ██  ██  ██  ██
████████████████████  ██  ██  ██  ██  ██  ████
██              ██████  ██  ██  ██  ██  ██  ██
██  ██████████  ████  ██  ██  ██  ██  ██  ████
██  ██      ██  ██  ██  ██  ██  ██  ██  ██  ██
██  ██      ██  ████  ██  ██  ██  ██  ██  ████
██  ██      ██  ██████  ██  ██  ██  ██  ██  ██
██  ██████████  ██    ██    ████  ██  ██  ████
██              ██████    ████████  ██      ██
██████████████████████████████████████████████
.....

I quickly wrote a python tool to split the data into separate files.

#!/usr/bin/env python

from base64 import b64decode

with open('README.txt') as f:
    counter = 1
    out = ''
    for line in f.readlines():
        out += line
        if (len(line) < 76):
            filename = 'output%02d.txt'%(counter)
            fh = open(filename, 'wb')
            fh.write(b64decode(out))
            fh.close()
            counter += 1
            out = ''

I now read the files in chunks of 3 at the time (max fit on my screen), and scanning them one by one with my phone.

output01.txt    F
output02.txt    l
output03.txt    a
output04.txt    g
output05.txt    i
output06.txt    s
output07.txt    :
output08.txt    I
output09.txt    W
output10.txt    {
output11.txt    Q
output12.txt    R
output13.txt    _
output14.txt    C
output15.txt    0
output16.txt    D
output17.txt    E
output18.txt    S
output19.txt    _
output20.txt    R
output21.txt    U
output22.txt    L
output23.txt    3
output24.txt    }

Which obviously becomes Flag is: IW{QR_C0DES_RUL3}

Flag: IW{QR_C0DES_RUL3}

Rekt Sec

InternetWatche 2016 CTF - The Secret Store (Web 70)

InternetWatche 2016 CTF - The Secret Store (Web 70) Continue reading