πŸ§‘β€πŸš€Vulnversity

Learn about active recon, web app attacks and privilege escalation.

https://tryhackme.com/room/vulnversity
Room Attributes
Value

Subscription Required

False [Free]

Type

Walkthrough

Difficulty

Easy

Tags

Recon, PrivEsc, WebAppSec, Video

Task 1 - Deploy the machine

Deploy the machine

Task 2 - Reconnaissance

There are many nmap "cheatsheets" online that you can use too.

Scan the box, how many ports are open?

Reveal Flag 🚩

🚩6

What version of the squid proxy is running on the machine?

Reveal Flag 🚩

🚩3.5.12

How many ports will nmap scan if the flag -p-400 was used?

Reveal Flag 🚩

🚩400

Using the nmap flag -n what will it not resolve?

https://nmap.org/book/man-briefoptions.html
Reveal Flag 🚩

🚩dns

What is the most likely operating system this machine is running?

Reveal Flag 🚩

🚩ubuntu

What port is the web server running on?

Reveal Flag 🚩

🚩3333

Its important to ensure you are always doing your reconnaissance thoroughly before progressing. Knowing all open services (which can all be points of exploitation) is very important, don't forget that ports on a higher range might be open so always scan ports after 1000 (even if you leave scanning in the background)

Task 3 - Locating directories using GoBuster

Now lets run GoBuster with a wordlist: gobuster dir -u http://<ip>:3333 -w <word list location>

What is the directory that has an upload form page?

upload form page
Reveal Flag 🚩

🚩/internal/

Task 4 - Compromise the webserver

Try upload a few file types to the server, what common extension seems to be blocked?

Reveal Flag 🚩

🚩.php

To identify which extensions are not blocked, we're going to fuzz the upload form. To do this, we're going to use BurpSuite. If you are unsure to what BurpSuite is, or how to set it up please complete our BurpSuite room first.

Run this attack, what extension is allowed?

Reveal Flag 🚩

🚩.phtml

Upload your shell and navigate to http://<ip>:3333/internal/uploads/php-reverse-shell.phtml. You should see a connection on your netcat session

What is the name of the user who manages the webserver?

Reveal Flag 🚩

🚩bill

What is the user flag?

Reveal Flag 🚩

🚩8bd7992fbe8a6ad22a63361004cfcedb

Task 5 - Privilege Escalation

On the system, search for all SUID files. What file stands out?

Reveal Flag 🚩

🚩/bin/systemctl

Its challenge time! We have guided you through this far, are you able to exploit this system further to escalate your privileges and get the final answer? Become root and get the last flag (/root/root.txt)

https://gtfobins.github.io/gtfobins/systemctl/
https://medium.com/@klockw3rk/privilege-escalation-leveraging-misconfigured-systemctl-permissions-bc62b0b28d49

Find a directory that www-data can write to:

Create a root.service file on your attack machine:

Get the target to listen for a connection to receive and write the root.service file to /tmp:

Send the file from your attack machine to the target:

Then start a new listener to capture the root reverse shell:

Execute the payload:

Catch the root reverse shell on your attack machine:

Read the root flag:

Reveal Flag 🚩

🚩a58ff8579f0a9270368d33a9966c7fd5

Last updated