# Skyfall - HTB

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FH4itOr5b9q3BBV0VtJTg%2Fimage.png?alt=media&#x26;token=5ae38861-29d9-4393-8181-4780c56d1461" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FcLce90coEJfSNaVHm6YI%2Fimage.png?alt=media&#x26;token=76224ac3-f462-42b8-b2d3-0d4b6049f6b5" alt=""><figcaption><p>proof of date/time of getting the foothold</p></figcaption></figure>

## Foothold

Open ports

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2F4zFiGgJJQ1lBWnyqHLyZ%2Fimage.png?alt=media&#x26;token=9d1dcfdd-d99f-4ccf-ab56-af7b27e21dbd" alt=""><figcaption></figcaption></figure>

Fuzzing for vhosts

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2F4mxiNgwhfFG0yKClZxdw%2Fimage.png?alt=media&#x26;token=5f4026f1-ce14-4a28-8c3b-a41d0f545cfa" alt=""><figcaption></figcaption></figure>

![](file:///home/samfisher/.config/joplin-desktop/resources/65946bab68fb4729af31d2e5d592183a.png)

here shows its minio which is cloud object storage

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FBO5njOHr3tFrDKeTRJ5n%2Fimage.png?alt=media&#x26;token=0d030b2a-0b1c-41b9-b6f1-33691b322481" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2F2wm0aMSySnXK3ZgksRCt%2Fimage.png?alt=media&#x26;token=2533e877-68f1-4520-b66d-df4287b0dd2d" alt=""><figcaption><p>shows s3 buckets in the error message</p></figcaption></figure>

if you try to visit the MinIO Metrics it will gives you 403 forbidden

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FOjUCDaOrB5nyOuPvURcU%2Fimage.png?alt=media&#x26;token=a552d75f-8fd5-4a13-a3a3-aecaa760f82b" alt=""><figcaption></figcaption></figure>

to bypass that ,we can intercept the request with burpsuite and use tab character "Double tab" after the directory path

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FvkCJzglv8baZami7W3ej%2Fimage.png?alt=media&#x26;token=4ffc3cf7-e0b1-4c2e-bdc3-01ab10e5d9ee" alt=""><figcaption></figcaption></figure>

that's will show us a new domain we can use to communicate with MinIo objects

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2F9AvYVQit8bw0LfqMxXEW%2Fimage.png?alt=media&#x26;token=eb67d819-3e90-402c-a778-9b0b836d7dad" alt=""><figcaption></figcaption></figure>

minio is vulnerable to information disclosure below link for more reference

{% embed url="<https://www.pingsafe.com/blog/cve-2023-28432-minio-information-disclosure-vulnerability/>" %}

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FJTWFcAZuUgoy7IwyZN54%2Fimage.png?alt=media&#x26;token=7aeb4651-7ee4-4dc0-a4f9-c617e7d8be79" alt=""><figcaption></figcaption></figure>

now we can download MinIo Client

<https://github.com/minio/mc>

first thing we need to do is to configure the server

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FBdL6cFczQ4TCP98vfFjl%2Fimage.png?alt=media&#x26;token=ec3693c4-bbd1-49fc-a70e-4f4dd58b02bb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2Ff916yFgBr1v8Yk63SLB1%2Fimage.png?alt=media&#x26;token=059bce80-7f5b-483e-807f-f6c830d460cf" alt=""><figcaption></figcaption></figure>

found many different versions

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FzEsPsQkwK0fGhlcDVIDq%2Fimage.png?alt=media&#x26;token=c532aeac-5383-4393-bbd8-1f8ae6ecc514" alt=""><figcaption></figcaption></figure>

what i have done is undo twice and it will revert back twice then download the backup file

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FPFvf3aI36soieE3cSye6%2Fimage.png?alt=media&#x26;token=382f7776-c07e-4729-badc-020f724ca4ef" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FKOd7OZIxzaZmCBPrKlTZ%2Fimage.png?alt=media&#x26;token=4431a187-7677-440e-b81b-a92c232b6776" alt=""><figcaption></figcaption></figure>

downloading all versions and found hashicorp exports ,new domain + token that gonna help later with authentication

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FnD7b8ogVZQ3aJed5i4Ry%2Fimage.png?alt=media&#x26;token=59761c78-d517-450e-b4bb-a23afbf0182c" alt=""><figcaption></figcaption></figure>

now we can login using vault tool from hashicorp ,but as per documentation we need to export VAULT\_ADDR to the found domain ,then we login

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2Fh3Ezvrea4gYfGms0kXfl%2Fimage.png?alt=media&#x26;token=e1598edc-d0c3-4f58-ae76-46faa8412253" alt=""><figcaption></figcaption></figure>

now following this from hashicorp documentation

{% embed url="<https://developer.hashicorp.com/vault/docs/secrets/ssh/one-time-ssh-passwords>" %}

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2F4UxlKBphENUpk7njFjLq%2Fimage.png?alt=media&#x26;token=8592a21b-8683-40b6-b6df-5ac139561f45" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FGztRSb2j9ZpQHlRZ979I%2Fimage.png?alt=media&#x26;token=8d0de27d-b9ab-427c-be38-9136c245abe1" alt=""><figcaption></figcaption></figure>

### Root

sudo -l

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FNCaRN5dNzyB5N8aZClzn%2Fimage.png?alt=media&#x26;token=8d1b30ee-e07e-4068-bbf9-1f7890f96c27" alt=""><figcaption></figcaption></figure>

First create a new file "debug.log" for the flag "-d" to save the debug output to that file and extract the used master token

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2FL02yuh4TP3CIxGolpH6i%2Fimage.png?alt=media&#x26;token=3288966f-ca99-4f6a-b5ea-e349840f5549" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2459792242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4TFAEQ86UXTLdhGzyRhz%2Fuploads%2Fa5Sc3j75gx9rDvS9WFGL%2Fimage.png?alt=media&#x26;token=538b2830-1e93-4954-a3bd-159b757b096a" alt=""><figcaption></figcaption></figure>
