> 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/active-directory/enumeration/impacket-and-rpcclient.md).

# Impacket وrpcclient

### إعدادات DNS المحلية

على جهاز لينكس، نضيف عمليات حلّ DNS في `/etc/hosts`:

{% code overflow="wrap" %}

```bash
172.16.0.10 WS01.whoami.local
172.16.0.20 WS02.whoami.local
172.16.0.100 DC01.whoami.local
```

{% endcode %}

يتيح ذلك استخدام أسماء الأجهزة بدلاً من عناوين IP.

### الاستكشاف باستخدام rpcclient

الاتصال باستخدام مستخدم نطاق:

{% code overflow="wrap" %}

```bash
rpcclient -U "whoami/user1" WS01.whoami.local
```

{% endcode %}

`rpcclient` يمكنه الاستعلام عن خدمات RPC محددة في Windows.

يمكن استخدامه لسرد:

* مستخدمين؛
* مجموعات؛
* بعض معلومات SAM؛
* بعض معلومات النطاق اعتمادًا على الصلاحيات المتاحة.

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

### الاستكشاف باستخدام Impacket

#### تفريغ متزامن

{% code overflow="wrap" %}

```bash
samrdump.py 'whoami/user2'@WS02.whoami.local
```

{% endcode %}

`samrdump.py` يتيح لك سرد معلومات SAM المتاحة عن بُعد.

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

#### تفريغ الأسرار

{% code overflow="wrap" %}

```bash
secretsdump.py 'whoami/user2'@WS02.whoami.local
```

{% endcode %}

`secretsdump.py` أكثر حساسية: يُستخدم لاستخراج الأسرار أو القيم التجزئية (الهاشات) عندما يمتلك المستخدم الصلاحيات اللازمة.

في بيئة مختبرية، يمكنك التجربة باستخدام مستخدم ذي صلاحيات مرتفعة.

### الاستماع إلى الجلسات باستخدام NetView

{% code overflow="wrap" %}

```bash
netview.py 'whoami/administrador' -target WS01.whoami.local
```

{% endcode %}

يتيح هذا الأمر مراقبة بعض الجلسات أو الاتصالات المرتبطة بجهاز مستهدف.

ثم يمكننا إنشاء اتصال SMB مع الجهاز:

{% code overflow="wrap" %}

```bash
dir //WS01/c$
```

{% endcode %}

إذا تم إنشاء جلسة، فقد تكون مرئية باستخدام أدوات الاستكشاف.

<figure><img src="/files/b59cf84384737e6e334f014623a0dc053e987e73" 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/active-directory/enumeration/impacket-and-rpcclient.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.
