Contents

๐ŸŒ Power Cookie

A detailed write-up of the Web challenge 'Power Cookie' from PicoCTF - 2022

/images/PicoGym/PicoCTF-2022/PowerCookie/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š Challenge Overview

Category Details Additional Info
๐Ÿ† Event PicoGym Event Link
๐Ÿ”ฐ Category Web ๐ŸŒ
๐Ÿ’Ž Points Out of 500 total
โญ Difficulty ๐ŸŸก Medium Personal Rating: 0/10
๐Ÿ‘ค Author LT ‘syreal’ Jones Profile
๐ŸŽฎ Solves (At the time of flag submission) 28.440 solve rate
๐Ÿ“… Date 13-02-2025 PicoGym
๐Ÿฆพ Solved By mH4ck3r0n3 Team:

๐Ÿ“ Challenge Information

Can you get the flag?

๐ŸŽฏ Challenge Files & Infrastructure

Provided Files

1
Files: None

๐Ÿ” Initial Analysis

First Steps

Initially, the website appears as follows:

/images/PicoGym/PicoCTF-2022/PowerCookie/site_presentation.png
Site Presentation

By clicking on continue as a guest, I got the following page:

/images/PicoGym/PicoCTF-2022/PowerCookie/guest_home.png
Guest Home

As the title of the challenge suggests, I decided to inspect the cookies using ChromeDevTools:

/images/PicoGym/PicoCTF-2022/PowerCookie/cookies.png
Cookies

As we can see, we have a PHPSESSID, which are the standard session cookies for PHP, indicating that the user has an active session, and then we have isAdmin set to 0, which indicates whether the user with the active session is an admin or not. Since the value 0 equals False in boolean logic, it’s highly likely that setting this value to 1 will result in True, thus granting admin access (privileged user).

๐ŸŽฏ Solution Path

Exploitation Steps

Initial setup

To modify the cookies, you need to open the Application tab in the DeveloperTools (CTRL+SHIFT+I), then go to the Cookie section. By double-clicking on the value of the cookie, you can modify it. After making the changes, simply refresh the page with F5, and the new cookies will be automatically applied.

Exploitation

I simply followed the procedure I just described, setting isAdmin=1, and after refreshing the page, I obtained the flag.

Flag capture

/images/PicoGym/PicoCTF-2022/PowerCookie/manual_flag.png
Manual Flag

๐Ÿ› ๏ธ Exploitation Process

Approach

L’exploit automatico fa una richiesta GET (con una sessione) alla pagina per estrapolare i cookies, dopodichรจ il modifica settando isAdmin=1 e fa un ulteriore richiesta GET per estrarre la flag dalla risposta tramite una regex.

๐Ÿšฉ Flag Capture

Flag

Proof of Execution

/images/PicoGym/PicoCTF-2022/PowerCookie/automated_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง Tools Used

Tool Purpose
Python Exploit
ChromeDevTools Web Testing

๐Ÿ’ก Key Learnings

Skills Improved

  • Binary Exploitation
  • Reverse Engineering
  • Web Exploitation
  • Cryptography
  • Forensics
  • OSINT
  • Miscellaneous

๐Ÿ“Š Final Statistics

Metric Value Notes
Time to Solve 00:00 From start to flag
Global Ranking (At the time of flag submission) Challenge ranking
Points Earned Team contribution

Created: 13-02-2025 โ€ข Last Modified: 13-02-2025 *Author: mH4ck3r0n3 โ€ข Team: *