Find The Flag 2
~# cat Question
You have found a secret backdoor into the machine, but how do you operate it?
Could you possibly find a way to use the backdoor to find the secret password to access the machine?
You will know the flag when you find the secret password!
ssh -p 4524 -J team_o51G0@users.ncl.sg team_o51G0@172.18.178.17
0x@NSS5JvwmPRQrd9D
From the previous part, when we curl the website's robots.txt
page, we can see one page (/cgi-bin/parameterbackdoor.sh) that is disallowed. We can navigate to that page.
Sending commands to the web server
When we navigate to this page, there is this script that hints at us to run commands to the web server, which makes it very insecure.
In short, it blindly executes commands based on the User-Agent
header ⎯ It takes a command from the User-Agent
HTTP header, executes it, and returns the output as an HTTP response. We can exploit this by sending different commands and seeing what it returns us.
We can utilize the
-A
flag to specify the user agent string. In this case, the user agent string is set tols /
, which is a Unix command typically used to list directory contents.
We will get back different files of the web server.
Files on the web server
We can see two interesting files (credentials.txt & flag.txt
). Opening flag.txt
yields us nothing.
However, opening credentails.txt
gives us the flag.
Flag: flag{b@rrow-wight}
Last updated