๐ Who Are You?
A detailed write-up of the Web challenge 'Who Are You?' from PicoCTF - 2021
๐ 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:
We are told that the page is only accessible via
PicoBrowser
. When making anHTTP
request, the header field that defines which “browser” we are using is theUser-Agent
. So, I opened the site withBurpSuite
and sent the request to theRepeater
:From the repeater, I modified it by adding the suggested
User-Agent: PicoBrowser
, and I was able to move on to the next step: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 HTTPReferer
header contains the absolute or partial address from which a resource has been requested. By setting it asReferer: mercury.picoctf.net:36622
, the server believes the request is coming from the server itself, allowing me to pass this check as well: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
:The next check is about tracking. After some searching, I found the
DNT
(Do Not Track) field, which specifies tracking preferences. By settingDNT: null
, I was able to bypass this check: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 likedig
,ping
,nslookup
, etc., I found the IP associated with the domain and used it in the request:As the last check, we are told that we donโt speak Swedish. This can be bypassed by setting the
Accept-Language: sv,...
field, assv
specifies the Swedish language. By modifying the field and sending the request, I passed the final check and obtained the flag.
Flag capture
๐ ๏ธ 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
๐ง 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
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language
๐ 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: *