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

# Impacket und rpcclient

### Lokale DNS-Konfiguration

Auf der Linux-Maschine fügen wir die DNS-Auflösungen in `/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 %}

Dies ermöglicht die Verwendung von Rechnernamen anstelle von IP-Adressen.

### Enumeration mit rpcclient

Verbindung mit einem Domänenbenutzer:

{% code overflow="wrap" %}

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

{% endcode %}

`rpcclient` kann bestimmte Windows-RPC-Dienste abfragen.

Es kann verwendet werden, um aufzulisten:

* Benutzer;
* Gruppen;
* einige SAM-Informationen;
* bestimmte Domäneninformationen, abhängig von den verfügbaren Rechten.

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

### Enumeration mit Impacket

#### Sync-Dump

{% code overflow="wrap" %}

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

{% endcode %}

`samrdump.py` ermöglicht es, remote zugängliche SAM-Informationen aufzulisten.

<figure><img src="/files/67d7cca6792c0d0be5ae0ee5920e57d7053e1d14" alt=""><figcaption></figcaption></figure>

#### secretsdump

{% code overflow="wrap" %}

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

{% endcode %}

`secretsdump.py` ist sensibler: Es wird verwendet, um Secrets oder Hashes zu extrahieren, wenn der Benutzer über die erforderlichen Rechte verfügt.

In einem Labor kannst du mit einem Benutzer mit erhöhten Berechtigungen testen.

### Sitzungen mit NetView überwachen

{% code overflow="wrap" %}

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

{% endcode %}

Dieser Befehl ermöglicht es dir, bestimmte Sitzungen oder Verbindungen zu beobachten, die mit einem Zielrechner verknüpft sind.

Dann können wir eine SMB-Verbindung zum Rechner herstellen:

{% code overflow="wrap" %}

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

{% endcode %}

Wenn eine Sitzung hergestellt ist, kann sie mit den Enumeration-Tools sichtbar sein.

<figure><img src="/files/605c7ba2fbf753a5cc6fb560317cef414c17063c" 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/de/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.
