LoginSignup
1
0

More than 1 year has passed since last update.

nazotokiCTF 2022 Writeup

Last updated at Posted at 2022-07-18

はじめに

2022年7月17日~18日にかけて開催された#nazotokiCTFに参加したので、備忘録もかねてWriteupを書きました。
初めての記事なので、細かいミスには目をつぶっていただけると幸いです。
とりあえずWeb問のみ書きましたが、時間があればほかの問題についても追記するかもしれないです。

Web

ふたご座

<form action="check.php" method="get">
                    <div class="input-group">
                      <input class="form-control" type="input" name="dummyPassword" placeholder="Dummy Password">
                      <input type="hidden" name="realPassword" value="dummyPassword">
                      <span class="input-group-btn"><input class="btn btn--primary btn--rounded" type="submit" value="SUBMIT"></span>
                    </div>
                  </form>

パスワード入力部分のソースコードを見てみると、入力チェックがあるみたい。
コマンドラインでHTTPリクエストを送れるツールcurlを使ってみる。

$ curl -L "https://gemini.ctf.nazotoki.tech/check.php?realPassword=dioskouroi"
<!DOCTYPE html>
<html lang="Ja">
  <head>
    <!-- Document Meta-->
    <meta charset="utf-8"/>
    <!--  Fonts-->
    <link href="http://fonts.googleapis.com/css?family=Ubuntu:300,300i,400,400i,500,500i,700,700ii%7CMerriweather:300,300i,400,400i,700,700i,900,900i" rel="stylesheet" type="text/css"/>
    <!-- Stylesheets-->
    <link href="assets/css/vendor.min.css" rel="stylesheet"/>
    <link href="assets/css/style.css" rel="stylesheet"/>
    <!--
    Document Title
    =============================================
    -->
    <title>Gemini</title>
  </head>
  <body>
    <!--
    Document Wrapper
    =============================================
    -->
    <div class="wrapper clearfix" id="wrapper">

      <section class="hero bg-dark" id="hero">
        <div class="hero-content bg-dark">
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-6 offset-md-3 pt-100">
                <div class="hero-headline">Congratulations</div>
                <div class="hero-bio">
                  <div style="padding-bottom: 2rem;">? < 解いてくれてありがとう!フラグをどうぞ!</div>
                  <div style="padding-bottom: 2rem;">nazotokiCTF{<code>ナイーブ</code>}</div>
              </div>
            </div>
            <!-- End .row -->
          </div>
          <!-- End .container -->
        </div>
        <!-- End .hero-content -->
      </section>
      <!-- End #hero  -->
  </body>
</html>

nazotokiCTF{ナイーブ}

てんびん座

URLにアクセスすると下記のような画面が出てくる。
image.png
ブラウザで判定しているとのことなので、User-Agentがあやしい。
試しにcurlUser-Agentを偽造してみる。

$ curl -H "User-Agent: stardustChrome"  "https://libra.ctf.nazotoki.tech/"                                                                                                                                                   130 ?
<!DOCTYPE html>
<html lang="Ja">
  <head>
    <!-- Document Meta-->
    <meta charset="utf-8"/>
    <!-- Stylesheets-->
    <link href="assets/css/vendor.min.css" rel="stylesheet"/>
    <link href="assets/css/style.css" rel="stylesheet"/>
    <!--
    Document Title
    =============================================
    -->
    <title>Libra</title>
  </head>
  <body class="bg-gray">
  <section id="libra">
        <div class="container">
          <div class="row clearfix">
            <div class="col-12 col-md-12 offset-md-1 col-lg-8 offset-lg-1">
            <h2 class="heading--title">Libra</h2>
            <h6>リクエストヘッダー情報</h6>
            <p>
                フラグは<code>stardustChrome</code>という特殊なブラウザでしか閲覧できません。
            </p>
            <p>
                X-Forwarded-For:153.231.59.102<br>X-Forwarded-Proto:https<br>X-Forwarded-Port:443<br>Host:libra.ctf.nazotoki.tech<br>X-Amzn-Trace-Id:Root=1-62d42bdc-19ab66e11e312d32017d44d7<br>accept:*/*<br><br />確かにstardustChromeを使ってるね。フラグをどうぞ! <br />nazotokiCTF{<code>クローン</code>} <br />
            </p>
            <a href="/" onclick="window.location.reload();">再読み込み</a>D
            </div>
          </div>
        </div>
      </section>
  </body>
</html>

nazotokiCTF{クローン}
いけた。

みずがめ座

URLにアクセスすると下記のような画面が出てくる。

image.png

SQLインジェクションっぽかったので、とりあえず入力してみる。
image.png

image.png

違うみたい。
んーーわからん。(早い)

1つ目のヒントを見てみると、

image.png
とのこと。

そういえばアイちゃんの社員番号が載ってたような。。。
ということで社員番号を99、パスワードをpasswordとして入力してみる。

image.png

出てきた。
なになに、、「フラグのヒントはナンバー9999に載せておいたよ!」ですって。
社員番号を9999、パスワードはわからないので先ほどのSQLインジェクションを試してみる。

image.png

アイちゃんの情報の下に、新たなレコードが出現。
nazotokiCTF{この候補者の苗字}
とのことなので、答えは
nazotokiCTF{タカハシ}

おわりに

他のCTFとは一風変わった問題で非常に楽しめました!
次回開催時も参加したいと思います。

1
0
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
1
0