holiday-hack-challenge-2023

SANS Holiday Hack Challenge

View on GitHub

elf-hunt drawingdrawingdrawingdrawingdrawing

< Back Home

Objective

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

Conversations

Piney Sappington

Initial conversation:

After solving challenge:

Hints

Useful AI Prompts

Approach

This is too easy - no need to mess with the JWT. When the game starts, right click and select inspect. In the console, type:

score = 100

When completed, I recieved a copy of the Captain’s journal.

Alternate approach

Okay fine - you want to modify the JWT. Opening up developer tools, and going to Application -> Cookies, I find a cookie named ElfHunt_JWT. Looking at the value:

eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzcGVlZCI6LTUwMH0.

There is something missing. The JWT should have three parts separated by a “.” - the Header, payload and signature. If we look at the JWT above, we can see there is a header and payload, but no signature.

You can modify the JWT token (and therefor it’s payload) because it is not signed and therefor the game is not validating the signature. In the payload, speed is set to -500 but you can set it to anything using https://jwt.io and then pasting the encoded cookie back to your browser.

Resources

JWT Dev

PortSwigger’s JWT Guide