Invoking a Bash shell with the -x option causes each shell command to be printed before it is executed. This is especially useful for diagnosing problems with installation shell scripts.
/opt/openarenaserver is writable. We can create files in this directory.
When we create a simple file in /opt/openarenaserver and execute the program /usr/sbin/openarenaserver it says the following :
So we do not have the correct writes.
We also have a file called level05 that is found by the following command :
This file contains the following content
It looks like a cron job and according to crontab.guru our command means execute the command sh /usr/sbin/openarenaserver with the permission of flag05 every 2 minutes.
This means that each 2 minutes the script /usr/sbin/openarenaserver is getting executed.
So all we need to do is just put a shell script file that will call and save the output of the command getflag and wait for 2 minutes.
We shoud not put anything that should be saved in the /opt/openarenaserver/ directort because the contents of that directory is Deleted every 2 minutes. So we can put anything safely in the /tmp directory.
We can use the following command to create our script in /opt/openarenaserver/ :
And this will create a file called flag05 in the directort /tmp and when wee see the content of the flag05 file we get :
Password for next level
So the Password to connect to the account level06 is viuaaale9huek52boumoomioc
level05@SnowCrash:~$ cat /tmp/flag05
Check flag.Here is your token : viuaaale9huek52boumoomioc
## Create the file that will be executed
echo '/bin/getflag > /tmp/flag05' > /opt/openarenaserver/getflag05
## Get the password that was saved by the previous command
cat /tmp/flag05
Check flag.Here is your token : viuaaale9huek52boumoomioc