In this post, I would like to share a walkthrough of the Seal Machine.

This room has been considered difficulty rated as a medium machine

Information Gathering on Seal Machine

Once we have started the VPN connection, we can start the information gathering on the machine by executing the command nmap -sC -sV -p- <IP Address> -PN 

<strong># Nmap 7.91 scan initiated Mon Jul 12 21:30:43 2021 as: nmap -sC -sV -oA intial -Pn
Nmap scan report for seal.htb (
Host is up (0.22s latency)
Not shown: 997 closed ports
22/tcp   open  ssh        OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 4b:89:47:39:67:3d:07:31:5e:3f:4c:27:41:1f:f9:67 (RSA)
|   256 04:a7:4f:39:95:65:c5:b0:8d:d5:49:2e:d8:44:00:36 (ECDSA)
|_  256 b4:5e:83:93:c5:42:49:de:71:25:92:71:23:b1:85:54 (ED25519)
443/tcp  open  ssl/http   nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Seal Market
| ssl-cert: Subject: commonName=seal.htb/organizationName=Seal Pvt Ltd/stateOrProvinceName=London/countryName=UK
| Not valid before: 2021-05-05T10:24:03
|_Not valid after:  2022-05-05T10:24:03
| tls-alpn: 
|_  http/1.1
| tls-nextprotoneg: 
|_  http/1.1
8080/tcp open  http-proxy
| fingerprint-strings: 
|   FourOhFourRequest: 
|     HTTP/1.1 401 Unauthorized
|     Date: Tue, 13 Jul 2021 01:44:48 GMT
|     Set-Cookie: JSESSIONID=node0hnabifqaxoy718gb842iywilt193.node0; Path=/; HttpOnly
|     Expires: Thu, 01 Jan 1970 00:00:00 GMT
|     Content-Type: text/html;charset=utf-8
|     Content-Length: 0
|   GetRequest: 
|     HTTP/1.1 401 Unauthorized
|     Date: Tue, 13 Jul 2021 01:44:46 GMT
|     Set-Cookie: JSESSIONID=node0ba5l1frprgu2fwdfykhazky6191.node0; Path=/; HttpOnly
|     Expires: Thu, 01 Jan 1970 00:00:00 GMT
|     Content-Type: text/html;charset=utf-8
|     Content-Length: 0
|   HTTPOptions: 
|     HTTP/1.1 200 OK
|     Date: Tue, 13 Jul 2021 01:44:47 GMT
|     Set-Cookie: JSESSIONID=node016ot8bocmvot7y8baiml78ulf192.node0; Path=/; HttpOnly
|     Expires: Thu, 01 Jan 1970 00:00:00 GMT
|     Content-Type: text/html;charset=utf-8
|     Content-Length: 0
|   RPCCheck: 
|     HTTP/1.1 400 Illegal character OTEXT=0x80
|     Content-Type: text/html;charset=iso-8859-1
|     Content-Length: 71
|     Connection: close
|     <h1>Bad Message 400</h1><pre>reason: Illegal character OTEXT=0x80</pre>
|   RTSPRequest: 
|     HTTP/1.1 505 Unknown Version
|     Content-Type: text/html;charset=iso-8859-1
|     Content-Length: 58
|     Connection: close
|     <h1>Bad Message 505</h1><pre>reason: Unknown Version</pre>
|   Socks4: 
|     HTTP/1.1 400 Illegal character CNTL=0x4
|     Content-Type: text/html;charset=iso-8859-1
|     Content-Length: 69
|     Connection: close
|     <h1>Bad Message 400</h1><pre>reason: Illegal character CNTL=0x4</pre>
|   Socks5: 
|     HTTP/1.1 400 Illegal character CNTL=0x5
|     Content-Type: text/html;charset=iso-8859-1
|     Content-Length: 69
|     Connection: close
|_    <h1>Bad Message 400</h1><pre>reason: Illegal character CNTL=0x5</pre>
| http-auth: 
| HTTP/1.1 401 Unauthorized\x0D
|_  Server returned status 401 but no WWW-Authenticate header.
|_http-title: Site doesn't have a title (text/html;charset=utf-8).
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at :
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at .
# Nmap done at Mon Jul 12 21:32:32 2021 -- 1 IP address (1 host up) scanned in 109.27 seconds</strong>

We need to whitelist the domain name for the machine such as seal.htb 

Let’s open the browser and straight into the website interface.

We didn’t see any useful information appear on the website interface.

Let’s access the website via port 8080 and the website interface will look like shown in the screenshot above.

There’s a create one for us to create a new account

We should enter any details for the creation purpose so that we can log-in to the GitBucket Dashboard

Gaining Privileges Access on Seal Machine

Finally, we have managed to log into the Dashboard which the interface will look as above.

From the normal website previously, we notice that the web title called “Seal Market

The website will open the Seal Market App which the developer has done 13 commits to the application.

Without further ado, let’s open the commits page and see the content of the page.

I have managed to analyze the commits which appear here and there is one file (the code starts with ac210325af) that stood up compared to other files

I have found a tomcat folder within the commits that we open previously

There should be a file configuration that is saved as tomcat-users.xml which it might contain the username and password for the website

Finally, the username and password have been revealing on the configuration of tomcat-user.yml

From the Tomcat configuration, we notice there’s a manager-GUI that might lead to /manager/ directory. Let’s access the website via the credentials that we found previously

As a result, we did manage to gain access to Tomcat Web Application Manager. A malicious file will be needed to be uploaded on the website interface for future purposes.

However, we need to start our NC listener after we create a malicious file on our machine in order to get the reverse shell.

The upload process will look something as shown in the screenshot above.

We should inspect the packet from our BurpSuite Community tools after you click the deploy button.

We need to modify the packet where we should adding /status/..;/ before html and after manager directory. Next, we can click the forward button in order to send the packet to the server.

As a result, the file has been successfully saved on the Dashboard as shown in the screenshot above. In order to obtain the connection back to us, we need to click on the file (the same file that we save during the msfvenom activity)

When we look back on the reserve shell terminal, the connection has been returned back to us.

Maintaining Privileges Access

Let’s see which directory did we access it.

We need to look at /opt/backups/ directory where we sighted that playbook directory

Let’s read the content that has been stored within the run.yml file.

We managed to find a directory that we can use for further escalation to obtain a user flag.

No file is stored within the uploads directory.

Without further ado, We should be able to retrieve luis by executing the command “ls -n /home/luis/.ssh/id_rsa /var/lib/tomat9/webapps/ROOT/admin/dashboard/uploads

In the end, we managed to get id_rsa on the uploads directory but it’s unreadable in that directory. Due to that, we should be moving that file into /tmp directory

After that, we can copy-paste the id_rsa into our attacker’s machine where you will able to access the machine via ssh service.

Before we managed to log into the machine via ssh service, we need to give permission 600 to the id_rsa

We should be able to read the user flag by executing the command “cat user.txt

Escalate to Root Privileges Access

By running sudo -l command, we will manage to get SUID access to the machine. We can abuse the ansible-playbook assigned to root

We need to create the file (anyname.yml) which contains the following code

- hosts: localhost
   - name: darknite
   command: "chmod +s /bin/bash"

In order to get root privileges access, we should execute the command “sudo /usr/bin/ansible-playbook anyname.yml

Voila! We have been able to get root privileges to access the machine

We can read teh root flag by executing “cat root.txt” command