Today we will exploit a combination of two vulnerabilities in the Apache OFBiz product. This will allow you to bypass authentication and remotely execute arbitrary code on the server. Having received the user session, we will dump and crack the hashes from the OFBiz database.
Our goal is to obtain superuser rights on the Bizness machine from the training site Hack The Box. The task level is easy.
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 three open ports:
- 22 - OpenSSH 8.4p1 service;
- 80 and 443 - Nginx 1.18.0 web server.
On port 80 a redirect is automatically performed to https://. We have already entered this address into /so all that remains is to open the browser and see what the site is there.

Point of entry
We couldn’t find anything interesting on the site, so let’s start scanning.
Help: web crawling with feroxbuster
One of the first steps when testing the security of a web application is to scan directories using a brute-force approach to find hidden information and functions that are not available to ordinary visitors. To do this you can use programs like dirsearch, DIRB or ffuf. I prefer feroxbuster.
When starting, specify the following parameters:
-u— URL;-k— ignore SSL errors;-w- dictionary (I use dictionaries from the set SecLists);-t— number of threads;-d— scanning depth.
Let's launch feroxbustersetting all the necessary parameters:
feroxbuster -k -u https://bizness.htb/ -t 128 -d 1 -w directory_2.3_medium_lowercase.txt
