riftCTF Writeup

この大会は2020/3/20 15:30(JST)~2020/3/21 15:30(JST)に開催されました。
今回もチームで参戦。結果は4518点で451チーム中13位でした。
自分で解けた問題をWriteupとして書いておきます。

Misc 0x0001 (Miscellaneous 20)

Discordに入り、#flagチャネルのメッセージを見ると、フラグが書いてある。

riftCTF{sanity_check}

Misc 0x0005 (Miscellaneous 30)

Slowloris DDoSの対象レイヤを答える。

riftCTF{application}

Misc 0x0006 (Miscellaneous 50)

問題はこうなっている。

This beast operates on 53 qubits and recently achieved "Quantum Supremacy". 
We are sure that you know it's name.

いろいろと調べてキーワードを試す。

riftCTF{Sycamore}

Misc 0x0004 (Miscellaneous 100)

問題はこうなっている。

https://imgur.com/c0Je5j8
101 image 110 => gives you the flag Note- flag format eg riftCTF{eval}

101と110の2進数のXORを取ればよいとわかった。

riftCTF{011}

Stegano 0x0001 (Steganography 100)

$ strings chall1.jpeg | grep riftCTF
riftCTF{R1ck_4ND_the_r1ft}
riftCTF{R1ck_4ND_the_r1ft}

crypto 0x0001 (Cryptography 100)

base64デコードをしていく。

$ echo V1RJeGMySlhVa1pVYkZaVFltNVNTMXBGYUU5YWF6VkdaVVV4V1UxclduQlVWV2hYVFVabmQxTnRhRlpsYXpRMQ== | base64 -d
WTIxc2JXUkZUbFZTYm5SS1pFaE9aazVGZUUxWU1rWnBUVWhXTUZnd1NtaFZlazQ1y
$ echo V1RJeGMySlhVa1pVYkZaVFltNVNTMXBGYUU5YWF6VkdaVVV4V1UxclduQlVWV2hYVFVabmQxTnRhRlpsYXpRMQ== | base64 -d | base64 -d
Y21sbWRFTlVSbnRKZEhOZk5FeE1YMkZpTUhWMFgwSmhVek45
$ echo V1RJeGMySlhVa1pVYkZaVFltNVNTMXBGYUU5YWF6VkdaVVV4V1UxclduQlVWV2hYVFVabmQxTnRhRlpsYXpRMQ== | base64 -d | base64 -d | base64 -d
cmlmdENURntJdHNfNExMX2FiMHV0X0JhUzN9
$ echo V1RJeGMySlhVa1pVYkZaVFltNVNTMXBGYUU5YWF6VkdaVVV4V1UxclduQlVWV2hYVFVabmQxTnRhRlpsYXpRMQ== | base64 -d | base64 -d | base64 -d | base64 -d
riftCTF{Its_4LL_ab0ut_BaS3}
riftCTF{Its_4LL_ab0ut_BaS3}

crypto 0x0005 (Cryptography 100)

問題はこの画像ファイル。
f:id:satou-y:20200329191757j:plain
substitution symbol cipherで調べると、この換字式暗号の変換表が見つかった。

https://www.symbols.com/symbol/alphabet-of-daggers

f:id:satou-y:20200329191928p:plain
この表を元に復号する。

RIFTCTFBONJOURELLIOT

crypto 0x0004 (Cryptography 150)

問題はこの画像ファイル。
f:id:satou-y:20200329192053j:plain
国際信号旗であることはすぐにわかった。

https://ja.wikipedia.org/wiki/%E5%9B%BD%E9%9A%9B%E4%BF%A1%E5%8F%B7%E6%97%97

この対応表を元に復号する。

RIFTCTFJUSTA7R1BUT3T0ARMEDFORCES

いろいろと試したところ、以下のフラグで通った。

riftCTF{just_a_7r1but3_t0_armedforces}

crypto 0x0007 (Cryptography 150)

問題はこの画像ファイル。
f:id:satou-y:20200329192347j:plain
換字式暗号のはずだが、変換テーブルが見つからない。画像を見ると、何となくアルファベットに近い形状をしている。変換テーブルを推測しながら復号する。

RIFTCTFSURVIVALOFTHEFITTEST

crypto 0x0002 (Cryptography 200)

問題はこうなっている。

Enjoying the party? Let's not forget our sponsors, who made all this possible. A special thanks to http://bit.ly/l4stnam3 .

Alright now let's see the juicier stuff.

egkyGGJ{Q3e_Xf_FshH3wf} -- you know what to do right? make sure you have the key ;)

Vigenere暗号と推測し、鍵を見ていく。

平文 暗号文 鍵
r -> e       N
i  -> g       Y
f  -> k       F
t  -> y       F

http://bit.ly/l4stnam3を見ると、LinkedinのLouis Nyffeneggerさんのページ。Nyffeneggerが鍵になると推測して復号する。

import string

def decrypt(s, key):
    key = key.lower()
    i = 0
    dec = ''
    for c in s:
        if c in string.lowercase:
            index_ct = string.lowercase.index(c)
            index_key = string.lowercase.index(key[i%len(key)])
            index_pt = (index_ct - index_key) % 26
            dec += string.lowercase[index_pt]
            i += 1
        elif c in string.uppercase:
            index_ct = string.uppercase.index(c)
            index_key = string.lowercase.index(key[i%len(key)])
            index_pt = (index_ct - index_key) % 26
            dec += string.uppercase[index_pt]
            i += 1
        else:
            dec += c
    return dec

enc = 'egkyGGJ{Q3e_Xf_FshH3wf}'

flag = decrypt(enc, 'Nyffenegger')
print flag
riftCTF{K3y_To_SucC3ss}