はじめに
- せっかくCTF始めたのでWrite upを残しておく
Q1. [Misc] Test Problem
- テスト
- 与えられたFlagを打ち込むだけ
Q6. [Crypto] Classical Cipher
- シーザー暗号で3文字なのでプログラム書いた
Caesar.py
def Caesar(s, n):
flag = ''
for c in s:
if 65 <= ord(c) <= 90:
flag += chr(65 + (ord(c) + n - 65) % 26)
elif 97 <= ord(c) <= 122:
flag += chr(97 + (ord(c) + n - 97) % 26)
else:
flag += c
return flag
Q7. [Reversing] Can you execute ?
- ファイルの種類を調べて適切なOSで実行するらしい
-
file
コマンドでファイルの種類を調べることができる
fileコマンド
$ file exec_me
exec_me: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.24, BuildID[sha1]=663a3e0e5a079fddd0de92474688cd6812d3b550, not stripped
- Ubuntuで以下を実行
$ chmod 777 exec_me
$ ./exec_me
cpaw{Do_you_know_ELF_file?}
Q8. [Misc] Can you open this file ?
- ファイルを開きたいがどのような種類かわからないので種類を特定してどのアプリケーションで開くか調べる
- Q7と同様
file
コマンドを使うと以下のようにWordファイルであることがわかる
open_me: Composite Document File V2 Document, Little Endian, Os: Windows, Version 10.0, Code page: 932, Author: �v��, Template: Normal.dotm, Last Saved By: �v��, Revision Number: 1, Name of Creating Application: Microsoft Office Word, Total Editing Time: 28:00, Create Time/Date: Mon Oct 12 04:27:00 2015, Last Saved Time/Date: Mon Oct 12 04:55:00 2015, Number of Pages: 1, Number of Words: 3, Number of Characters: 23, Security: 0
-
open_me.doc
と名前を変更してWordで開けばFlagをゲットできる
Q9. [Web] HTML Page
- Capture The Flagへ飛んでdeveloper toolsを使ってHTMLファイル内でcpawを検索すると出てくる
cpaw{9216ddf84851f15a46662eb04759d2bebacac666}
Q10. [Forensics] River
- JPEGでは撮影時の日時、使われたカメラ、位置情報など様々な情報(Exif情報)が付加される事がある
- この情報から写真に写っている川の名前を特定
-
exiftool
を使うと確認できるらしい
$ brew install exiftool
$ exiftool river.jpg
...
GPS Latitude : 31 deg 35' 2.76" N
GPS Longitude : 130 deg 32' 51.73" E
Date/Time Created : 2015:09:14 12:50:38
Digital Creation Date/Time : 2015:09:14 12:50:38
Focal Length : 4.6 mm
GPS Position : 31 deg 35' 2.76" N, 130 deg 32' 51.73" E
...
- Google Mapで
31°35'2.76"N,130°32'51.73"E
を検索すると「甲突川」と出てくる - Flagは
cpaw{koutsukigawa}
Q11. [Network] pcap
- pcapファイルを開いてネットワークに触れてみよう
- Wireshark · Go Deep.というのがネットワークプロトコル解析に使われるらしい
- 上記ツール使ってファイルを開いたら
cpaw{gochi_usa_kami}
というFlagが - CLIで
tshark
というのも使える
$ tshark -V -r network10.pcap
- これでは答えは得られなかった
Q12. [Crypto] HashHashHash!
- SHA1によるハッシュ値を元に戻す
- ハッシュ値 ->
e4c6bced9edff99746401bd077afa92860f83de3
-
レインボーテーブルというのがあるらしい
- 基本的にはこのハッシュだったら平文はこれ、というテーブルを事前に用意しておく手法
- が、これをそのままやるとデータ量が膨大になってしまうため、以下のような処理をする
- レインボーテーブル – パスワード流出への対策を根本から理解する。 | DevelopersIO
というのを調べたりしていたがこんなサイトが -> SHA-1 conversion and SHA-1 reverse lookup
ここに先ほどのSHA1のハッシュ値を入力すると
Shal
と出てくるのでcpaw{Shal}
Q14. [PPC] 並べ変えろ!
[15,1,93,52,66,31,87,0,42,77,46,24,99,10,19,36,27,4,58,76,2,81,50,102,33,94,20,14,80,82,49,41,12,143,121,7,111,100,60,55,108,34,150,103,109,130,25,54,57,159,136,110,3,167,119,72,18,151,105,171,160,144,85,201,193,188,190,146,210,211,63,207]
- を並べ替えるだけ