Tech_Supp0rt

TechSupport01

Room link: https://tryhackme.com/room/techsupp0rt1

Scanning

ajread@aj-ubuntu:~$ nmap -A [Remote IP]
Starting Nmap 7.80 ( https://nmap.org ) at 2022-05-16 21:27 EDT
Nmap scan report for [Remote IP]
Host is up (0.10s 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: -1h50m00s, deviation: 3h10m30s, median: -1s
| 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-05-17T06:57:53+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-05-17T01:27:52
|_  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 36.52 seconds

Enumeration

I saw that there was a http server running on port 80. I ran nikto to see if there are any glaring vulnerabilities.

I also ran nikto and pointed at the wordpress subdomain.

There didnt appear to be anything glaring in either nikto outputs. Therefore, I attempted to enumerate the SMB side of the remote machine.

I checked out what sat in websvr share.

I downloaded the enter.txt file and found some interesting information.

Initial Access

I dropped the credentials into CyberChef and found the password for the admin user on Subrion. I didnt find the url through directory enumeration but I did find references to a Subrion panel. So, I connected to http://[Remote IP]/subrion/panel/ and logged in with the credentials found in the enter.txt file.

With some hints from https://www.infosecarticles.com/tech-support-tryhackme-walkthrough/, I did some recon to find a wp-config.php file in the wordpress directory.

The file had credentials for an SQL database.

Then, I was able to use the credentials and ssh into the target with a username that I saw in the home folder earlier.

I looked for what I could run as sudo.

Privilege Escalation

I checked GTFO Bins to see my options. It looks like running inconv with 8859_1 encoding allows you to run any single-byte sequence (https://gtfobins.github.io/gtfobins/iconv/). With that information, I was able to read the root flag!

Assistance

As referenced earlier, I used https://www.infosecarticles.com/tech-support-tryhackme-walkthrough/ to point me to the credentials in the wp-config.php file to ssh. After that point, the walkthrough was not used.

Last updated