🌐 Client-Side-Again
A detailed write-up of the Web challenge 'Client-Side-Again' from PicoCTF - 2019
📊 Challenge Overview
Category Details Additional Info 🏆 Event PicoGym Event Link 🔰 Category Web 🌐 💎 Points 500 Out of 500 total ⭐ Difficulty 🟡 Medium Personal Rating: 0/10 👤 Author Danny Profile 🎮 Solves (At the time of flag submission) 20.558 solve rate 📅 Date 21-02-2025 PicoGym 🦾 Solved By mH4ck3r0n3 Team:
📝 Challenge Information
Can you break into this super secure portal? https://jupiter.challenges.picoctf.org/problem/56816/ (link) or http://jupiter.challenges.picoctf.org:56816
🎯 Challenge Files & Infrastructure
Provided Files
1
Files: None
🔍 Initial Analysis
First Steps
Initially, the website appears as follows:
This challenge is the version 2 of the dont-use-client-side challenge. So the first thing I did was inspect the page source:
As we can see, it contains an obfuscated
js
script. I used https://unminify.com/ to format the code:From the cleaner code, we can see that the list
_0x5a46
contains the plaintext, so the flag is easily deducible. In fact, there aren’t many combinations, and with a bit of intuition, you can reconstruct it directly. However, just for fun, I performed a full reverse of what the code does to arrive at the construction of the flag.
🎯 Solution Path
Exploitation Steps
Initial setup
I wrote a script that “reverses” the obfuscation and verification logic of the JavaScript code, reconstructing the flag step by step and verifying that it satisfies all the conditions imposed by the JS code.
Exploitation
The script starts with the original array and rotates it 5 times (since 435 modulo 10 = 5). Then, it defines the function
_0x4b5b
, which maps hexadecimal indices (e.g.,"0x3"
) to the corresponding element in the rotated array. Using the_0x4b5b
function, the script retrieves the segments used in the JavaScript check:
"picoCTF{"
(from"0x3"
)"not_this"
(from"0x4"
)"_again_3"
(from"0x6"
)"37115}"
(from"0x5"
)"this"
(from"0x7"
)The script creates a placeholder list for a 30-character flag and fills it according to the substring conditions from the JavaScript code (including overlapping parts like
"F{not"
and literal characters"oCT"
,"{n"
). This process simulates the reversal of the control logic. In the end, the script checks if the candidate string meets every condition set by the JS code. If all conditions are satisfied, the flag is returned. For verification, I directly used thejs
function from the website to check the final correctness of the flag.
Flag capture
🛠️ Exploitation Process
Approach
The automatic exploit does exactly the procedure described above.
🚩 Flag Capture
Flag
Proof of Execution
🔧 Tools Used
Tool Purpose Python Exploit Unminify Code Formatting
💡 Key Learnings
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
📚 References & Resources
Similar Challenges
📊 Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:02 | From start to flag |
Global Ranking (At the time of flag submission) | Challenge ranking | |
Points Earned | 500 | Team contribution |
Created: 21-02-2025 • Last Modified: 21-02-2025 *Author: mH4ck3r0n3 • Team: *