Today I will show with a live example how a Minecraft server running on Windows can be attacked using an existing exploit. Once we have the ability to execute code remotely, we will analyze the installed plugins and find data to escalate privileges in the system.
Our goal is to capture the Crafty car from the training area Hack The Box. The task level is easy. All actions will be performed on Linux.
warning
It is recommended to connect to machines with HTB only via VPN. Do not do this from computers that contain data that is important to you, as you will end up on a shared network with other participants.
Intelligence service
Port scanning
Add the machine's IP address to /:
И запускаем сканирование портов.
Справка: сканирование портов
Сканирование портов — стандартный первый шаг при любой атаке. Он позволяет атакующему узнать, какие службы на хосте принимают соединение. На основе этой информации выбирается следующий шаг к получению точки входа.
Наиболее известный инструмент для сканирования — это Nmap. Улучшить результаты его работы ты можешь при помощи следующего скрипта:
#!/bin/bash
ports=$(nmap -p- --min-rate=500 $1 | grep ^(0-9) | cut -d '/' -f 1 | tr 'n' ',' | sed s/,$//)
nmap -p$ports -A $1
It works in two stages. The first one performs a regular quick scan, the second one performs a more thorough scan using the available scripts (option -A).
The scanner found two open ports:
- 80 - Microsoft IIS 10.0 web server;
- 25565 - Minecraft server 1.16.5.
First of all, let's look at what's on the web server. There we are greeted by a one-page website revealing another subdomain.

We add a new subdomain to our file /.
10.10.11.249 crafty.htb play.crafty.htb
I would like to note right away that scanning neither the first nor the second site yielded anything. For this reason, let's move on to the Minecraft server.
Point of entry
The first step is to check whether there are ready-made exploits for the detected software. There are special databases (for example, Exploit-DB), but to get started, you can just search on Google. At the request “Minecraft 1.16.5 exploit” we receive information that this version of the server has a vulnerable Log4j component.

We find it on GitHub exploitwhich allows you to get remote code execution (RCE).