> For the complete documentation index, see [llms.txt](https://dev-angelist.gitbook.io/writeups-and-walkthroughs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-angelist.gitbook.io/writeups-and-walkthroughs/portswigger-web-security-academy/deserialization-insecure/java-insecure-deserialization/lab.md).

# Lab

https\://portswigger.net/web-security/api-testing/lab-exploiting-api-endpoint-using-documentation

## Description

## Solution

Go to login page and access as wiener user.

JWT extension reveal that there's a JWT token, obviously related to wiener user account

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FShLy9ujFey8fJbyoxrTJ%2Fimage.png?alt=media&amp;token=ee2d567c-1c80-4767-ada5-77a053038f82" alt=""><figcaption></figcaption></figure>

```json
{"iss":"portswigger","exp":1742668339,"sub":"wiener"}
```

Send it to repeater and select JSON web Token tab to deep dive to it

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FHOw0s2mveVy2ok1bOX1j%2Fimage.png?alt=media&amp;token=17a4a644-f87c-46b1-ae17-28d15ff3e67f" alt=""><figcaption></figcaption></figure>

Modify the sub field inserting: "administrator" (if the key field isn't compiled, is necessary to add it clicking to Sign button)

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F37LdvxqQzJBCKgWU8iC4%2Fimage.png?alt=media&amp;token=1ba6fbc4-c4d0-4ccd-a8be-4a760153df7b" alt=""><figcaption></figcaption></figure>

and click first on the **Send** button and then on **Following redirection** button

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F7uAZucHSDXGuMWL9njJ0%2Fimage.png?alt=media&amp;token=b3fff0c8-aa04-46c5-941d-7865e408de72" alt=""><figcaption></figcaption></figure>

authenticating us as administrator

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F23S4urAm25NwcrsUCRnD%2Fimage.png?alt=media&amp;token=ca63e421-d592-480f-82ad-662f0019089f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F98S6hg7FxxFQFutAOLls%2Fimage.png?alt=media&amp;token=be88e57f-67db-453d-921a-9e65f39e71fc" alt=""><figcaption></figcaption></figure>

Checking the response the admin panel's path is: `/admin`

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FTAegFAsYBljFXVD96nZo%2Fimage.png?alt=media&amp;token=f448bc12-9c9a-4bfa-8bef-6ed72bf6280e" alt=""><figcaption></figcaption></figure>

so we can move there via a GET request: `GET /admin HTTP/2`

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2Fd7LALNgSchDBoarTwu79%2Fimage.png?alt=media&amp;token=30776012-830c-4883-b62a-2d3e7f70ba1a" alt=""><figcaption></figcaption></figure>

analyzing the response, we see that the request to delete the user Carlos is the following: `GET /admin/delete?username=carlos HTTP/2`

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F5RkvZQehnF42mqHhzE5R%2Fimage.png?alt=media&amp;token=b756046a-28cc-4ae3-b45c-e3fd99a83e6c" alt=""><figcaption></figcaption></figure>

So, Send and click to Following redirection to delete it and complete the lab.

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FBw8Vk2nfArDV0oGS3qJR%2Fimage.png?alt=media&amp;token=f1f876b3-c81f-45e4-b1b4-d6ec7a4474e9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FBPLqZ4QIinVovNs3S29n%2Fimage.png?alt=media&amp;token=8c607c8a-6fbd-4f29-bf0d-c2a3657a8c3d" alt=""><figcaption></figcaption></figure>
