Seal - Medium

Seal

Introduction@Seal:~$

Name

IP

10.10.10.250

Points

30

OS

Linux

Difficulty

Medium

Creator

Release Date

10 Jul 2021

Enumeration

Nmap

Web

We can see DNS name seal.htb on 443 which is HTTPS . Put it in your /etc/hosts

Search function is doesn't work, Found a possible username Jomono , The administrator email is admin@seal.htb .

Directory Scan

Found /admin folder but it gave us 404 not found.In /manager/status , we get authentication for tomcat but we don't have credentials.Default credentials also didn't work.

Port 8080

Tried to put some credentials like admin:admin but it doesn't work.Let's create an account.

When we login with that account. we can see updated tomcat configuration

In that commit , we can see username and password for tomcat.

Now we got tomcat credentials.

Go to https://seal.htb/manager/status and you can login with that credential.

After wasting in google to exploit this, I found this on rapid7 .

You can bypass with path traversal to access html like this.

https://seal.htb/manager/status/..;/html

Now we can upload a war file to get reverse shell.

When we upload we need to intercept the traffic because to add ..; .Otherwise we can't access the html.

Getting User

When you finished file uploading, you can see rev_shell like this.

Listen with netcat and click on it. you will get reverse shell as tomcat user.

After pspy running, we can see /opt/backups/playbook/run.yml file running as luis.

A simple script that copies files from src folder to dest folder. When I seach in google about “copy_links=yes” , it doing symlinks for us. So we can simply link that to anywhere within the backup path to get it copied in to the backup.

First we need to create a symlink to the id_rsa of Luis and we have writeable in /uploads folder.

find . -writable -file

Now go to /opt/backups/archives and copy .gz file to /tmp directory.

Now go to dashboard/uploads directory.

id_rsa

Save as file and give it the right permission.

chmod 600 id_rsa

Privilege Escalation

After reading this article , I found a way to get command execution.

Create a file with .yml extension.

And then execute like this.

Now we pwned it.

pwned

Author Account : https://app.hackthebox.com/profile/237587

Last updated