Page cover

Tech_Supp0rt: 1 (Decoding, SubrionCMS, iconv)

First, we need to enumerate using nmap.

╭─hnl@hnl ~/Desktop/ctf/tryhackme/techsupp0rt1  
╰─➤  nmap -A 10.10.164.236 | tee nmap.log
Starting Nmap 7.80 ( https://nmap.org ) at 2022-04-17 21:43 +0630
Nmap scan report for 10.10.164.236
Host is up (0.23s latency).
Not shown: 996 closed ports
PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 10:8a:f5:72:d7:f9:7e:14:a5:c5:4f:9e:97:8b:3d:58 (RSA)
|   256 7f:10:f5:57:41:3c:71:db:b5:5b:db:75:c9:76:30:5c (ECDSA)
|_  256 6b:4c:23:50:6f:36:00:7c:a6:7c:11:73:c1:a8:60:0c (ED25519)
80/tcp  open  http        Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open  netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP)
Service Info: Host: TECHSUPPORT; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
|_clock-skew: mean: -1h50m51s, deviation: 3h10m29s, median: -52s
| smb-os-discovery: 
|   OS: Windows 6.1 (Samba 4.3.11-Ubuntu)
|   Computer name: techsupport
|   NetBIOS computer name: TECHSUPPORT\x00
|   Domain name: \x00
|   FQDN: techsupport
|_  System time: 2022-04-17T20:43:37+05:30
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2022-04-17T15:13:35
|_  start_date: N/A

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

SSH, HTTP, SSH ports are open. Let's enumerate smb port first.

We can see interesting directory called websvr. And access this smb share and download the file that you see in the share.

Read the file. You can see some interesting informations.

Decode using cyberchef.

Let's change the enumeration to HTTP. When you browse the ip, you will see apache default webpage. Search sub directory using gobuster.

http://10.10.164.236/wordpress/ point to you wordpress webpage. Every wordpress site contain wp-admin.php. But the credentails admin:Scam2021 (the previous one) didn't work.

http://10.10.164.236/test/ point to you phishing page.

By looking enter.txt, you will see a directory called /subrion. So, we will browse http://10.10.164.236/subrion. But we found nothing. Request using curl.

How about robots.txt?

Browse to http://10.10.164.236/subrion/panel/ and login using admin:Scam2021. You will find a dashboard.

The webpage is build with Subrion CMS v 4.2.1. Let's find the exploit on google. Here is poc https://www.exploit-db.com/exploits/49876. Download and exploit it.

You can see the wordpress database configuration on /var/www/html/wordpress.

Try ssh on scamsite user. You got successful.

Looking around the system, we will see the user run /usr/bin/iconv with root privileges.

Try to get root shell https://gtfobins.github.io/gtfobins/iconv/. Generate ssh public key on our host and copy to victim's authorized keys.

Try to login using our private key, we got root.

Last updated