WPICTF 2021 Writeup

この大会は2021/4/24 7:00(JST)~2021/4/26 7:00(JST)に開催されました。
今回もチームで参戦。結果は200点で246チーム中136位でした。
自分で解けた問題をWriteupとして書いておきます。

Baby's First Reversing (Reversing 50)

バイナリエディタで見ると、pycのフォーマットのようだった。デコンパイルしてみる。

$ mv mhm mhm.pyc
$ uncompyle6 mhm.pyc
# uncompyle6 version 3.7.4
# Python bytecode 3.8 (3413)
# Decompiled from: Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
# [GCC 8.4.0]
# Embedded file name: uhhhhhhh.py
# Compiled at: 2021-03-05 08:04:38
# Size of source mod 2**32: 1222 bytes


def __main__(inp):
    i = -4
    for c in inp:
        if i == 4:
            if c != ' ':
                exit(82)
            else:
                if i == -4:
                    if c != 'W':
                        exit(133)
                    else:
                        if i == -2:
                            if c != 'I':
                                exit(42069)
                            elif i == -1 and c != '{':
                                exit(11037)
                            if i == 10:
                                if c != '}':
                                    exit(9001)
                        else:
                            if i == 1:
                                if c != '@':
                                    exit(11037)
                            if i == 2 and c != '5':
                                exit(11037)
                        if i == 7 and c != 'P':
                            exit(11037)
                    if i == 3:
                        if c != 'E':
                            exit(11037)
                else:
                    if i == 0:
                        if c != 'h':
                            exit(82)
                    if i == 5 and c != 'h':
                        exit(11037)
                if i == -3 and c != 'P':
                    exit(133)
            if i == 9:
                if c != '!':
                    exit(133)
        else:
            if i == 6:
                if c != '0':
                    exit(133)
            if i == 8 and c != '3':
                exit(133)
        i += 1
    else:
        print(':)')


__main__(input('hi'))
# okay decompiling mhm.pyc

この条件から、input文字列を組み立てる。

WPI{h@5E h0P3!}

glute (Stego 150)

バイナリで見てみると、pdfが入っていることがわかる。foremostで取り出す。

$ foremost glute.png 
Processing: glute.png
|*|

PDFにフラグが書いてある。
f:id:satou-y:20210502200537p:plain

WPI{P0lyGlOtz_R_koo1}