> For the complete documentation index, see [llms.txt](https://www.thehiddencastle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.thehiddencastle.io/byuctf-2025/web.md).

# WEB

### Wembsoncket

Wembsoncket is a WebSocket-based chat interface that allows you to supply any URL for the “URL Bot” (a headless Puppeteer instance) to visit. Unbeknownst to users, this headless browser is already authenticated as the admin—the bot has been seeded with an `httpOnly`, `Secure; SameSite=None` JWT cookie for the admin account. That means any page it loads can invisibly carry that session into further requests.

Host a minimal HTML page that:

1. Opens a secure WebSocket to the challenge server.
2. Sends the `/getFlag` command upon connection.
3. Forwards any incoming message (the flag) to an attacker-controlled endpoint.

{% embed url="<https://gist.github.com/0xNawaf/91730eb1730466521b0221abe307dfe6>" %}

GitHub raw Gists default to `Content-Type: text/plain`, so browsers won’t execute the `<script>`. Two easy fixes:

<https://gistcdn.githack.com/>\<USER>/\<GIST-ID>/raw/leak.html

This proxy adds `Content-Type: text/html` and is lightning-fast (<10 s).

**Send** that URL to the challenge:

<figure><img src="/files/YcU4M00c4AMI0L2d0JCY" alt=""><figcaption></figcaption></figure>

**Observe** your webhook’s incoming GET request:

<figure><img src="/files/CRTPGN9T0Bt9ywRVbZeQ" alt=""><figcaption></figcaption></figure>

FLAG `byuctf{CSWSH_1s_a_b1g_acr0nym}` &#x20;

#### **Challenge files**

{% embed url="<https://github.com/BYU-CSA/BYUCTF-2025/tree/main/web/wembsoncket>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.thehiddencastle.io/byuctf-2025/web.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
