PicoCTF Logon Walkthrough

March 23 2024 - 1 Minute
-

The Logon entry in the PicoGym
The Logon entry in PicoGym

Hello! I am going to walkthrough the "Logon" challenge in PicoCTF.
I did not misspell it, it is "Logon" not "Login" like the last challenge I did on this blog.

Lets get started!

Introduction

The only thing on the website that we are given is a simple login form for the "factory".

The login form for the website

Entering seemingly anything to the login form gets you to this page.

The screen you get when you "login"

I can't find anything interesting on this page, so I decided to look at the cookies.
And there is a very intresting cookie called "admin" with a value of False.

Cookies on the website

Changing this to true and reloading the page, brings us a very recognizable string.

Flag on the site

It worked! We have the flag! Lets talk about how to mitigate this issue

Mitigation

The simplest thing to do is not store anything like if the user is an admin or not in the clients cookies.

This is because they can be modified, if you need to store like a token, that is fine.

Instead of putting this stuff into the user's cookies, put them in the database, or just serverside, JUST NOT IN THE COOKIES!

Thank you for reading this blog post, I hope you have a nice day!

(How are we almost on blog post 10?? and why did I write 3 of them during a robotics competition?)