# Silver Platter

{% embed url="<https://tryhackme.com/r/room/silverplatter>" %}

The following post by 0xb0b is licensed under [CC BY 4.0<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt="" data-size="line"><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt="" data-size="line">](http://creativecommons.org/licenses/by/4.0/?ref=chooser-v1)

***

## Recon

We start with an Nmap scan and find three open ports. Port `22` on which we have SSH available, port 80 to an nginx web server and port `8080` to another web server.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FSgkVSYzCCsgjg3Nj9fJl%2Fgrafik.png?alt=media&#x26;token=ae3beb2d-e0fe-426c-b9dc-502d462f936e" alt=""><figcaption></figcaption></figure>

When enumerating the directories using Feroxbuster, we do not find anything interesting on the web server on port `80`.

{% code overflow="wrap" %}

```
feroxbuster -u 'http://silverplatter.thm/' -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F5ZYsVPHCgNcYRiIjnUtk%2Fgrafik.png?alt=media&#x26;token=37db4c42-7652-4b6b-9370-d4a470d203f9" alt=""><figcaption></figcaption></figure>

On the web server on port `8080` we find two directories `/website` and `/console`. Both very interesting. However, `/console` redirects to a static HTML page `nodirect.html` and `/website` is redirecting to `/website/` which is forbidden.

{% code overflow="wrap" %}

```
feroxbuster -u 'http://silverplatter.thm:8080/' -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FbHC0rtinjTRQpqDkOYkI%2Fgrafik.png?alt=media&#x26;token=63c81400-03c8-486f-b595-77ccfe5ed8fb" alt=""><figcaption></figcaption></figure>

We look at the page manually on port `80`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fse2TBssaydpVtlGZJ0mO%2Fgrafik.png?alt=media&#x26;token=86610dbd-2423-44d6-a8c4-4e3276513ff2" alt=""><figcaption></figcaption></figure>

Under Contact we find a possible user who is a project manager for Silverpeas.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FdmwXOJ81GZSxAjGDK5YW%2Fgrafik.png?alt=media&#x26;token=9e017d6f-0f7e-486e-8aa1-d88a724a28aa" alt=""><figcaption></figcaption></figure>

We write down the findings...

```
Silverpeas
```

```
scr1ptkiddy
```

On the website on port `8080` we find nothing on the index page and `/website` redirects us to `/website/`, which is forbidden.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F6LV0GK0CrLuhe4Ghhkhn%2Fgrafik.png?alt=media&#x26;token=bfcb9e8d-c765-43b8-baed-d445a324bfed" alt=""><figcaption></figcaption></figure>

Various 403 bypass techniques and automated scripts were unsuccessful. Since we have a username and a hint of a possible brute force in the room description, we try basic authentication brute force via Hydra. This was also unsuccessful.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FZbu1hUWuvWxd8kkjholT%2Fgrafik.png?alt=media&#x26;token=e0e3675f-ac76-4e06-a4cb-e8982c1c3329" alt=""><figcaption></figcaption></figure>

## Web Access&#x20;

However, we still have the reference to Silverpeas in the contact form. We enter this as a directory for `http://silverpeas.thm:8080/` and have a hit. A login page for Silverpeas. We find some CVEs for this, but they are not necessary.&#x20;

```
Silverpeas
```

```
http://silverpeas.thm:8080/silverpeas
```

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FJqS0TcI0zIaIPJ2KinZu%2Fgrafik.png?alt=media&#x26;token=7a019231-7f19-4e66-8842-2319f214b10b" alt=""><figcaption></figcaption></figure>

### Intended

Since we have a username, we could try to brute-force the login using hydra. As the room description gives us the clue, `rockyou.txt` may not help here. But we can create a wordlist using the words on the `http://silverplatter.thm` page. We use cewl to do this.

```
cewl http://silverplatter.thm > passwords.txt
```

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FBCeP4OKMEL7AIkAs4Rky%2Fgrafik.png?alt=media&#x26;token=9e1f3209-eb6b-4126-bd72-2bb58a724c56" alt=""><figcaption></figcaption></figure>

User:

```
scr1ptkiddy
```

Now we capture a log in request to craft our hydra command.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FkKMiMLAN8AsuXqHM5q0L%2Fgrafik.png?alt=media&#x26;token=0ac08352-bf57-4202-ae1d-8d074c1e4d34" alt=""><figcaption></figcaption></figure>

We forward the intercepted request to get the invalid response message.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FpuPDn8OhHSZiSuMv2JyV%2Fgrafik.png?alt=media&#x26;token=63ecd4ea-4f92-42d3-8124-4de468d982a2" alt=""><figcaption></figcaption></figure>

Next, we build the hydra command with the user found and the words extracted by cewl. And we are able to retrieve a credential pair.

{% code overflow="wrap" %}

```
hydra -l scr1ptkiddy -P passwords.txt silverplatter.thm -s 8080 http-post-form "/silverpeas/AuthenticationServlet:Login=^USER^&Password=^PASS^&DomainId=0:F=Login or password incorrect"
```

{% endcode %}

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FCCf1ZXLT0oLSRkrcMuWA%2Fgrafik.png?alt=media&#x26;token=b8f4c671-a3c5-45d0-9e6a-ae63c4a79be6" alt=""><figcaption></figcaption></figure>

We are able to log in as `scr1ptkiddy` at Silverpeas.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F0sUmzXEhx68ROUaicIn6%2Fgrafik.png?alt=media&#x26;token=e32b4f94-653b-47c8-94ff-8d8bfa8d966f" alt=""><figcaption></figcaption></figure>

### Unintended

It seems that while testing the room, Aquinas found a way to bypass the login. All you have to do is remove the password parameter.

{% embed url="<https://gist.github.com/ChrisPritchard/4b6d5c70d9329ef116266a6c238dcb2d>" %}

We intercept a login request for the user `scr1ptkiddy` using Burp Suite, remove the password parameter, and then forward the request.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F5nQIwb8TpL9PApFXyEL0%2Fgrafik.png?alt=media&#x26;token=e6c25787-d7c5-4aba-9dab-a2c5d13d1819" alt=""><figcaption></figcaption></figure>

And we are logged in.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FOzCkBJjVmY9sU6SEjBfc%2Fgrafik.png?alt=media&#x26;token=09c97409-8fdd-4647-b1fa-6823f2c4ffb9" alt=""><figcaption></figcaption></figure>

## Shell As Tim

After being logged in as `scr1ptkiddy`, we can find a single notification.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FMBVkqHCGVs4TQ177btQn%2Fgrafik.png?alt=media&#x26;token=d34f5f9f-c049-43e1-93ed-bd9c5122e38e" alt=""><figcaption></figcaption></figure>

### Intended

In the personal workspace, we can inspect our notifications.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fy865n8BpB1TvFbtINxKL%2Fgrafik.png?alt=media&#x26;token=3de9c6bc-2ca2-45bc-b9d3-bb3bda3fbf34" alt=""><figcaption></figcaption></figure>

We intercept the request of inspecting the message and see that an ID is queried, here ID 5.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FKTChEez3Jnx63twLzHRa%2Fgrafik.png?alt=media&#x26;token=a3c25122-7923-4849-a5d2-8e97cff93a7c" alt=""><figcaption></figcaption></figure>

But there is an IDOR, we can also inspect the messages of other users. The message with the ID 6 contains the SSH credentials of user `tim`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FWNx3FWBOkxJegSm4zjRq%2Fgrafik.png?alt=media&#x26;token=465b2b05-3dfc-41da-86b1-60989f8a7339" alt=""><figcaption></figcaption></figure>

Next, we use those credentials to log in via SSH.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FE9AhvUh0NEqxSHlhS9Hz%2Fgrafik.png?alt=media&#x26;token=7dcaf4c7-d348-4be2-8781-60dd293b80dc" alt=""><figcaption></figcaption></figure>

We find the user flag in the home directory of the user `tim`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FshiWdohOA2BWV5yecjF9%2Fgrafik.png?alt=media&#x26;token=f0f7c30f-e91b-43e2-ab8f-c17c0425b359" alt=""><figcaption></figcaption></figure>

### Unintended

We inspect the other users available on the app by clicking on the following symbol.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FdDd4kLaxsxM6Ji08QUtN%2Fgrafik.png?alt=media&#x26;token=c7097e42-6765-4e5d-85c4-0cb0d0e8f2fc" alt=""><figcaption></figcaption></figure>

There is also a `Manager` user and an `Administrator` user.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FieReEaR6qGZTuBRyZvFQ%2Fgrafik.png?alt=media&#x26;token=877d6cdd-0be4-4171-ac1e-7bfb87a1be64" alt=""><figcaption></figcaption></figure>

We repeat our unintended steps from before and try to log in as `Manager` and not `scr1ptkiddy` this time.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FtaciTWZhfDBuKUH9yBcV%2Fgrafik.png?alt=media&#x26;token=ec3f5c48-2f94-41a8-a94a-459594a8990e" alt=""><figcaption></figcaption></figure>

We remove the Password parameter and forward the request to bypass the login.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fu7HLtmwBtWECZMMBlzjm%2Fgrafik.png?alt=media&#x26;token=76a7d991-d4d1-4cf5-925a-39e8cebe1411" alt=""><figcaption></figcaption></figure>

We are logged in as Manager and are able to inspect the messages, which of one contains the SSH credentials of the user `tim`.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2Fuye1LxwmZsdRugwWnFfr%2Fgrafik.png?alt=media&#x26;token=54e76eee-a2d4-41ae-a4c4-8dcc624146c2" alt=""><figcaption></figcaption></figure>

Next, we use those credentials to log in via SSH.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FSrBfM8v49NIWFhBXiARa%2Fgrafik.png?alt=media&#x26;token=48748988-8958-4d2e-9baa-931cff187812" alt=""><figcaption></figcaption></figure>

We find the user flag in the home directory of the user tim.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FlueSJBpuKiucDfANGf6G%2Fgrafik.png?alt=media&#x26;token=30ce15c7-c304-40db-b549-cb9a1a374da5" alt=""><figcaption></figcaption></figure>

## Shell As Tyler

We look at `tim`'s groups and see that he is in the `adm` group. This allows us to find the logs in `/var/logs`. Maybe we can find useful sensitive information there to escalate further.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2F0oFJ5BikMxh2t4uiRI45%2Fgrafik.png?alt=media&#x26;token=e632f335-cc8f-4402-bb45-789a02f498e1" alt=""><figcaption></figcaption></figure>

There is also the user tyler.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FJD7Y3Fq4gSZzvvR73HZ7%2Fgrafik.png?alt=media&#x26;token=11d289e3-15b3-4343-99d9-becc96fa6710" alt=""><figcaption></figcaption></figure>

So lets search for entries of the user tyler.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FGIDBSmfP8B6pilNneSGv%2Fgrafik.png?alt=media&#x26;token=1beefca5-0bfe-45fa-a583-896421228cfe" alt=""><figcaption></figcaption></figure>

And we do find some database credentials. Maybe they are reused.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FEnwaJOCR7iscHnRUuti9%2Fgrafik.png?alt=media&#x26;token=df494e98-1e60-41d9-9a5c-27953d511bdb" alt=""><figcaption></figcaption></figure>

We use those credentials to change the user to `tyler` and are successful.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FnWasrW0LII0Rr4iuhNe1%2Fgrafik.png?alt=media&#x26;token=e5821fd4-a81b-4a79-93a6-5f9383fd2ed9" alt=""><figcaption></figcaption></figure>

## Shell As root

This user is allowed to run any command as `root` using `sudo` without a password. So we just issue `sudo su` to change to `root`. We head to the root directory and find the final flag there.

<figure><img src="https://2148487935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqaFccsCrwKo1CHmLRKW%2Fuploads%2FZn20RM8Kg4cJ0yhbLqih%2Fgrafik.png?alt=media&#x26;token=3a24db5e-01dd-4dc4-8e21-b9ba74d1cde2" alt=""><figcaption></figcaption></figure>

## Final Thoughts

The room showed me that I think too much in CTFs. At first, I thought - because it was an easy rated  room - all I had to do was look for the CVEs. This led me to follow the XSS portion of <https://rhinosecuritylabs.com/research/silverpeas-file-read-cves/> for a very long time. I followed this assumption because it is not a custom application. So be careful if you want to gain real security research skills from CTFs and not just follow the CVEs and maybe find some new ones by applying your learned skills.

## Recommendation

Don't miss out on the following write-up from Cristián Rojas, using SilverCrawler as Silverpeas Administrator to read the Silverpeas configuration files:

{% embed url="<https://github.com/injcristianrojas/writeups/tree/main/thm/20250110_silverplatter>" %}
