6月 5

DEFCON 20 CTF Forensic 300(f300) writeup

問題文: Please get my key back!
Challenge File

まずはダウンロードしてきたChallenge Fileの種類を調査。
# file for300-47106ef450c4d70ae95212b93f11d05d
for300-47106ef450c4d70ae95212b93f11d05d: data

data…

仕方がないので直接中身を眺めます。

ファームウェアっぽい?
この中から何かを取り出さなければ何もはじまらない。
ってことで「firmware-mod-kit」の「extract-ng.sh」問題ファイルを食わせてみます。
(firmware-mod-kitについての説明はココ参照。)

# ./extract-ng.sh for300-47106ef450c4d70ae95212b93f11d05d
Firmware Mod Kit (build-ng) 0.76 beta, (c)2011 Craig Heffner, Jeremy Collake http://www.bitsum.com 
Firmware-Mod-Kit has not been built yet. Building...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
 
--------------- SNIP ----------------
 
Extracting 983180 bytes of header image at offset 0
Extracting squashfs file system at offset 983180
Extracting squashfs files...
Firmware extraction successful!
Firmware parts can be found in 'fmk/*'

取り出せた模様。
中身はこんな感じです。
# ls
bin dev etc home htdocs lib mnt proc sbin sys tmp usr var www

よく分からないのでディレクトリ内を手当たり次第調査していると明らかに怪しい名前のテキストが見つかったので中身をチェックします。
# cd home/
# ls
dlink
# cd dlink/
# ls
key.txt
# cat key.txt
ewe know, the sh33p always preferred Linksys

このテキストに書かれた内容でCORRECT!

あとで「firmware-mod-kit」の出力結果にあったログを見て分かったのですがbin-walkというツールがあるんですね。
単体で今回の問題ファイルを食わせてみたら以下のような出力を得ました。
# binwalk for300-47106ef450c4d70ae95212b93f11d05d
DECIMAL HEX DESCRIPTION
-------------------------------------------------------------------------------------------------------
108 0x6C LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 3008436 bytes
983148 0xF006C PackImg Tag, little endian size: 14690560 bytes; big endian size: 2744320 bytes
983180 0xF008C Squashfs filesystem, little endian, version 4.0, size: 724610815 bytes, 1470 inodes, blocksize: 0 bytes, created: Sat Mar 6 20:29:04 1993

今回はファームウェアっぽいといだけで「firmware-mod-kit」を使ったわけですが、本来はこのように調査してLZMAであるなどということが分かった上で進めていくのが模範的なんでしょうかねー


Copyright 2021. All rights reserved.

Posted 2012年6月5日 by ntsuji in category "ctf