LoginSignup
3
2

More than 3 years have passed since last update.

[Writeup] CpawCTF - Level1

Last updated at Posted at 2019-08-19

はじめに

  • せっかく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

$ tshark -V -r network10.pcap
  • これでは答えは得られなかった

Q12. [Crypto] HashHashHash!

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]
  • を並べ替えるだけ
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2