PicoCTF logon Writeup — Become Admin by Editing a Cookie

Web 2026-11-30 · picoGym · By CTFdojo · ⏱ ...
𝕏 Share
TL;DR

Log in with any username and password. The server sets a cookie admin=False; change it to True in DevTools and reload — the flag appears.

PlatformpicoGym
Verified againstthomasbui's picoCTF 2019 writeup
CategoryWeb Exploitation
DifficultyBeginner
Tools Browser DevTools curl

Challenge description

The site belongs to a company that "doesn't seem to care about security". The login works for any name except Joe, but a normal user is told there's no flag for them.

Provided: a link to a login page

Stuck? Try a hint before reading the solution

Hint 1

Any login works except Joe's — so what decides whether you see the flag?

Hint 2

Check your cookies: one of them says whether you're an admin.

Step 1 — Log in with anything

Enter any username and password (avoid Joe, which is rejected). You get in, but the page says there's no flag for you.

If a login accepts arbitrary credentials, the decision about what you can see must be made somewhere else — usually a cookie.

Step 2 — Inspect the cookies

Open DevTools (F12) → Application (Chrome) or Storage (Firefox) → Cookies. Alongside your username and password, there's one more:

admin    False

The server stores your authorization level on the client, in plain text, with no signature.

Step 3 — Flip it to True

Double-click the value, change it to True, and reload the page. The flag is shown.

From the command line, send the cookie yourself:

$ curl -b 'admin=True' http://CHALLENGE/flag
🚩 picoCTF{flag intentionally hidden}

The flag is deliberately hidden — follow the method, you've earned it. 💪

Key takeaways

Anything stored on the client can be changed by the client:

Resources

New to CTFs? Start here: beginner's guide to CTFs — what a CTF is, the categories, the tools and a step-by-step plan.

CTFdojo
CTFdojo
Community of ethical hackers writing beginner-friendly CTF writeups and guides.

Got a question or a different approach?

Discuss this writeup with the community on the CTFdojo Discord.

Join the Discord →