Sun, May 09, 2021 2:09 AM
CTF
web
api
tokens
sdctf-2021
Opening up the website, the page shows two messages about Frontend and Backend Servers. It says, the FrontEnd is not active, but the Backend server is working fine.
There must be some sort of API which the website must be using as refered in the challenge description
Checking out the network tab in firefox dev tools, reveals the Backend API route
This route gives the following response
Wait!! We got the API, but what's the verbose parameter in the URL?
May be it generates verbose response!. Trying ?verbose=1, yeilds the following response
Cool!! It revealed some other API paths. Rocket launching and fuel? The path /rocketLaunch is more interesting according to the challenge description
Let's try sending some requests using python.
Sending a get request using python -
Oh, it accepts JSON data. Let's try a post request with empty data
rocket?? May be its a key in the json data. Let's provide a random rocket.
Oh, it accepts triton as a rocket.
And providing a random launch time -
Okay !
Cool, we got a break to think here. What would be the launch time? I tried looking in the other API paths. Tried 13:37 from challenge name, but nothing really worked. But then i decided to Brute force
There are 24 hours and 60 minutes. So we get the min time to be 00:00 while the maximum time of 23:59. So the possiblities are few being 24x60=1440
So i used a small python script!
Cool! We have the correct time now.
Oh my bad! The description tells that the rocket was scheduled at noon today. So we can perfectly use the time 12:00, instead of brute forcing. Anyway…
So going further -
Remember the fuel path /api/fuel?
We got some fuels to try out!! I tried all the five fuels. Fourth one is working.
Oh shit! Authorization? Where do I get the token? But it's saying frontend authorization. May be, trying out to seach some JS files is a great idea.
As i thought, I found a token in JS a file.
For some reason, the token
was case-sensitive. But is was spelled Token
in JS
So finally, providing the token in the json -
Yayy!! The rocket got launched. We have the flag.
sdctf{0ne_sM@lL_sT3p_f0R_h@ck3r$}
Happy Hacking!
This was an easy challenge. I did elobarate the solution in order to make it more detailed. This might help the players who have not played the CTF.