Contents

๐ŸŒ Webrypto

A detailed write-up of the Web challenge 'Webrypto' from ACECTF1.0 - 2025

/images/ACECTF1.0-2025/Webrypto/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š 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:

/images/ACECTF1.0-2025/Webrypto/site_presentation.png
Site Presentation

We are directly shown the PHP source code of the page, which takes two GET parameters: tom and jerry. Then, a check is performed on the md5 hash generated by concatenating ACECTF . tom and ACECTF . jerry (in PHP, . is the concatenation operator). So, if the md5 hash generated from the concatenation of ACECTF . tom is equal to the hash generated from the concatenation of ACECTF . jerry, it prints the flag. However, as we can see, another check is applied first, verifying that tom and jerry are different. Initially, I thought of an md5 collision, since it is vulnerable to this type of attack, but soon after, I reconsidered and tried with a Type 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 an array by specifying parametername[]. This way, the data type entered is the same for both parameters, tom and jerry. Let’s move on to the next phase..

Exploitation

We need to send different parameter values, for example, we can send tom=a and jerry=b. However, by also using Type Juggling, the content is different, but the md5 is generated from an empty array. Since in both cases we are passing an empty array, the md5 generated will certainly be the same. Therefore, by sending the parameters tom[]=a and jerry[]=b, we will be able to get the flag. (https://chal.acectf.tech/Webrypto/?tom[]=a&jerry[]=b).

Flag capture

/images/ACECTF1.0-2025/Webrypto/manual_flag.png
Manual Flag

๐Ÿ› ๏ธ Exploitation Process

Approach

The automated exploit makes a GET request sending the parameters tom[]=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

/images/ACECTF1.0-2025/Webrypto/automated_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง 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