404 Flag not found

(misc80, solved by 153)

Description: I tried to download the flag, but somehow received only 404 errors :(

Attachment: misc80.zip

ファイルを解凍すると、Wireshark capture file (.pcapng)ができます。Wiresharkでパケットを確認すると、HTTPリクエストでflag.txtをGETしているパケットが下記のとおりいくつか見つかります。

http://496e2074686520656e642c206974277320616c6c2061626f757420666c61.2015.ctf.internetwache.org/flag.txt
http://67732e0a5768657468657220796f752077696e206f72206c6f736520646f.2015.ctf.internetwache.org/flag.txt
http://65736e2774206d61747465722e0a7b4f66632c2077696e6e696e67206973.2015.ctf.internetwache.org/flag.txt
http://20636f6f6c65720a44696420796f752066696e64206f7468657220666c61.2015.ctf.internetwache.org/flag.txt
http://67733f0a4e6f626f62792066696e6473206f7468657220666c616773210a.2015.ctf.internetwache.org/flag.txt
http://53757065726d616e206973206d79206865726f2e0a5f4845524f2121215f.2015.ctf.internetwache.org/flag.txt
http://0a48656c70206d65206d7920667269656e642c2049276d206c6f73742069.2015.ctf.internetwache.org/flag.txt
http://6e206d79206f776e206d696e642e0a416c776179732c20616c776179732c.2015.ctf.internetwache.org/flag.txt
http://20666f72206576657220616c6f6e652e0a437279696e6720756e74696c20.2015.ctf.internetwache.org/flag.txt
http://49276d206479696e672e0a4b696e6773206e65766572206469652e0a536f.2015.ctf.internetwache.org/flag.txt
http://20646f20492e0a7d210a.2015.ctf.internetwache.org/flag.txt

これらのURLにアクセスしても、全て404エラーとなります。URLのホスト名の部分を見てみると、ASCIIコードになっているように見えますので、文字に変換するRubyプログラムを書きます。

a = [
"496e2074686520656e642c206974277320616c6c2061626f757420666c61",
"67732e0a5768657468657220796f752077696e206f72206c6f736520646f",
"65736e2774206d61747465722e0a7b4f66632c2077696e6e696e67206973",
"20636f6f6c65720a44696420796f752066696e64206f7468657220666c61",
"67733f0a4e6f626f62792066696e6473206f7468657220666c616773210a",
"53757065726d616e206973206d79206865726f2e0a5f4845524f2121215f",
"0a48656c70206d65206d7920667269656e642c2049276d206c6f73742069",
"6e206d79206f776e206d696e642e0a416c776179732c20616c776179732c",
"20666f72206576657220616c6f6e652e0a437279696e6720756e74696c20",
"49276d206479696e672e0a4b696e6773206e65766572206469652e0a536f",
"20646f20492e0a7d210a"
]
class String
  def hex2bin
    s = self
    raise "Not a valid hex string" unless(s =~ /^[\da-fA-F]+$/)
    s = '0' + s if((s.length & 1) != 0)
    s.scan(/../).map{ |b| b.to_i(16) }.pack('C*')
  end
  def bin2hex
    self.unpack('C*').map{ |b| "%02X" % b }.join('')
  end
end


for s in a do
  p s.hex2bin
end

実行して得られた文字列の改行などを調整すると、下記のようになります。

In the end, it's all about flags.
Whether you win or lose doesn't matter.
{Ofc, winning is cooler
Did you find other flags?
Noboby finds other flags!
Superman is my hero.
_HERO!!!_
Help me my friend, I'm lost in my own mind.
Always, always, for ever alone.
Crying until I'm dying.
Kings never die.
So do I.
}!

各行の先頭文字を縦読みするとフラグを得ることができます。


フラグは、

IW{DNS_HACKS}

です。