๐ Power Cookie
A detailed write-up of the Web challenge 'Power Cookie' from PicoCTF - 2022
๐ 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:
By clicking on
continue as a guest
, I got the following page:As the title of the challenge suggests, I decided to inspect the cookies using
ChromeDevTools
:As we can see, we have a
PHPSESSID
, which are the standard session cookies forPHP
, indicating that the user has an active session, and then we haveisAdmin
set to 0, which indicates whether the user with the active session is an admin or not. Since the value0
equalsFalse
in boolean logic, it’s highly likely that setting this value to1
will result inTrue
, thus granting admin access (privileged user).
๐ฏ Solution Path
Exploitation Steps
Initial setup
To modify the cookies, you need to open the
Application
tab in theDeveloperTools
(CTRL+SHIFT+I
), then go to theCookie
section. By double-clicking on thevalue
of the cookie, you can modify it. After making the changes, simply refresh the page withF5
, 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
๐ ๏ธ 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
๐ง 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: *