Page cover

Flatline (FreeSwitch, OpenClinic)

First, we need to scan using nmap.

╭─hnl@hnl ~/Desktop/ctf/tryhackme/flatline  
╰─➤  nmap -A -Pn 10.10.21.42 | tee nmap.log                                                                     130 
Starting Nmap 7.80 ( https://nmap.org ) at 2022-04-03 01:17 +0630
Nmap scan report for 10.10.21.42
Host is up (0.25s latency).
Not shown: 998 filtered ports
PORT     STATE SERVICE          VERSION
3389/tcp open  ms-wbt-server    Microsoft Terminal Services
| rdp-ntlm-info: 
|   Target_Name: WIN-EOM4PK0578N
|   NetBIOS_Domain_Name: WIN-EOM4PK0578N
|   NetBIOS_Computer_Name: WIN-EOM4PK0578N
|   DNS_Domain_Name: WIN-EOM4PK0578N
|   DNS_Computer_Name: WIN-EOM4PK0578N
|   Product_Version: 10.0.17763
|_  System_Time: 2022-04-02T18:46:39+00:00
| ssl-cert: Subject: commonName=WIN-EOM4PK0578N
| Not valid before: 2021-11-08T16:47:35
|_Not valid after:  2022-05-10T16:47:35
|_ssl-date: 2022-04-02T18:46:40+00:00; -56s from scanner time.
8021/tcp open  freeswitch-event FreeSWITCH mod_event_socket
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: -56s, deviation: 0s, median: -56s

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 33.88 seconds

Port 3389 is RDP. In the result, we see port 8021 is quiet interesting. Let's connect using netcat.

Connect using Telnet. After googling a bit, we found default username. Here is a link - http://lists.freeswitch.org/pipermail/freeswitch-users/2009-January/038381.html

Try to search exploit for this port. Here is a python script to exploit this https://www.exploit-db.com/exploits/47799

Exploit using this python script. Luckily, it worked!!

We can try api system command to run on telnet for command execution.

Let's get reverse shell using nishang tools. At the end of the file, we add Invoke-PowerShellTcp to call itself. Here is at the end of the PowerShellTcp.ps1. ANd then we will change the name of the file to PowerShellTcpEx.ps1.

Execute the exploit.

In netcat session, we got reverse shell from victim machine.

We can read the user flag, but not root flag.

In C:\ directory, we found interesting directory name projects

At this directory, we found openclinic system is running on this system.

Here is POC to exploit this https://www.exploit-db.com/exploits/50448. First, we create malicious exe files using msfvenom.

Host it and download this files from victim machine.

Change file name.

Restart the machine.

In netcat session, we got reverse shell with system access.

Last updated