Contents

๐ŸŒ Apriti Sesamo

A detailed write-up of the Web challenge 'Apriti Sesamo' from PicoCTF - 2025

/images/PicoCTF-2025/Web/ApritiSesamo/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š Challenge Overview

Category Details Additional Info
๐Ÿ† Event PicoCTF - 2025 Event Link
๐Ÿ”ฐ Category Web ๐ŸŒ
๐Ÿ’Ž Points 300 Out of 500 total
โญ Difficulty ๐ŸŸก Medium Personal Rating: 2/10
๐Ÿ‘ค Author Junias Bonou Profile
๐ŸŽฎ Solves (At the time of flag submission) 627 solve rate
๐Ÿ“… Date 12-03-2025 PicoCTF - 2025
๐Ÿฆพ Solved By mH4ck3r0n3 Team:

๐Ÿ“ Challenge Information

I found a web app that claims to be impossible to hack! Try it here!

๐ŸŽฏ Challenge Files & Infrastructure

Provided Files

1
Files: None

๐Ÿ” Initial Analysis

First Steps

Initially, the website appears as follows:

/images/PicoCTF-2025/Web/ApritiSesamo/site_presentation.png
Site Presentation

Clicking on the Login button, I was redirected to the following page:

/images/PicoCTF-2025/Web/ApritiSesamo/login.png
Login

Inspecting the page source, I didn’t find anything interesting, so I decided to inspect the request using burpsuite:

/images/PicoCTF-2025/Web/ApritiSesamo/burp.png
BurpSuite

Since there’s not much information provided here, I considered a possible bypass with a PHP Type Confusion. Let’s move on to the exploitation phase.

๐Ÿ”ฌ Vulnerability Analysis

Potential Vulnerabilities

  • PHP Type Confusion
  • PHP Type Juggling

๐ŸŽฏ Solution Path

Exploitation Steps

Initial setup

In PHP, when using the weak comparison operator (==), the values being compared are type-converted before the comparison (which doesn’t happen with ===). By sending a data type different from the one used for comparison, you can trigger strange behaviors that result in a True comparison, allowing you to bypass restrictions.

Exploitation

The exploitation is quite simple. Instead of sending a string (as shown in the BurpSuite screenshot), I sent an array in this way: username[]=&pwd[]=a, for example. Once the comparison is made and type juggling occurs, I achieved the bypass and, consequently, obtained the flag.

Flag capture

/images/PicoCTF-2025/Web/ApritiSesamo/manual_flag.png
Manual Flag

๐Ÿ› ๏ธ Exploitation Process

Approach

The automatic exploit sends a POST request with the parameters username[]=&pwd[]=a to leverage the type confusion and extracts the flag from the response using a regex.

๐Ÿšฉ Flag Capture

Flag

picoCTF{w3Ll_d3sErV3d_Ch4mp_b88bdb32}

Proof of Execution

/images/PicoCTF-2025/Web/ApritiSesamo/automated_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง Tools Used

Tool Purpose
Python Exploit

๐Ÿ’ก Key Learnings

Time Optimization

  • When there are if statements with comparisons (==) of manipulable parameters, always try to bypass them using type confusion.

Skills Improved

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

๐Ÿ“š References & Resources

Similar Challenges

Learning Resources


๐Ÿ“Š Final Statistics

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

Created: 12-03-2025 โ€ข Last Modified: 12-03-2025 *Author: mH4ck3r0n3 โ€ข Team: *