TUCTF 2019 Writeup
Contents
(2019/12/25 - 復習しました)
URL: https://tuctf.com/
もうサイトにアクセスできないようなので、最終順位がわかりません。
以下、チャレンジ一覧と解いた問題です。
[Misc]: Onions
Challenge
Ogres are like files – they have layers!
Attachment:
- shrek.jpg
Solution
シュレックのJPEG画像です。著作権は大丈夫なんでしょうか。
foremostではなにも取れなかったので、binwalkから始めます。
binwalk -e でもextractされなかったので、–ddを使いました。
$ binwalk -e shrek.jpg DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 JPEG image data, JFIF standard 1.01 275566 0x4346E 7-zip archive data, version 0.4 $ binwalk --dd='.*' shrek.jpg DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 JPEG image data, JFIF standard 1.01 275566 0x4346E 7-zip archive data, version 0.4 $ cd _shrek.jpg.extracted/ $ file 0 0: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, comment: "CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality", baseline, precision 8, 2048x1234, frames 3 $ file 4346E 4346E: 7-zip archive data, version 0.4 $ 7z x 4346E 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz (306A9),ASM,AES-NI) Scanning the drive for archives: 1 file, 538 bytes (1 KiB) Extracting archive: 4346E -- Path = 4346E Type = 7z Physical Size = 538 Headers Size = 130 Method = LZMA2:12 Solid = - Blocks = 1 Everything is Ok Size: 428 Compressed: 538 $ tar zxvf flag.tar.gz flag.cpio $ cpio -idv < flag.cpio flag.lzma 1 block $ unlzma flag.lzma $ file flag flag: current ar archive $ ar -x flag $ file flag1.txt flag1.txt: bzip2 compressed data, block size = 900k $ bunzip2 -d flag1.txt bunzip2: Can't guess original name for flag1.txt -- using flag1.txt.out $ file flag1.txt.out flag1.txt.out: XZ compressed data $ xz -dv flag1.txt.out flag1.txt.out (1/1) xz: flag1.txt.out: Filename has an unknown suffix, skipping $ mv flag1.txt.out flag1.xz $ xz -dv flag1.xz flag1.xz (1/1) 100 % 96 B / 40 B = 2.400 $ file flag1 flag1: ASCII text $ cat flag1 TUCTF{F1L3S4R3L1K30N10NSTH3YH4V3L4Y3RS}
Flag: `TUCTF{F1L3S4R3L1K30N10NSTH3YH4V3L4Y3RS}`
[Misc]: Super Secret
Challenge
Something’s blocking my flag from this file…
Attachment:
- document.odt
Solution
$ file document.odt document.odt: OpenDocument Text
使っている Windows PC に OpenOffice がインストール済みだったので、マクロを無効な状態で開いてみました。
マクロの中身は以下で確認できました。
OpenOffice > ツール > マクロ > マクロの管理 > OpenOffice.org Basic > 編集
REM ***** BASIC ***** Sub Main TUCTF{ST0P_TRUST1NG_M4CR0S_FR0M_4N_UNKN0WN_S0URC3} End Sub
Flag: `TUCTF{ST0P_TRUST1NG_M4CR0S_FR0M_4N_UNKN0WN_S0URC3}`
[Misc]: RNGeesus
Challenge
RNGeesus has a secret technique, can you guess it?
nc chal.tuctf.com 30300
Solution
まずは繋げてみます。2回繋げて、毎回同じ問題であることを確認しました。
また、適当に答えを入れると、ググれ!というヒントがもらえました。
$ nc chal.tuctf.com 30300 Good afternoon, my children... I've overheard the prayers to RNGeesus, but he's got a terrible secret... He's just using rand() calls on his new Mac! If you can guess his next number, I'll even give you a flag. You ready to guess his next move? Here's his current random number. RNGesus gives the following number: 520932930 $ nc chal.tuctf.com 30300 Good afternoon, my children... I've overheard the prayers to RNGeesus, but he's got a terrible secret... He's just using rand() calls on his new Mac! If you can guess his next number, I'll even give you a flag. You ready to guess his next move? Here's his current random number. RNGesus gives the following number: 520932930 520932931 Easy! Alright, what's his next move? Hmm, that wasn't right. Try some more searching. There's source code out there somewhere! Better luck next time...
“520932930"でググると、いくつかサイトがヒットしました。
シード値(0)でrand()を実行した際の最初の結果が"520932930"で、次は"28925691"のようです。
Flag: `TUCTF{D0NT_1NS3CUR3LY_S33D_Y0UR_LCGS}`
[Mega]: Cup of Joe: The Server
Challenge
On the first leg of the journey, I was looking at all the life, there were plants and hills and rocks and things, there was java and mugs and caffeine.
chal.tuctf.com:32000
Solution
上記のウェブサイトにアクセスすると、以下にリダイレクトされます。
http://chal.tuctf.com:32000/coffeepot?
ソースを見てみます。 ```html
I'm Craving Some Coffee
You know that feeling when you just want something from a website and you haven't gotten it yet? Well look no further. At TUCTF, we have a problem we request you solve: we want coffee.
But don't worry. Don't get fooled by those crazy tea loving children! Soon enough you will prove to us you can get coffee -- and a flag.
Author CaptureAmerica @ CTF フラxxグゲット
LastMod 2019-12-25