> For the complete documentation index, see [llms.txt](https://kayiyan.gitbook.io/hacking-note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kayiyan.gitbook.io/hacking-note/hackthebox-machine/skyfall.md).

# Skyfall

Link machine : https\://app.hackthebox.com/machines/586

Pwned : <https://www.hackthebox.com/achievement/machine/1410710/586>

My note about Skyfall machine.

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FgDs4kqHfH3X9wbKZPulv%2Fimage.png?alt=media&amp;token=00c427b8-f6b3-4f04-95cb-33d540cd07ac" alt=""><figcaption></figcaption></figure>

Enumeration :&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2F7DZdQIuawIrc54DZ2cF5%2Fimage.png?alt=media&amp;token=ee0781e5-b6b5-4c0b-bca1-e340fa917013" alt=""><figcaption><p>There is 1 subdomain from this subdomain, this subdomain can be obtained from the view source on port 80</p></figcaption></figure>

Add `skyfall.htb` and `demo.skyfall.htb` to `/etc/hosts` and view the web page :&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FfzFU1cZ7mpMVOv8pLMvt%2Fimage.png?alt=media&amp;token=882fd629-76dc-4716-acf4-25871827733a" alt=""><figcaption><p>have a login page on the subdomain, log in with the credentials displayed on it ( guest/guest)</p></figcaption></figure>

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2Fqhp8xN3vSGvnZvBnL2qP%2Fimage.png?alt=media&amp;token=4eab8aed-f5dd-43d5-9ce8-8e75c7aac1f6" alt=""><figcaption></figcaption></figure>

On this website there are some options like Fetch URL, Download,Upload file, I tried webshell upload and reverse shell on this one but it doesn't seem to work.

There is another notable function called Minio Metrics, but when I click on it to view it, I get error 403 Forbidden .

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2Fzmmege7TZgQxqnR2yrQj%2Fimage.png?alt=media&amp;token=86fd0a8f-a529-4631-b807-cbc610b39a5b" alt=""><figcaption></figcaption></figure>

A bit of research tells me there is a security vulnerability in the minio service, which also contains several CVEs, and one of these I'm looking into is CVE-2023-28432 (CVSS 7.5).

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FUmxKDq7YaBPy1jph1kz7%2Fimage.png?alt=media&amp;token=8e1cee66-6e42-4496-94e4-7365ea41c52b" alt=""><figcaption></figcaption></figure>

WhiteHat also have a blog about this : <https://whitehat.vn/threads/canh-bao-lo-hong-nghiem-trong-cao-trong-minio.17181/>

Okay, the problem is that the website when accessed returns a 403 forbidden error, so if we can ignore this then it will provide some useful information.

Continue researching 403 bypass on hacktricks book and there are more resources that can help.

Open Burpsuite first then tried to bypass  :&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FlE1qrDqfb3aGyrNniTf6%2Fimage.png?alt=media&amp;token=e50f5f48-4251-408f-8153-8f62b002bedd" alt=""><figcaption><p><code>\t</code> ( decode to hex is 09 ) is the way to pass this error on this website.</p></figcaption></figure>

View this and got the new subdomain : <br>

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FEhNny2YffdBdEMUi3yzt%2Fimage.png?alt=media&amp;token=e9971baa-14aa-461a-8dc6-b2419ec2e863" alt=""><figcaption></figcaption></figure>

Follow the CVE - POC had found , try exploit with that :&#x20;

{% embed url="<https://github.com/acheiii/CVE-2023-28432>" %}

Exploit successfully&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FX19TjWP6PGMPjtXBCBA7%2Fimage.png?alt=media&amp;token=1d7258f5-d736-4de0-a31e-4846b2a3ab49" alt=""><figcaption></figcaption></figure>

Got  `MINIO_ROOT_PASSWORD` and `MINIO_ROOT_USER` this is important credentials.

Now have this  credentials we can gain access with MinIO client :&#x20;

{% embed url="<https://min.io/docs/minio/linux/index.html>" %}

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FlgszBFqjnwmN7T2Zvejf%2Fimage.png?alt=media&amp;token=9978460b-be6c-4825-97d0-441e93e6af63" alt=""><figcaption></figcaption></figure>

Enumerations :&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2F6gFeRfHJBzWZt9pfpSuk%2Fimage.png?alt=media&amp;token=47c99086-a17c-4945-aa73-93fbb8ef1b78" alt=""><figcaption></figcaption></figure>

Download all this file backup, got ssh key on v1 but can't connect, on v2/.bashrc get Vault TOKEN and Vault ADDRESS -> Gain User Access ( assky).

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FrjEjWOKNBWFypjZ5uw6z%2Fimage.png?alt=media&amp;token=f775aca7-d4a3-4f96-8b12-6d255964e8aa" alt=""><figcaption></figcaption></figure>

Install vault : <https://developer.hashicorp.com/vault/install#Linux>

Use vault to connect from all these credentials:

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FBoCq1wplqvytZ9LmdX5v%2Fimage.png?alt=media&amp;token=dd548335-7351-4b30-ad7d-2fb9287c4e6a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2F1IgJUx34dQQ17ZhstB9s%2Fimage.png?alt=media&amp;token=ae936a9e-f86a-4522-bf64-e7f15c90e554" alt=""><figcaption></figcaption></figure>

`vault read sys/internal/ui/resultant-acl --format=json` -> get ssh role

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FdQIbak9s4PSlvBixkpnn%2Fimage.png?alt=media&amp;token=449ca277-e5aa-4baa-90d2-b8b59558291d" alt=""><figcaption><p>Password is the OTP generate -> this randomly each time connect</p></figcaption></figure>

### Privilege escalation -> Gain Root Access <a href="#privilege-escalation" id="privilege-escalation"></a>

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FnwMyR8hANLFhWMC94eRM%2Fimage.png?alt=media&amp;token=6b4d12ce-a113-4a95-8024-0e2100c26256" alt=""><figcaption></figcaption></figure>

Run vault-unseal with -d option will give the the log and write that to debug.log , create a debug.log file can help we get the data from this :&#x20;

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2F1P1fImvnGJVbbcVURzP9%2Fimage.png?alt=media&amp;token=fd15b79f-1ce2-42c0-87fb-28ff53643a6e" alt=""><figcaption></figcaption></figure>

Get Master Token -> Use this and follow the User Login Step done before which may help to login as root.

`vault list ssh/roles` -> list role to connect ssh -> use admin role to connect.

<figure><img src="https://1038241181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbr7avii8O2bCJtM7fDhm%2Fuploads%2FS2PtUZoZ4G7RKKFzrEok%2Fimage.png?alt=media&amp;token=5a41271f-c164-412c-9b47-32bd898aae6f" alt=""><figcaption><p>Pwned.</p></figcaption></figure>
