Introduction
This is another windows machine. The difficulty rating for this Hard. Let’s get started.
Scanning & Enumeration
From the results above, let us populate our Service Version Enumeration Table.

MariaDB Enum
MariaDB is an opensource version of MySql and even though they offer some differences, the syntax that we will be using is almost the same every time.
We saw that the service was prompted with (unauthorized). Let’s try to connect.

Maybe we can use this once we have local access. Let’s look at the WebPage.
HTTP Enum

In our Nmap scan we saw that we had 15 disallowed entries in the ‘/robots.txt’.

We have ‘/administrator’, from where we can see a login panel, I tried to SQL inject past it. Didn’t work.
I noticed we have Joomla, let’s try to enumerate that. But we don’t really have anything up our sleeve for Joomla yet. A quick google search reveals: https://github.com/rezasp/joomscan
Let’s use joomscan!

We see that the target is using Joomla 3.7.0
Vulnerability Analysis
Let’s see if this has any public exploits.

We see that there is SQL Injection vulnerability.

We can use sqlmap here and get this done. But then again, this is OSCP Prep, let’s see if we can find anything else online, preferably something on Github.

Let’s set this up and execute it!

We get a hash. We can now maybe try this with hashcat. We can set the mode as 3200 and start a dictionary attack.
This might take a while, let’s grab some coffee :P

We finally get the password.

Upon logging in with the cracked password and username ‘Jonah’, we see the joomla control panel.

Since this is a control panel for a CMS, we should have an option to add pages.
Exploitation
Now that we have found a way to upload and edit files, let’s try to get a reverse shell.
We copy the php-reverse-shell from pentest monkey. Link : http://pentestmonkey.net/tools/web-shells/php-reverse-shell
Create a shell.php

We can access our shell.php on the following path. Note: IP might be different in your case :)

Privesc
Once we have our initial foothold, let’s start enumerating the machine.
Contents of ‘/etc/passwd’ reveals a user jjameson on the machine. Let’s try to see if we can get the user flag :P

No luck!
Now we can try to see in the root Joomla folder if we have something. Well, we don’t know that! Let’s see an installation guide to figure out where it is.

Notice the path ‘/var/www/html/joomla’.

Inside configuration.php we see a password field and a secret. These can be potential passwords.

We use these to try and login to the server

And we successfully logged in.
Running sudo -l suggests that we can run yum as sudo without password.
Checking it on GTFOBins gives us a way to get root shell.

Running it on the target machine …

Summary | TL;DR
- Scan ports using nmap
- Enumerate HTTP, find Joomla dashboard and version
- Exploit SQLi vulnerability — Joomla3.7-SQLi-CVE-2017–8917
- Crack the hashed password
- Get authentication from config file on the system
- Priv Esc using GTFO Bins for yum.
Parting Thoughts
In this machine, the new things we learned are the following:
- Version Enumeration for Joomla
- Privesc using yum
Thank you for reading, please provide your feedback and share with people who are in need. :)