๐ Webrypto
A detailed write-up of the Web challenge 'Webrypto' from ACECTF1.0 - 2025
๐ Challenge Overview
Category Details Additional Info ๐ Event ACECTF - 2025 Event Link ๐ฐ Category Web ๐ ๐ Points 200 Out of 500 total โญ Difficulty ๐ข Easy Personal Rating: 1/10 ๐ค Author Unknown Profile ๐ฎ Solves (At the time of writeup writing) 158 solve rate ๐ Date 27-02-2025 ACECTF - 2025 ๐ฆพ Solved By mH4ck3r0n3 Team: QnQSec
๐ Challenge Information
I think we can all agree that most of us grew up watching the iconic cartoon Tom & Jerry. Every kid would feel that surge of adrenaline during the thrilling chases and chaotic conflicts between the mischievous mouse and the ever-determined cat. The excitement of those scenesโthe heart-pounding moments of escapeโsometimes felt almost real. But then, I heard a little rumor: what if all those chases were fake? What if Tom and Jerry were actually friends all along? That revelation shook me. I had no one to ask about this mind-bending twist, so I decided to take matters into my own handsโI created a web app to settle this question once and for all. I know the truth now. Do you think you can uncover it too? https://chal.acectf.tech/Webrypto/
๐ฏ Challenge Files & Infrastructure
Provided Files
1
Files: None
๐ Initial Analysis
First Steps
Initially, the website appears as follows:
We are directly shown the PHP source code of the page, which takes two
GET
parameters:tom
andjerry
. Then, a check is performed on themd5
hash generated by concatenatingACECTF . tom
andACECTF . jerry
(in PHP,.
is the concatenation operator). So, if themd5
hash generated from the concatenation ofACECTF . tom
is equal to the hash generated from the concatenation ofACECTF . jerry
, it prints the flag. However, as we can see, another check is applied first, verifying thattom
andjerry
are different. Initially, I thought of anmd5 collision
, since it is vulnerable to this type of attack, but soon after, I reconsidered and tried with aType Juggling
. Let’s not waste time and move on to the exploitation phase.
๐ฌ Vulnerability Analysis
Potential Vulnerabilities
- PHP Type Juggling
๐ฏ Solution Path
Exploitation Steps
Initial setup
Type Juggling
can be performed when there are no specific checks on the type of data being entered. Indeed, in the parameters, we can also pass anarray
by specifyingparametername[]
. This way, the data type entered is the same for both parameters,tom
andjerry
. Let’s move on to the next phase..
Exploitation
We need to send different parameter values, for example, we can send
tom=a
andjerry=b
. However, by also usingType Juggling
, the content is different, but themd5
is generated from anempty array
. Since in both cases we are passing anempty array
, themd5
generated will certainly be the same. Therefore, by sending the parameterstom[]=a
andjerry[]=b
, we will be able to get the flag. (https://chal.acectf.tech/Webrypto/?tom[]=a&jerry[]=b).
Flag capture
๐ ๏ธ Exploitation Process
Approach
The automated exploit makes a
GET
request sending the parameterstom[]=a&jerry[]=b
as already mentioned in the exploitation phase, and then extracts the flag from the response using a regex.
๐ฉ Flag Capture
Flag
Proof of Execution
๐ง Tools Used
Tool Purpose Python Exploit
๐ก Key Learnings
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
๐ References & Resources
Learning Resources
๐ Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:03 | From start to flag |
Global Ranking (At the time of writeup writing) | 5/461 | Challenge ranking |
Points Earned | 200 | Team contribution |
Created: 27-02-2025 โข Last Modified: 27-02-2025 Author: mH4ck3r0n3 โข Team: QnQSec