Cybertalents – threat con ctf 2019 – online now writeup

threat con ctf 2019

So this one was 200 points hard challenge. I guess only one guy was able to do it. I was a little bit disappointed that I was not able to do it on time. Anyway here is the writeup.

Let us begin with the URL, the URL for the challenge was which is as below

online now home page

It just outputs some info about us ie IP address and USER-AGENT

Looking at this page source code reveals a cache file called cache.php

onlinenow source – cache.php

Browsing the URL shows a white blank page. Nothing here.

But if we remove cache.php and just browse, it lists the directory.

directory listing

Cool! from here we can download .src files which are the source code for start.php and cache.php.

After downloading them we can view the source code.



I will discuss the code later. Furthermore, I did run gobuster to see if there are any folders I am missing. I find /cache folder. Later, I ran gobuster again which reveals more folders.

When we visit the folder one by one ie and, it just output greets us as below

Hello Admin
Hello Visitor

That’s all I found about the challenge.

Now, back to code. Looking into the source code, we can say that it is all about PHP Object Injection (Look at Example2). In our case, we need to trick the program by using a COOKIE. I do not want to discuss all the technical part in detail here but what we actually want to do is tell the program that we are user admin and want to view the source code of flag.php file.

I have created a PAYLOAD to send in COOKIE for this to work and disclose the flag. We need to send following in our COOKIE user_info. I have used burp suite to intercept the request and send it.

O:5 => the character length of the class cache
s:10:”cachedFile” => string, length of “cachedFile”
and so on.

If you like to read more then you can go here.

Now, urlencode the PAYLOAD using ctrl+U and send the GET request to

request with payload

The response from server will include another COOKIE called PHPSESSID

response with PHPSESSID

Now, copy the PHPSESSID into our COOKIE user_info and send another GET request.

another request

If everything is good then you will see the flag.

cybertalent onlinenow flag

The flag is !amTh3Adm!nFlag$$


Leave a Reply

Your email address will not be published. Required fields are marked *