HackTheBox - Unbalanced

Nmap scan results (All port scan)
nmap -sC -sV -oA nmap-allportscan -T4 10.10.10.200
Setting Up SQUID Proxy in the browser
We have SQUID Proxy server running on port 3128. SQUID Proxy is normally used for filtering web traffic coming from the external network i.e Internet. I will be using Foxy Proxy for setting it up.


We don't really get anything, so we can proceed with Rsync Enumeration. Read about rsync over here.
Enumerating RSYNC Protocol
A goto checklist that I always follow - https://book.hacktricks.xyz/pentesting/873-pentesting-rsync
We can enumerate shared folders using the following command.

This command will list all the files present inside conf_backups.

To copy all the files locally, we can create a directory and transfer it using the following command.

Working with EncFS (FUSE-based cryptographic filesystem)
This directory consists of junk files and a .encfs6.xml file. EncFS is a cryptographic file system which encrypts all the files present in that directory. We need to know the password to decrypt all the files.
We can use encfs2john.py to create a hash and later crack it using John itself.


Now that we have the password, we can decrypt it.

Analyzing squid.conf file


This one looks interesting as we are allowed to access intranet.unbalanced.htb domain. We also have this cache_mgr password.

Cache Manager Access Control (SQUID)

This looks like a login portal for employees. I tried default usernames/passwords and also tried using the previously found passwords, but didn't get anything. We have cache_mgr passwd, that means we can browse the internal squid manager configuration.

We can check FQDN (fully qualified domain name) Cache for potential IPs and hostnames.

This intranet-hostx.unbalanced.htb are probably the load balancers. A load balancer is a device that acts as a reverse proxy and distributes network or application traffic across a number of servers. Load balancers are used to increase capacity (concurrent users) and reliability of applications.
Found a web page which can be vulnerable

Checking around the IP Addresses, I found this webpage and it was taken down due to security issues. (Looks interesting and can contain vulnerabilities). Let's run a gobuster scan against this IP.


This website is responsive, maybe we can try for SQL Injection on the login page. I tried using sqlmap to automate the process but didn't get anything.
Exploiting XPATH Injection
This one looks like a XPATH Injection. We can try to inject basic authentication payloads from here.


This is definitely XPATH Injection. We can exploit this with a script to get all the usernames and passwords.

SSH Access as bryan user

Discovering Pi-Hole running on docker network
There's Pi-hole running on docker network. We need to find the IP Address for that machine. For that, we can use ip neigh command.

172.31.11.3 - Pi-hole might be running on this IP. To check, we can scan the ports using static nmap binary or by creating a simple bash script. The Pi-hole runs with 53 and 80 port to be opened (Default ports)

Or we can also use curl to get the root page.

Forwarding ports using SSH
Let's forward the ports to our machine.


Exploiting Pi-Hole RCE ( Version : 4.3.2 )
The TODO note said that admin used a temporary password. I tried admin as a password and got authenticated. ( Pi-hole Version v4.3.2 )

MAC address input can be exploited to gain arbitrary code execution on the machine.



Using the admin interface password on the host machine to get root access.

Last updated
Was this helpful?