この大会は2025/12/6 0:00(JST)~2025/12/8 0:00(JST)に開催されました。
今回もチームで参戦。結果は150点で611チーム中340位でした。
自分で解けた問題をWriteupとして書いておきます。
Reservation (Misc)
環境変数PROMPTを指定することができれば、フラグを取得できる。デフォルトのWindowsの環境変数PROMPTは"$P$G"が設定されているので、これを指定する。
$ nc 34.118.61.99 10360 [windows_10 | cmd.exe] Welcome good sire to our fine establishment. Unfortunately, due to increased demand, we have had to privatize our services. Please enter the secret passphrase received from the environment to continue. $P$G Thank you for your patience. Here is your flag: nullctf{why_1s_it_r3srv3d_d0231666ea9b4255}
nullctf{why_1s_it_r3srv3d_d0231666ea9b4255}
Classically (Crypto)
暗号化処理の概要は以下の通り。
・M: 既知
・flag: フラグ
・n = 64
・flagの長さはn、flagの先頭4文字は"ctf{"、flagの末尾は"}"であることをチェック
・mod = 0x10001
・result = []
・Mの長さはnであることをチェック
・Mの各値vの長さはnであることをチェック
・n未満のiに対して以下を実行
・dot = 0
・n未満のjに対して以下を実行
・dot += M[i][j] * flag[j]
・resultにdot % modを追加
・resultを出力flag, result並べた行列(n行1列)をF、Cとすると、以下の行列の式になる。
M * F = C
以下でFを算出でき、フラグを求めることができる。
F = ~M * C
#!/usr/bin/env sage from M import M n = 64 mod = 0x10001 result = [29839, 662, 50523, 15906, 32667, 25159, 5172, 11685, 5618, 62174, 54405, 34902, 12259, 59526, 12299, 37286, 6055, 16813, 42488, 40708, 7662, 24263, 24047, 55429, 64420, 18167, 36330, 18325, 61471, 559, 32085, 23807, 26543, 26886, 24249, 45980, 23360, 15196, 42894, 33054, 22073, 23786, 63308, 44883, 60088, 38633, 54798, 42893, 29049, 25567, 33563, 49913, 63714, 51666, 60112, 19656, 13133, 11756, 34277, 55622, 14539, 54580, 48536, 1337] M = matrix(Zmod(mod), M) C = [] for c in result: C.append([c]) C = matrix(Zmod(mod), C) F = ~M * C flag = '' for i in range(n): flag += chr(int(F[i][0])) print(flag)
ctf{s0lve_th3_equ4t10n5_t0_f1nd_fl4g_h3r3_w4s_easy_en0ugh_NO???}