ログイン
編集不可のページディスカッション情報添付ファイル
CTF/Writeup/SECCON 2014 Quals Online Winter/Version 2

MMA

Version 2 (Network 200pts)

まず問題文を見てHTTP/2だろうと予想したが,80番や443番ポートには接続できない。

対象ホストに対してポートスキャンを行ったところいくつかのポートが開いていた。

Starting Nmap 6.40 ( http://nmap.org ) at 2014-12-07 10:25 JST
Nmap scan report for h2o.pwn.seccon.jp (133.242.231.94)
Host is up (0.027s latency).
Not shown: 65521 closed ports
PORT      STATE    SERVICE
22/tcp    open     ssh
25/tcp    filtered smtp
137/tcp   filtered netbios-ns
138/tcp   filtered netbios-dgm
139/tcp   filtered netbios-ssn
445/tcp   filtered microsoft-ds
1243/tcp  filtered serialgateway
2049/tcp  filtered nfs
4949/tcp  open     munin
12345/tcp filtered netbus
27374/tcp filtered subseven
31785/tcp filtered unknown
65080/tcp open     unknown
65432/tcp open     unknown

特に,65080番に接続してみるとv2で接続しろとの旨が表示された。

Firefox 34の設定を変更してHTTP/2の有効化を試みたがうまく行かなかったため, nghttpをダウンロード,コンパイルして実行した。

% src/nghttp -nv http://h2o.pwn.seccon.jp:65080/
[  0.036] send SETTINGS frame <length=12, flags=0x00, stream_id=0>
          (niv=2)
          [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
          [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
[  0.036] send HEADERS frame <length=43, flags=0x05, stream_id=1>
          ; END_STREAM | END_HEADERS
          (padlen=0)
          ; Open new stream
          :authority: h2o.pwn.seccon.jp:65080
          :method: GET
          :path: /
          :scheme: http
          accept: */*
          accept-encoding: gzip, deflate
          user-agent: nghttp2/0.6.8-DEV
[  0.062] recv SETTINGS frame <length=18, flags=0x00, stream_id=0>
          (niv=3)
          [SETTINGS_ENABLE_PUSH(0x02):0]
          [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
          [SETTINGS_INITIAL_WINDOW_SIZE(0x04):262144]
[  0.062] recv SETTINGS frame <length=0, flags=0x01, stream_id=0>
          ; ACK
          (niv=0)
[  0.062] recv (stream_id=1, noind=0) :status: 200
[  0.062] recv (stream_id=1, noind=0) server: h2o/0.1
[  0.062] recv (stream_id=1, noind=0) date: Sun, 07 Dec 2014 01:47:19 GMT
[  0.062] recv (stream_id=1, noind=0) x-flag-is: SECCON{spdy4isSoC001}
[  0.062] recv (stream_id=1, noind=0) content-type: text/html
[  0.062] recv (stream_id=1, noind=0) last-modified: Sat, 29 Nov 2014 15:22:23 GMT
[  0.062] recv (stream_id=1, noind=0) etag: "5479e4af-13"
[  0.062] recv HEADERS frame <length=107, flags=0x04, stream_id=1>
          ; END_HEADERS
          (padlen=0)
          ; First response header
[  0.062] recv DATA frame <length=19, flags=0x01, stream_id=1>
          ; END_STREAM
[  0.062] send SETTINGS frame <length=0, flags=0x01, stream_id=0>
          ; ACK
          (niv=0)
[  0.062] send GOAWAY frame <length=8, flags=0x00, stream_id=0>
          (last_stream_id=0, error_code=NO_ERROR(0x00), opaque_data(0)=[])

x-flag-isヘッダとしてフラグが含まれている。

なお,65432番ポートに対してはhttpsで接続すると同様にしてフラグを得ることができた。

CTF/Writeup/SECCON 2014 Quals Online Winter/Version 2 (最終更新日時 2014-12-07 20:58:49 更新者 ytoku)