iwasiblog

イワシブログ - Activity log of an iwasi -

EKOPARTY CTF 2015 Writeup

EKOPARTY CTF 2015に参加したので、解いた問題のwriteup.
以下の問題について書いた.

  • Agenda
    • Slogans (Trivia 50pts)
    • Banner (Trivia 70pts)
    • SSL Attack (Trivia 90pts)
    • Blocking truck (Trivia 100pts)
    • SCYTCRYPTO (Crypto 50pts)
    • XOR Crypter (Crypto 200pts)
    • Patch me (Reversing 50pts)
    • Olive (Misc 50)
    • Press it (Misc 100pts)

Slogans (Trivia 50pts)

Description: EKO{ekopartyslogan2008_ekopartyslogan2009}

EKOPARTY CTFの2008年大会と2009年大会のスローガンをアンダースコアでつないだものがFlag.
"ekoparty slogan 2008 2009"などとググった.

Flag : EKO{Vi root y entre_What if r00t was one of us?}

Banner (Trivia 70pts)

Description: Find the flag in our stand! (it works too if you are not at ekoparty)

スタンドに書いてあるとのことなので,会場の様子が分かれば...
そこで,EKOPARTY公式のtwitterを見ると,フラグの書かれた写真があった.

Flag : EKO{#2015#}

SSL Attack (Trivia 90pts)

Description: Name of one of the SSL attacks presented at ekoparty

過去に出題された問題について答えるようだ.
"EKOPARTY SSL attack"などとググると答えにたどり着けた.

Flag : EKO{beast}

Blocking truck (Trivia 100pts)

Description: There is a blue truck blocking the event entrance, can you tell us what is the URL to contact them (as it can be seen)?

入り口を塞いでいる青いトラックの連絡先であるURLを答えよと言う問題.
そんなの会場に居ないと分からないよ...と思いながら公式twitterを眺めていたら,ふと地図が目に入ってひらめいた.

会場付近をgoogle mapのストリートビューで見たところ,当該トラックがある.
その荷台に書かれたURLがFlag.

SCYTCRYPTO (Crypto 50pts)

Description: Decrypt this strange word: ERTKSOOTCMCHYRAFYLIPL

問題名からも分かるようにスキュタレー(scytale)暗号だった.
3文字ずつ改行して左上から縦に読んでいくとFlag.

Flag : EKO{MYFIRSTCRYPTOCHALL}

XOR Crypter (Crypto 200pts)

Description: The state of art on encryption, can you defeat it?
CjBPewYGc2gdD3RpMRNfdDcQX3UGGmhpBxZhYhFlfQA=
Attachment: crypto200.zip

暗号文と暗号化スクリプトが渡される.
原理は,4byteの倍数にパディングした文字列を4byte(4文字)ずつ区切り,それぞれの上位2byteに対して下位2byteでXORしたバイト列をbase64エンコードするものだった.
XORするための下位16bitはそのまま残っているので,バイト列に同じ操作を再度適用すれば復元される.
base64エンコード/デコード処理を逆にした改造スクリプトに暗号文を入力してFlag.

Flag : EKO{unshifting_the_unshiftable}

Patch me (Reversing 50pts)

Description: Find a way to read the corrupted image!
Attachment: rev50.zip

C#で書かれた実行ファイルと,それによってxmlにコンバートされた元画像ファイルと思わしきファイルが渡される.
ILSpyでデコンパイルを行い,仕組みを読む.コードには,xmlから画像を復元する手順も記載されていたため,自前で再度実装する.
その際,xmlがエラー判定処理につかまって復元ができなかったので,エラー処理そのものを消して実行したところ,十分読める画像が生成された.

Flag : EKO{n1L+P4tch}

Olive (Misc 50)

Description: Recover the flag from this session
Attachment: misc50.zip

pcapngファイルが渡される.
内容を読むとVNCの通信であり,リモートデスクトップを行っているらしい.
ひたすらポインタイベントなどが続いた後,
あるところからキーイベントの通信が始まるので入力を追うとFlagになる.
f:id:kuroiwasi:20151024051004j:plain
Flag : EKO{NOT_anym0re_VNC_hax}

Press it (Misc 100pts)

Description: Recover the flag
Attachment: misc100.zip

複数行に渡って16進数の書かれたテキストが渡される.
16進の組み合わせなどでググると,キーボードのスキャンコードであることが分かった.
あとは対応する16進数を出力するキーを調べて,順番に並べるとFlag.

0x9c 
0x36 0x14 0xb6 0x94 [T]
0x23 0x17 0xa3 0x1f 0x97 0x39 0x9f 0x17 0xb9 0x1f 0x97 0x9f [his is]
0x39 
0xb9 0x17 
0x97 0x14 0x94 [ it]
0x36 [shift]
0x34 0xb6 0x39 0xb4 0xb9 [>]
0x36 0x12 0x92 
0x25 
0xa5 
0x18 
0x98 0xb6 [EKO]
0xe0 0x38 0x28 
0xe0 0xb8 0xa8 [Alt+:]
0x17 0x97 0x30 0xb0 0x32 0xb2 [ibm]
0x36 0x35 [shift]
0xb5 0xb6 [?]
0x32 0x18 0xb2 0x98 [mo]
0x20 0xa0 [d]
0x12 0x26 0x92 0xa6 [el]
0x36 0x35 0xb6 0xb5 [shift ?]
0x32 0xb2 [m]
0xe0 0x38 
0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 
0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0xe0 0x38 0x2b 0xab 
0xe0 0xb8 [Alt+]]
0x39 0xb9 [space]
0x39 0xb9 [space]
0x36 
0x36 0xb6 [right shift]
0x1c 0x9c [enter]
0x1d

This is it>EKO{ibm_model_m}

後に追加されたHintによるとスペイン語キーボードだったらしい.

Hints: It is a spanish keyboard!

Flag : EKO{ibm_model_m}