> For the complete documentation index, see [llms.txt](https://notes.dollarboysushil.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.dollarboysushil.com/web-application-pentest/bugforge/jwt-secret-key-brute-forcing/cheesy-does-it-cheesy-007.md). Agents can also search and read this documentation through its [MCP server](https://notes.dollarboysushil.com/~gitbook/mcp).

# Cheesy Does it - cheesy-007

Level: Easy\
Points: 10\
Type: Daily Challenge

### Steps

* **Registered** and got a JWT with a `role` parameter

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2F1Oae5PWxsZZ6VXB7NE6m%2Fimage.png?alt=media&amp;token=8fdf9fa4-479f-4d83-ab61-dda9931e19b5" alt=""><figcaption></figcaption></figure>

* **Cracked the secret** using Burp Suite's JWT Editor extension (weak HMAC secret attack) → found it was `secret`

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2Ftzctp5RoIov9bKt3xGMz%2Fimage.png?alt=media&amp;token=e7aa2eb2-5c29-4af2-830b-edcc56907bcc" alt=""><figcaption></figcaption></figure>

* **Created a new symmetric key** in JWT Editor using `secret`

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2Fo2F2V2pkAoaWqjJPaFOs%2Fimage.png?alt=media&amp;token=b07b2122-385e-4f6a-8649-d2ad56f04fc1" alt=""><figcaption></figcaption></figure>

* **Modified the payload:**
  * Changed `role` to `admin`
  * Changed `id` to `1`
* **Signed** the modified JWT with the symmetric key

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FJj9UGu97j2yP3zT70IoW%2Fimage.png?alt=media&amp;token=a138b46a-407b-4b96-b7b7-ce0f99c63cc0" alt=""><figcaption></figcaption></figure>

* **Sent the request** with the forged token → worked successfully
* **Accessed** `/api/admin/users` and got the flag from the `X-Flag` response header

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FCh89wKoirLzKFo2reb0T%2Fimage.png?alt=media&amp;token=eb836528-cd8a-4376-9b74-121f3ce9d6cb" alt=""><figcaption></figcaption></figure>
