Hack The Box Blocky Write-Up (Without Metasploit)

1. Executive Summary

There is an outdated Wordpress version used in the Blocky which is version 4.8 that allows attacker to enumerate users and apparently no restriction on user permission which gives an open door for the attacker to gain root access and take over the system.

2. Description

2.1 Enumeration

Enumerate the given address ( using nmap command in below.

nmap -sV -sC -A -p- -v -oA blocky

According to the scan result, the machine has three open ports which is port 21 (FTP), port 22 (SSH), and port 80 (HTTP).

Port 80 brought me to this BlockyCraft home page. It said that the website is under development which also means that it's also vulnerable to some exposure.

I decided to perform directory scanning on port 80 using the following command below.

gobuster dir -u -w /root/Documents/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100 — timeout 100s -k — no-error

I forgot to screenshot the result but here are the copy directories I found during the scanning process.

/wiki (Status: 301) [Size: 309] [ →]

/wp-content (Status: 301) [Size: 315] [ →]

/plugins (Status: 301) [Size: 312] [ →]

/wp-includes (Status: 301) [Size: 316] [ →]

/javascript (Status: 301) [Size: 315] [ →]

/wp-admin (Status: 301) [Size: 313] [ →]

/phpmyadmin (Status: 301) [Size: 315] [ →]

I checked all the directories, and obviously /phpmyadmin and /wp-admin caught my attention to look deeper.

On /phpmyadmin, I tried to use default authentication which is “root” for the username and blank for the password. But it does not take me everywhere so I decided to focus on /wp-admin.

While for /wp-admin, it automatically brought me to /wp-login.php. For this one case, I also tried to use default authentication using “admin” as username, “password” for their admin password. As expected the default authentication does not let me in.

Seeing the stuck situation I am in, I decided to use wpscan to enumerate user, since they apparently did not use the default one. Using the command below, I start my wpscan.

wpscan — url — enumerate u

Found two username notch and Notch. Now that we have the username, our next task is to look for the password. So I decided to look back to our directory scan result.

There is one directory that I almost missed, it is /plugins. The page has very strange title and inside the page, there are two other strange things, BlockyCore.jar and griefprevention-1.11.2–

2.2 Exploitation

I opened the BlockyCore.jar using jd-gui and discover sql username “root” and password “8YsqfCTnvxAUeduzjNSXe22". I am trying to use it for ssh root but it doesn’t allow me.

However, I remember that we have another possible username which is “notch” and “Notch”. So I tried both of these usernames and matched them with the SQL password “8YsqfCTnvxAUeduzjNSXe22”. The “notch” one is valid.

Once I logged in, the user flag is welcomed me.

Checking the notch permission using sudo-l and discovered a fact that notch is permited to run all root action. So I decided to change user to root using sudo su.

Using find command below, I look for the root flag.

find / -name root.txt -print 2>/dev/null



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store