X-MAS GTF 2020 Writeup

この大会は2020/4/1 9:00(JST)~2020/4/2 9:00(JST)に開催されました。
今回もチームで参戦。結果は1191点で345チーム中88位でした。
自分で解けた問題をWriteupとして書いておきます。

Honest question (!Sanity Check)

1000と答えたら、-1000になってしまった。The Self-Destruct Buttonの問題でチームを削除して、再作成しなおして0とした。

0

Sanity Check? (!Sanity Check)

チームのパスワードを答えればよい。

チームパスワード

GTF Poem (Forensics)

問題はこうなっている。

Christmax in spring?
Oh, wait - it's HTsP
Does this bell a rimg?
Well, come and sea!

On Aprils Fools day
Our encineers present you
New challenges to ploy
Hope you'll c0me thlough
_
Since you're alreapy here
You'll find o hidden secr3t
Imside the poem where
The tazk is incomplete

Note: you'll have to add curly braces to the flag

スペルが間違っている箇所と、数字、記号を抜き出す。

Christmax in spring? →x
Oh, wait - it's HTsP →-
Does this bell a rimg? →m
Well, come and sea! →a

On Aprils Fools day →s
Our encineers present you →c
New challenges to ploy →o
Hope you'll c0me thlough →0l
_            →_
Since you're alreapy here →p
You'll find o hidden secr3t →o3
Imside the poem where →m
The tazk is incomplete →z
X-MAS{co0l_po3mz}

Encrypted Image (Forensics)

0xffとXORを取ってみると、先頭から0x1b812バイトがjpgになっているとわかる。最終的な復号コードは以下の通り。

with open('secret.img', 'rb') as f:
    data = f.read(0x1b812)

flag = ''
for i in range(len(data)):
    code = ord(data[i]) ^ 0xff
    flag += chr(code)

with open('flag.jpg', 'wb') as f:
    f.write(flag)

f:id:satou-y:20200407084232j:plain
復号した画像にフラグが書いてあった。

X-MAS{TH3_34RTH_1S_FL4T_4ND_XOR_C4N_B3_C4LL3D_3NCRYPTION}

Cheese This (Guessing)

最初の16バイトを、pngの先頭16バイトに修正する。
f:id:satou-y:20200407084640p:plain
png画像になるが、フラグがピーマンで隠れている部分があるので、推測する。

X-MAS{You_are_g00d_w1th_gu3551ng}

Thanos won (Sheer luck)

何回もアクセスすると、当たるときがあるようだ。スクリプトで何回もアクセスを実行する。

import requests

for i in range(10000):
    print 'Round %d' % (i+1)
    r = requests.get('http://challs.xmas.htsp.ro:1341/')
    if 'NO' not in r.text:
        print r.text
        break

実行結果は以下の通り。

    :
Round 1605
1337
X-MAS{stay_at_home_and_respect_your_elders}<img src = https://media.tenor.com/images/23b068a65eae635b01bd4ddbb525e465/tenor.gif>
X-MAS{stay_at_home_and_respect_your_elders}

X-MAS{Circular_dependency_hell}

フラグはタイトルになっているが、入力欄がない。他の問題の入力欄のPOST部分のソースを見ると、challengeに問題のIDのようなものをしていることがわかる。
この問題は33なので、他の問題のフラグ入力欄にこのフラグを入力して、Fiddlerで途中で止めて、challengeの数字を33に変更して送信する。これで受け付けられた。

X-MAS{Circular_dependency_hell}