Contents

๐ŸŒ Who Are You?

A detailed write-up of the Web challenge 'Who Are You?' from PicoCTF - 2021

/images/PicoGym/PicoCTF-2021/WhoAreYou/challenge_presentation.png
Challenge Presentation

๐Ÿ“Š Challenge Overview

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

๐Ÿ“ Challenge Information

Let me in. Let me iiiiiiinnnnnnnnnnnnnnnnnnnn http://mercury.picoctf.net:36622/

๐ŸŽฏ Challenge Files & Infrastructure

Provided Files

1
Files: None

๐Ÿ” Initial Analysis

First Steps

Initially, the website appears as follows:

/images/PicoGym/PicoCTF-2021/WhoAreYou/site_presentation.png
Site Presentation

We are told that the page is only accessible via PicoBrowser. When making an HTTP request, the header field that defines which “browser” we are using is the User-Agent. So, I opened the site with BurpSuite and sent the request to the Repeater:

/images/PicoGym/PicoCTF-2021/WhoAreYou/repeater.png
Repeater

From the repeater, I modified it by adding the suggested User-Agent: PicoBrowser, and I was able to move on to the next step:

/images/PicoGym/PicoCTF-2021/WhoAreYou/picoBrowser.png
User-Agent

As we can see, the message has changed. Now it tells us that it doesn’t trust users coming from another site. I think this challenge will be mainly about modifying and adding fields to the request header, so let’s proceed with the exploitation.

๐ŸŽฏ Solution Path

Exploitation Steps

Exploitation

After a few searches to bypass the second check, I found the Referer header. The HTTP Referer header contains the absolute or partial address from which a resource has been requested. By setting it as Referer: mercury.picoctf.net:36622, the server believes the request is coming from the server itself, allowing me to pass this check as well:

/images/PicoGym/PicoCTF-2021/WhoAreYou/referer.png
Referer

Now we are told that this site only worked in 2018. We can bypass this check by setting the Date field to 2018, i.e., Date: 2018:

/images/PicoGym/PicoCTF-2021/WhoAreYou/date.png
Date

The next check is about tracking. After some searching, I found the DNT (Do Not Track) field, which specifies tracking preferences. By setting DNT: null, I was able to bypass this check:

/images/PicoGym/PicoCTF-2021/WhoAreYou/dnt.png
DNT

Next, we are told that the website is only for people from Sweden. This check can be bypassed by setting X-Forwarded-For to an IP address from Sweden. I did some research and found this: https://lite.ip2location.com/sweden-ip-address-ranges. However, there are other methods. One that came to mind was finding a website with the .se top-level domain, which indicates a Swedish site. Then, using tools like dig, ping, nslookup, etc., I found the IP associated with the domain and used it in the request:

/images/PicoGym/PicoCTF-2021/WhoAreYou/xforwarded.png
X-Forwarded-For

As the last check, we are told that we donโ€™t speak Swedish. This can be bypassed by setting the Accept-Language: sv,... field, as sv specifies the Swedish language. By modifying the field and sending the request, I passed the final check and obtained the flag.

Flag capture

/images/PicoGym/PicoCTF-2021/WhoAreYou/manual_flag.png
Manual Flag

๐Ÿ› ๏ธ Exploitation Process

Approach

The automatic exploit replicates the request made manually, setting the headers shown in the image above using BurpSuite. Once the request is made, it extracts the flag from the response using a regex.

๐Ÿšฉ Flag Capture

Flag

Proof of Execution

/images/PicoGym/PicoCTF-2021/WhoAreYou/automated_flag.png
Automated Flag
Screenshot of successful exploitation

๐Ÿ”ง Tools Used

Tool Purpose
Python Exploit
Burp Suite Web Testing

๐Ÿ’ก Key Learnings

New Knowledge

Ho imparato cos’รจ un DNT.

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:05 From start to flag
Global Ranking (At the time of flag submission) Challenge ranking
Points Earned 500 Team contribution

Created: 19-02-2025 โ€ข Last Modified: 19-02-2025 *Author: mH4ck3r0n3 โ€ข Team: *