CrewCTF 2022 Writeup

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

Welcome (welcome)

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

crew{W3lc0mE!}

Corrupted (forensics)

$ binwalk Corrupted.001 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
40543         0x9E5F          Unix path: /0/1/2/3/4/5/6/7/8/9/:/;/</=/>/?/@/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/[/\/]/^/_/`/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o
5808128       0x58A000        PNG image, 294 x 306, 8-bit/color RGBA, non-interlaced
5836800       0x591000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
5836870       0x591046        Zlib compressed data, compressed
6934528       0x69D000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
6934598       0x69D046        Zlib compressed data, compressed
8704000       0x84D000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
8704070       0x84D046        Zlib compressed data, compressed
10506240      0xA05000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
10506376      0xA05088        Zlib compressed data, compressed
12275712      0xBB5000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
12275848      0xBB5088        Zlib compressed data, compressed
14082048      0xD6E000        PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
14082118      0xD6E046        Zlib compressed data, compressed
15024128      0xE54000        JPEG image data, EXIF standard
15024140      0xE5400C        TIFF image data, big-endian, offset of first image directory: 8
19922944      0x1300000       JPEG image data, EXIF standard
19922956      0x130000C       TIFF image data, big-endian, offset of first image directory: 8
24121344      0x1701000       PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
24121414      0x1701046       Zlib compressed data, compressed
26468352      0x193E000       PNG image, 1920 x 1080, 8-bit/color RGBA, non-interlaced
26468422      0x193E046       Zlib compressed data, compressed

$ foremost Corrupted.001 
Processing: Corrupted.001
|*|

抽出できたpngファイルの1つにフラグが書いてあった。

crew{34sY_C0rrupt3D_GPT}

ez-x0r (crypto)

base64デコードし、フラグは"crew"から始まることを前提にXORキーを求め、復号する。

#!/usr/bin/env python3
import base64

with open('flag.enc', 'r') as f:
    enc = f.read()

enc = base64.b64decode(enc)

key = ord('c') ^ enc[0]

flag = ''
for c in enc:
    flag += chr(c ^ key)
print(flag)
crew{3z_x0r_crypto}