πŸ’”Flatline - CTF Write-Up - TryHackMe

How high are your morals?

Security
RCE (Remote Code Execution)
Exploitation
Windows
Broken Permissions

TryHackMe | Flatline

Let’s add the target IP in the host file: /etc/host

This machine takes up some time to boot up, be patient, it took me around 20 mins to figure out it won’t respond to ping.

Enumeration

β€œI will hunt you down”

Let’s first start scanning the machine with Nmap first, since it does not respond to ping, we will not use traditional flags for nmap, instead, we shall use TCP scans.

It's intriguing that there are only a few open ports, and they seem to have tight restrictions on their functionality. One of these ports is 3389, where 'ms-bt-server' is running. A simple Google search for 'ms-bt-server' yields a helpful Nmap command that can be employed to assess its potential exploitability.

3389 - Pentesting RDP

It performs checks for available encryption, potential DoS vulnerabilities (without causing a DoS), and gathers NTLM Windows information, including versions.

Regarding the RDP service, the password spraying method could be an option, but we lack both a username and password in this lab environment. Caution should be exercised, as using the password spraying method in real-life scenarios without proper credentials can lead to blockages.

Instead, let's explore the FreeSWITCH service running on port 8021. FreeSWITCH is a free and open-source server software designed for real-time communication applications like WebRTC, video, and Voice over Internet Protocol (VoIP). It's versatile, compatible with Linux, Windows, macOS, and FreeBSD.

Weaponization

β€œLock and Load”

A quick search in the msfconsole regarding FreeSWITCH led to some intriguing findings. If you plan to switch to that module, you'll discover that the default password being used is 'ClueCon.' Now, let's attempt to netcat the service. Given that it's a terminal-based service, this approach should work effectively.

Hmmm something is not right to let's try telnet

Let’s try something else, let's use searchsploit

Let’s use the 2nd one :

A quick cat command on exp.py revealed what needs to be done

Since we know that this is a windows machine, let's try to get a shell first

Delivery

β€œWhere we dropping boys?”

Let’s create an executable that can be used to get a shell on the system, we will use msfvenom for this situation

You can generate the commands from here :

Online - Reverse Shell Generator

Exploitation

β€œAccess Granted”

Let’s get the flag now

Now We need to escalate Privileges else we won’t be able to get the root flag

Let’s deploy peas-ng for windows

By the way, there is a β€œprojects” folder in C drive that you might want to check

Since we know the user is running openclinic we can search for exploits against it

Privilege Escalation

β€œI am inevitable”

Wooho!! let's see if we can get root on this machine, using the methods listed.

After a few moments, you shall receive the connection in your netcat listner

Thank you for reading my post, have a great rest of your day, and good hunting 😎

Last updated

Was this helpful?