Analytics
Gaining Access
Nmap scan:
$ nmap -p- --min-rate 3000 10.129.49.201
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-08 22:09 +08
Nmap scan report for 10.129.49.201
Host is up (0.0056s latency).
Not shown: 65533 closed tcp ports (conn-refused)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open httpDid a detailed scan as well:
$ nmap -p 80 -sC -sV --min-rate 4000 10.129.49.201
Starting Nmap 7.93 ( https://nmap.org ) at 2023-10-08 22:10 +08
Nmap scan report for 10.129.49.201
Host is up (0.0093s latency).
PORT STATE SERVICE VERSION
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://analytical.htb/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernelI added analytical.htb to the /etc/hosts file before visiting the web application.
Web Enum -> CVE-2023-38646 RCE
The website was for a company that does data analytics.

Below, there are a few names we can note:

There was also a login page, which directed me to data.analytical.htb.

gobuster and wfuzz didn't reveal much, so I took a look at the requests being sent in Burpsuite. Here's the POST request sent on the login.
We can see that metabase is the backend, and that it has an /api endpoint. Metabase has a few pre-auth RCE exploits available.
From the blog above, to determine if an instance is vulnerable, the setup-token variable needs to be misconfigured and not hidden. Viewing /api/sessions/properties for this machine verifies that the token is leaked.

Following the blog above, I just replaced the token and reverse shell command used in their PoC request. The base64 encoded command is just a simple bash one-liner.
After sending this, my listener port caught a reverse shell into a Docker instance.

Env Creds -> User Shell
Within the Docker container, I checked the environment variables and found the user's password.
Afterwards, I could ssh in as the user metalytics.

Privilege Escalation
CVE-2023-2640 -> Root
I did some basic enumeration, like getting the OS used and what not:
When googling for 'Ubuntu 22.04 jammy exploit', I found this:
The machine fits all the criterias to be vulnerable to this, so I gave the exploit a shot. I found the PoC on Reddit, and it worked.
Run these 2 commands back to back to get a root shell:

Rooted!
Last updated
