Inject

Enumeration

Rustscan

sudo rustscan -t 1500 -b 1500 --ulimit 65000 -a 10.129.54.43 -- -sV -sC -oA ./{{ip}}

Ports

Open 10.129.54.43:22
Open 10.129.54.43:8080

Services

PORT     STATE SERVICE     REASON         VERSION
22/tcp   open  ssh         syn-ack ttl 63 OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
8080/tcp open  nagios-nsca syn-ack ttl 63 Nagios NSCA
| http-methods: 
|_  Supported Methods: GET HEAD OPTIONS
|_http-title: Home
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Website

The website itself is described as Zodd Cloud which is a place to store, share and collaborate on files and folders. There's not much to the page itself, the registration is disabled and the login button is a dead end.

But there's and upload button wich will take you to a page where you are able to upload files.

Foothold

Exploitation

Upload: LFI & Directory Listing

As always I let Burp run in the background and browse the page, click on everything and check what I got in Burp. After uploading an image I already noticed the URL which looked like a typical target for a LFI.

URL: /show_image?img=cat.png

And as I thought I was able to verify it's vulnerable to LFI and even lists directories! But you would have to either use curl or Burp to see the results as the Webapp tries to display the response as Image.

Display: /etc/passwd

Display: /etc/systemd/system/webapp.service

Inspect: spring-webapp.jar

First I downloaded the webapp which I discovered previously.

Let's inspect the application using JD-GUI First thing I did go for was to find the pom.xml which can hold juicy infos

RCE and Shell

Using the information gathered in the app itself I was able discover that it was affected by CVE-2022-22963. You can find more infos about it HERE

Prepared a shellscript that simply setups a connection back to my machine

From Frank to Phil

While looking around I discovered a folder called .m2 in franks home directory. That folder contained a settings.xml which included credentials for the user account of phil.

Flag

The flag is located in /home/phil

Escalation

Local Enumeration

User Phil is member of the group staff which could be interesting.

Let's see if that group has access to something special

Using pspy I discovered a cronjob that seems to run every 3 minutes and executes ansible-parallel on directory /opt/automation/tasks

Exploitation

Ansible Parallel is used to run multiple playbooks on the same time. So I guessed that the cronjob is doing something like

Easiest way to abuse that can be seen on gtfobins

Wait for three minutes and you should see something like this

Root

The flag is then located in /root

Last updated