Don't Touch My Flag
I found a flag on a server, though access seems to be protected by a secret. Being generous, I decided to share the flag with you through my proxy server. Oh, the censoring? Sorry about that, I'll remove it after this CTF is over. http://chals.ctf.sg:40101 http://chals.ctf.sg:40102 author: JustinOng
This challenge consists of two servers - a proxy and a backend.
Let's take a look at how the proxy makes the request to the backend. The secret token is added to the cookies, and a user-controlled uri
is joined to the backend URL using urllib.parse.urljoin
.
But urljoin
doesn't fare well when presented with a malformed path.
This allows us to get the proxy to make a request to our own server:
In the received request, we get the secret cookie.
Now we can send a request directly to the backend, which checks our secret before giving us the flag!
The flag is CTFSG{d0nT_toUcH_mY_c00k13s}
Last updated
Was this helpful?