πŸ’€Dreaming

License

The following post by anthonyjsaab is licensed under CC BY 4.0arrow-up-right

0 - Introduction

Link to room: https://tryhackme.com/room/valleypearrow-up-right

This writeup walks you through a room on TryHackMe created by tryhackme and valley

1 - Scanning

1a - Ports

1ai - Discovery

β”Œβ”€β”€(kaliγ‰Ώkali)-[~]
└─$ sudo nmap -sS 10.10.37.251 -T5 -p-
[sudo] password for kali: 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-04-23 08:06 EEST
Nmap scan report for 10.10.37.251
Host is up (0.13s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE
22/tcp open  ssh
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 289.09 seconds  

1aii - Versioning and OS fingerprinting

1aiii - Checking for vulnerabilities

1b - Directory bruteforcing

1z - What we know so far

  • The target machine seems to have SSH and HTTP servers exposed, nothing else

  • Target machine does not seem to have critical vulns in either kernel or exposed services

  • The webserver has an index.html and a /app/ path. We need to examine both

2 - Exploring Pluck

/app/
/app/pluck-4.7.13/
/app/pluck-4.7.13/login.php

After trying some common password, we login with the password 'password'

admin's dashboard

3 - Foothold

If we google the version of Pluck installed on our target machine, we stumble on an authd RCE vulnerability: https://www.exploit-db.com/exploits/49909arrow-up-right

Initiating a reverse shell using the webshell we uploaded

4 - Lucien' account

Looking into the bash history of lucien, we find the following command:

Unfortunately, the above password is not the same password as his debian account's.

By inspecting various locations in the filesystem, we eventually find in /opt a script owned by lucien. It contains the account's password written as cleartext:

We found the first flag! Also, now that we have this precious password, we can SSH into the target machine and have a decent shell to continue.

5 - Death's account

In Death's home, we find a file with a name similar to another file in /opt. We are going to assume that both files do the same thing:

The above script is interesting since we can execute it using lucien's account. Also, since we do have access to the database, we can populate it with commands that initiate a reverse shell. This is possible because the script extracts data from the database and inserts them in an echo command without sanitization:

Now we need to execute getDreams.py as Death. At first, it seemed impossible. But after manually enumerating, I found this!

Using the cleartext password we uncovered, we try to login to death and succeed:

6 - Morpheus's account

Last updated