# Elf Hunt

### Objective

"Piney Sappington needs a lesson in JSON web tokens. Hack Elf Hunt and score 75 points."

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

### Solution

This challenge involves manipulating the provided JWT to slow the Elves down to where you can hit them.&#x20;

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

You can easily see the values of your JWT by using [this tool](https://jwt.io/). When we decode it, we can see that there is a "speed" data payload.&#x20;

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

This part of the token is just base64, so you can use any tool to generate an edited payload. I used an [online base64 encoder](https://www.base64encode.org/) to make sure that I was able to make it url safe. I moved the speed to -100, but it may take some trial and error to find a good speed.

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

Then, edit your cookie and reopen the challenge for it to load. You should notice the elves moving at a much slower speed and thus easier to hit.

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

<figure><img src="/files/FEAGrel182ZosIWVohLg" alt=""><figcaption><p>Speed before JWT tampering</p></figcaption></figure>

<figure><img src="/files/0MZaRUn2Wc4n0L8WTuEm" alt=""><figcaption><p>Speed after JWT tampering</p></figcaption></figure>


---

# Agent Instructions: 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://holidayhack23.thepestotech.com/elf-hunt.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.
