AlpacaHack Logo

SECCON CTF 13 決勝観戦CTF

CTF is over!
Sign InSign Up
TopChallengesScoreboardWriteups
Beginner & Welcome

Welcome!
100 pts (167 solves)

Author:

minaminao

🍪

100 pts (139 solves)
Beginner
Web

Author:

minaminao

ある条件を満たすとフラグが得られるようです

import Fastify from "fastify";
import fastifyCookie from "@fastify/cookie";

const fastify = Fastify();
fastify.register(fastifyCookie);

fastify.get("/", async (req, reply) => {
  reply.setCookie('admin', 'false', { path: '/', httpOnly: true });
  if (req.cookies.admin === "true")
    reply.header("X-Flag", process.env.FLAG);
  return "can you get the flag?";
});

fastify.listen({ port: process.env.PORT, host: "0.0.0.0" });

*完全なソースコードは以下からダウンロード可能です。

cookie.tar.gz
descriptionsolveswriteups