> 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-vulnerabilities/deserialization-attack/php-deserialization-rce-pentesting-web.md).

# RCE عبر إلغاء تسلسل PHP

## إلغاء التسلسل (PHP)

وجدنا موقعًا إلكترونيًا يمكنك فيه **إرسال pings**:

<figure><img src="/files/a196b7f4bb34f8fd4fd8ad31a4909bcc9633dc39" alt="" width="563"><figcaption></figcaption></figure>

حاولنا **اختبار مدخلات مختلفة**، لكن لم ينجح شيء:

<figure><img src="/files/caecaded430ea2ebf2fbc3a162b4f4041b079d4a" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/53e8c86b365e964847904e2feb967ae4cb4fef57" alt="" width="530"><figcaption></figcaption></figure>

نرسل ping إلى **عنوان IP الخاص بالمهاجم** ونعترض الطلب باستخدام [Burp](/ar/hacking-tools/web/burpsuite.md):

<figure><img src="/files/24f77acdbcdd2e86887fe8de74d63667e6ee0857" alt="" width="563"><figcaption></figcaption></figure>

نرى أنه **مُسلسل**:

<figure><img src="/files/520663f333597c3c54fb94da05f83f91ffe036b2" alt="" width="563"><figcaption></figcaption></figure>

الـ **PHP** الكود الذي نواجهه مشابه لما يلي:

<figure><img src="/files/63e026f5f6d9816bb7f523d82bbb0fd1bfd39b10" alt="" width="563"><figcaption></figcaption></figure>

بعد تحليل الكود، نلاحظ أن تغيير **$isValid** إلى `true` وحقن reverse shell في **ipAddress** بعد **;** يجب أن يؤدي إلى تنفيذ الأوامر:

<figure><img src="/files/adb8d2fd2dfe089fb1f02825392e27b89cfa06b0" alt="" width="563"><figcaption></figcaption></figure>

ثم نقوم **بتسلسل** الملف مرة أخرى باستخدام **PHP**:

<figure><img src="/files/4190f5877ff941db3b62fdfd411dc3ada606a558" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6b31756f34f0e3a5033ccbc949dcefedad8a97eb" alt="" width="563"><figcaption></figcaption></figure>

مع **Netcat**، نستمع على المنفذ **443** ونستقبل shell:

<figure><img src="/files/300138b6fa602aa43bc46e3be9d9d8f8dcf767f2" alt="" width="563"><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-vulnerabilities/deserialization-attack/php-deserialization-rce-pentesting-web.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.
